Category Archives: Resource Tools

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)

Freeware: Replace In Files and Resource Tools

Dear Friends and Subscribers,

There is a variety of software nowadays but it almost always happen that there is also something desired but missing, something that would ease one’s life but unavailable. As a software developer I do have this kind of desires on a regular basis and I do have special tools that ease the life, in particular automations tools.

Two of the tools are Replace In Files and Resource Tools are that enormously helpful in automating software release compilation process where there is a need to access Win32 resource scripts and compiled data. The both tools expose OLE Automation interfaces and used from VBScript and JScript script code.

Fully automated software builds is an important concept to avoid human factor in routine build process. If you have a number of C++ projects, re-distributables, installation scripts, additional materials, OEM program partners who need the same packages duplicated with replaced logos, manuals etc. and when you need to gather everything into a single distributable the task becomes too much routine to repeat again and again with every new version coming out as a result of development process. And sometimes you even might wish to compile builds on a daily basis! Or rewind and compile a version from past using version control repository code! Earlier or later you come to a conclusion that this part of the development has to be entirely automated because it is basically all the same again but the cost of a mistake of manual operation is very high.

Both Replace In Files and Resource Tools are freeware since now on! Merry Christmas and Happy New Year!
Read more »

Automated Resource Updater updated (1.0.4)

What’s new in this build?

  • Fixed:VersionInfo strings were saved as binary value (ass opposed to text value) and thus were unrecognized by some applications, including VerQueryValue API
  • Updated: Setup includes extras (license, blog shortcut etc.)

Read more »

Automated Resource Updater updated (1.0.3)

What’s new in this build?

  • Fixed: Dialog template update would fail on an attempt to set DS_FIXEDSYS or DS_SETFONT flags if none were previously set, as well as unset both flags if any of them were presiously set; This is required because dialog template structre has optional fields defining font which has to be added/removed with the style change
  • New: Dialog.ItemStyle property provides access to dialog template control’s styles, for instance, to set/unset WS_VISIBLE style

Read more »

Automated Resource Updater updated (1.0.2)

An update is inspired by necessity to strip DS_FIXEDSYS dialog style which Visual Studio adds to the dialog template once it is modified in resource editor.
What’s new in this build?

  • Fixed: Failure accessing STRINGTABLE values with identifiers such that ((IDS & 0x0F) == 0x0F)
  • New: Unicode build
  • New: Static link to C runtime, smaller binary and download
  • New: Dialogs property and accessor to resource dialog templates, dialogs collection exposes enumerator and individual resource accessor of type Dialog. Dialog object has a read/write Style property

Read more »

Automated Resource Updater updated

The COM object that allows automated file resource updates is updated with a few new features:

  • STRINGTABLE management, methods and properties to read/write string resources of a binary
  • BITMAP management, methods and properties to read/write bitmap resources of a binary

Documentation and samples are still pending, just a binary this time once again.

Here is where one can find syntax:

23-image001.png

Some more sample code:

WshShell = WScript.CreateObject(“WScript.Shell”);
WScript.Echo(“Current Directory: ” + WshShell.CurrentDirectory);
Image = new ActiveXObject(“AlaxInfo.ResourceTools.Image”);
Image.Initialize(WshShell.CurrentDirectory + “\\Sample.dll”);
Index = 77;
Value = Image.Bitmaps.Bitmap(Index).SaveToFile(null, WshShell.CurrentDirectory + “\\Bitmap.bmp”);
Value = Image.Bitmaps.Bitmap(Index + 1).LoadFromFile(1033, WshShell.CurrentDirectory + “\\Bitmap.bmp”);
Value = Image.Bitmaps.Bitmap(Index + 1).LoadFromFile(1049, WshShell.CurrentDirectory + “\\Bitmap.bmp”);
Image.Bitmaps.Update();
Image.EndUpdate(false);

Application Name: Alax.Info Resource Tools
License: Free for personal use, request commercial licenses via email or contact form
Latest Version: 1.0.1.226
Download Link: Alax.Info Resource Tools 1.0.1.226 (285K) ResourceToolsSetup.msi (Win32, 32-bit)

Resource Updater

Sometimes an automated update of the binary resource is required, to update version, product name, some custom string etc. We have an utility for this and and it found itsself being very useful.

We are unlikely to document it, I just leave a sample code illustrating how it all works.

Sample.js:

Image = new ActiveXObject(“AlaxInfoResourceTools.Image”);
Image.Initialize(“C:\\Sample.dll”);
WScript.Echo(“Product Version: ” + Image.VersionInfo.ProductVersionString);
WScript.Echo(“File Version: ” + Image.VersionInfo.FileVersionString);
var ProductName = Image.VersionInfo.GetString(0, “ProductName”);
var OemProductName = Image.VersionInfo.GetString(0, “OemProductName”);
WScript.Echo(“ProductName: ” + ProductName);
WScript.Echo(“OemProductName: ” + OemProductName);
Image.VersionInfo.SetString(0, “OemProductName”, “// ” + ProductName);
Image.VersionInfo.Update();
Image.EndUpdate(false);

Curious ones are invited to open type library to find out the syntax.

Download the COM object (265K) ResourceToolsSetup.msi (Win32, 32-bit)