PDA

View Full Version : FileVersion tool for Setup Factory


Ulrich
09-29-2009, 02:33 PM
I have build a new small command line tool for Setup Factory (can be used as well with TrueUpdate and Visual Patch) that might be useful. Using this tool, you will be able to create or modify an unattended build constants file, inserting the file version info from a certain file. The idea is to use this constants file for naming automatically the installer that is created, and/or using the detected file version in the screens of the installer.

How to use

First, insert the #BUILD# constant into your project (the name of the constant cannot be changed), like shown in this image. You may set an initial value for the constant, but this is not mandatory.

http://www.mindquake.com.br/files/suf/SNAG-090929-01.png

Now you can use the constant in your project file. For example, you can set the output filename, using the constant:

http://www.mindquake.com.br/files/suf/SNAG-090929-04.png

You may use the constant in the installer resources as well, as in this example:

http://www.mindquake.com.br/files/suf/SNAG-090929-02.png

And of course, you can use the build constant to set a session variable, so the same information can be displayed in the dialogs of your installer:

http://www.mindquake.com.br/files/suf/SNAG-090929-03.png

After you have set up your project to use the #BUILD# constant, all you need now is feed the version info of the main component of your project into this constant. You will create a new or modify an existing INI file with build constants, with a command like this:

FileVersion.exe "C:\My Project\Product.exe" "C:\My Project\build.ini"

This command will set the #BUILD# value in the [Constants] section of the INI file named build.ini with the file version info of Product.exe. If the file build.ini already exists, all former values are kept and only #BUILD# will be updated.

You will typically execute this command before starting the unattended build of your installer. Here is one example of a possible batch file:

@ECHO OFF
ECHO Updating the unattended build constants file
FileVersion.exe "C:\My Project\Product.exe" "C:\My Project\build.ini"

ECHO Creating installer
SUF80Design.exe /BUILD myproduct.sf8 /CONST:"C:\My Project\build.ini"


If you are interested, you can find the tool at my site (http://www.mindquake.com.br/suf-version.php).

Ulrich