Resource Tools: 64-bit build

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 Windows Scripting Host (respectively, 32-bit from C:\Windows\syswow64 or 64-bit from C:\Windows\system32 – in 64-bit Windows) can leverage the tool in file manipulation.

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 ResourceTools.dll-1.0.6.296.7z archive file out of ResourceTools.dll and corresponding ResourceTools.pdb files):

image = new ActiveXObject("AlaxInfo.ResourceTools.Image");
image.Initialize(inputDirectory + fileName);
productVersion = image.VersionInfo.ProductVersionString;
fileVersion = image.VersionInfo.FileVersionString;
WScript.Echo(" Product Version: " + productVersion);
WScript.Echo(" File Version: " + fileVersion);
shell = WScript.CreateObject("WScript.Shell");
currentDirectory = shell.CurrentDirectory;
shell.CurrentDirectory = currentDirectory + "\\" + inputDirectory;
try {
    shellExec = shell.Exec(
        "\"" + toolDirectory + "7z" + "\" " +
        "a -t7z " +
        "\"" + currentDirectory + "\\" + outputDirectory + "ResourceTools.dll-" + fileVersion + ".7z" + "\" " +
        "ResourceTools.dll" + " " +
        "ResourceTools.pdb" + " " +
        "");
    while (shellExec.Status == 0)
        WScript.Sleep(100);
    if (shellExec.ExitCode != 0)
        throw new Error("7-Zip Exec failed, .ExitCode " + shellExec.ExitCode.toString());
    WScript.Echo(" Output File: " + "ResourceTools-" + fileVersion + ".7z");
}
finally {
    shell.CurrentDirectory = currentDirectory;
}

Title: Alax.Info Resource Tools
Version: 1.0.6
Download Links: ResourceToolsSetup.msi (Win32, 32-bit) and ResourceToolsSetup-x64.msi (x64, 64-bit)

Leave a Reply