File Version

  • Print

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.

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

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

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:

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.

[Constants]
#BUILD# = 1.0.1.0

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"

Download

For users of Setup Factory

Click to downloadFile size: 7 KB
Updated: September 2009
 

Add a comment (For questions, please use the contact form.)

Security code
Refresh

Our Plugins & Examples Feed

  • Crypto Actions updated to 2.2.1.0

    A new version of the Crypto plugin was released today. This version adds a function...

  • Serial Number Validation updated to 1.0.1

    The Serial Number Validation toolset was upgraded to release 1.0.1.0. This new version adds optional...

Subscribe now!

Do you need help?

clockWe provide customer support for Indigo Rose software development products since 2008!
Please contact us if you need assistance for designing, debugging, or finishing your project on time.