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.


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

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"


For users of Setup Factory

Click to downloadFile size: 7 KB
Updated: September 2009


# Detlef 2013-05-09 10:50
A real time-saver ! Thanks heaps !

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

Security code

Our Plugins & Examples Feed

  • POP3 Actions plugin released

    A new, free actions plugin was released today. With it, the developer can check POP3...

  • Reminder: Update Serial Number Validation and/or Subscription Validation

    Next week IPInfoDB's API 2.0 will stop working. If you use an older version than...

Subscribe now!