{"id":1278,"date":"2011-08-30T18:56:34","date_gmt":"2011-08-30T16:56:34","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1278"},"modified":"2011-08-30T18:56:34","modified_gmt":"2011-08-30T16:56:34","slug":"resource-tools-64-bit-build","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1278","title":{"rendered":"Resource Tools: 64-bit build"},"content":{"rendered":"<p>I rebuilt the <a href=\"https:\/\/alax.info\/blog\/352\">Resource Tools<\/a> utility in 64-bits to, supposedly, be able to be good with resources on 64-bit binaries (actually 32-bit code might be dealing with those fine also?). Anyway, the build is here and the tool available in both 32-bit and 64-bit versions.<\/p>\n<p>In particular, both 32-bit and 64-bit JavaScript scripts hosted by <a href=\"http:\/\/en.wikipedia.org\/wiki\/Windows_Script_Host\">Windows Scripting Host<\/a> (respectively, 32-bit from C:\\Windows\\syswow64 or 64-bit from C:\\Windows\\system32 &#8211; in 64-bit Windows) can leverage the tool in file manipulation.<\/p>\n<p>This utility is specifically helpful in automating steps which involve resource updates, such as to apply OEM branding, or resource-based file operations. The code snippet below archives a copy of DLL and PDB files for published release into a .7z archive named using current file version of the DLL itself (that is, it created a <em>ResourceTools.dll-1.0.6.296.7z<\/em> archive file out of <em>ResourceTools.dll<\/em> and corresponding <em>ResourceTools.pdb<\/em> files):<\/p>\n<pre style=\"color: #000000; background: #ffffff;\">image <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000; font-weight: bold;\">new<\/span> ActiveXObject<span style=\"color: #808030;\">(<\/span><span style=\"color: #0000e6;\">\"AlaxInfo.ResourceTools.Image\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nimage<span style=\"color: #808030;\">.<\/span>Initialize<span style=\"color: #808030;\">(<\/span>inputDirectory <span style=\"color: #808030;\">+<\/span> fileName<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nproductVersion <span style=\"color: #808030;\">=<\/span> image<span style=\"color: #808030;\">.<\/span>VersionInfo<span style=\"color: #808030;\">.<\/span>ProductVersionString<span style=\"color: #800080;\">;<\/span>\r\nfileVersion <span style=\"color: #808030;\">=<\/span> image<span style=\"color: #808030;\">.<\/span>VersionInfo<span style=\"color: #808030;\">.<\/span>FileVersionString<span style=\"color: #800080;\">;<\/span>\r\nWScript<span style=\"color: #808030;\">.<\/span>Echo<span style=\"color: #808030;\">(<\/span><span style=\"color: #0000e6;\">\" Product Version: \"<\/span> <span style=\"color: #808030;\">+<\/span> productVersion<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nWScript<span style=\"color: #808030;\">.<\/span>Echo<span style=\"color: #808030;\">(<\/span><span style=\"color: #0000e6;\">\" File Version: \"<\/span> <span style=\"color: #808030;\">+<\/span> fileVersion<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nshell <span style=\"color: #808030;\">=<\/span> WScript<span style=\"color: #808030;\">.<\/span>CreateObject<span style=\"color: #808030;\">(<\/span><span style=\"color: #0000e6;\">\"WScript.Shell\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\ncurrentDirectory <span style=\"color: #808030;\">=<\/span> shell<span style=\"color: #808030;\">.<\/span>CurrentDirectory<span style=\"color: #800080;\">;<\/span>\r\nshell<span style=\"color: #808030;\">.<\/span>CurrentDirectory <span style=\"color: #808030;\">=<\/span> currentDirectory <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> inputDirectory<span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #800000; font-weight: bold;\">try<\/span> <span style=\"color: #800080;\">{<\/span>\r\n    shellExec <span style=\"color: #808030;\">=<\/span> shell<span style=\"color: #808030;\">.<\/span>Exec<span style=\"color: #808030;\">(<\/span>\r\n        <span style=\"color: #0000e6;\">\"<\/span><span style=\"color: #0f69ff;\">\\\"<\/span><span style=\"color: #0000e6;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> toolDirectory <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"7z\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"<\/span><span style=\"color: #0f69ff;\">\\\"<\/span><span style=\"color: #0000e6;\"> \"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n        <span style=\"color: #0000e6;\">\"a -t7z \"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n        <span style=\"color: #0000e6;\">\"<\/span><span style=\"color: #0f69ff;\">\\\"<\/span><span style=\"color: #0000e6;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> currentDirectory <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> outputDirectory <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"ResourceTools.dll-\"<\/span> <span style=\"color: #808030;\">+<\/span> fileVersion <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\".7z\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"<\/span><span style=\"color: #0f69ff;\">\\\"<\/span><span style=\"color: #0000e6;\"> \"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n        <span style=\"color: #0000e6;\">\"ResourceTools.dll\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\" \"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n        <span style=\"color: #0000e6;\">\"ResourceTools.pdb\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\" \"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n        <span style=\"color: #0000e6;\">\"\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n    <span style=\"color: #800000; font-weight: bold;\">while<\/span> <span style=\"color: #808030;\">(<\/span>shellExec<span style=\"color: #808030;\">.<\/span>Status <span style=\"color: #808030;\">==<\/span> <span style=\"color: #008c00;\">0<\/span><span style=\"color: #808030;\">)<\/span>\r\n        WScript<span style=\"color: #808030;\">.<\/span>Sleep<span style=\"color: #808030;\">(<\/span><span style=\"color: #008c00;\">100<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n    <span style=\"color: #800000; font-weight: bold;\">if<\/span> <span style=\"color: #808030;\">(<\/span>shellExec<span style=\"color: #808030;\">.<\/span>ExitCode <span style=\"color: #808030;\">!=<\/span> <span style=\"color: #008c00;\">0<\/span><span style=\"color: #808030;\">)<\/span>\r\n        <span style=\"color: #800000; font-weight: bold;\">throw<\/span> <span style=\"color: #800000; font-weight: bold;\">new<\/span> Error<span style=\"color: #808030;\">(<\/span><span style=\"color: #0000e6;\">\"7-Zip Exec failed, .ExitCode \"<\/span> <span style=\"color: #808030;\">+<\/span> shellExec<span style=\"color: #808030;\">.<\/span>ExitCode<span style=\"color: #808030;\">.<\/span><span style=\"color: #800000; font-weight: bold;\">toString<\/span><span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n    WScript<span style=\"color: #808030;\">.<\/span>Echo<span style=\"color: #808030;\">(<\/span><span style=\"color: #0000e6;\">\" Output File: \"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\"ResourceTools-\"<\/span> <span style=\"color: #808030;\">+<\/span> fileVersion <span style=\"color: #808030;\">+<\/span> <span style=\"color: #0000e6;\">\".7z\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #800080;\">}<\/span>\r\n<span style=\"color: #800000; font-weight: bold;\">finally<\/span> <span style=\"color: #800080;\">{<\/span>\r\n    shell<span style=\"color: #808030;\">.<\/span>CurrentDirectory <span style=\"color: #808030;\">=<\/span> currentDirectory<span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #800080;\">}<\/span><\/pre>\n<p>Title: Alax.Info Resource Tools<br \/>\nVersion: 1.0.6<br \/>\nDownload Links: <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/ResourceTools\/ResourceToolsSetup.msi\">ResourceToolsSetup.msi<\/a> (Win32, 32-bit) and <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/ResourceTools\/ResourceToolsSetup-x64.msi\">ResourceToolsSetup-x64.msi<\/a> (x64, 64-bit)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I rebuilt the Resource Tools utility in 64-bits to, supposedly, be able to be good with resources on 64-bit binaries (actually 32-bit code might be dealing with those fine also?). Anyway, the build is here and the tool available in both 32-bit and 64-bit versions. In particular, both 32-bit and 64-bit JavaScript scripts hosted by&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1278\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,12],"tags":[373,374,198,166,318,132,284],"class_list":["post-1278","post","type-post","status-publish","format-standard","hentry","category-resource-tools","category-technology","tag-rc","tag-res","tag-automation","tag-resource","tag-tool","tag-utility","tag-x64"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1278"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1278\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}