i use inno setup to build the installer for my app.  i like to show the version number (from the version resource in the compiled exe) and the built date in the installer as show below:

since inno setup is script based, that can easily be done as below:

but i don't want to manually update the inno script every time i have a new build, so i automate it.  i already have a make.prg which i run to build my project, all i have to do is to enhance it to update the version and timestamp automatically. 

that boils down to the following steps:
1. using agetfileversion() and fdate() on the exe to get the version number and the built date
2. check out the inno script from sourcesafe
3. stuff it to the inno script using filetostr(), strextract(), strtran() and strtofile()
4. check in the inno script back to sourcesafe
3. call the inno setup compiler to build the installer

so by issuing do make at the vfp command window, i will have the installer automatically built with the correct version and timestamp, and also have the latest inno setup script in source control.  the fact that both inno setup and sourcesafe have command line interface make things much easier, not to mention the readily available vfp built-in commands.

attached is the make.prg in its entirety.

make.prg

3 Responses to Automating Installer Build Process

  • Andrew says:

    David,

    I do something similar as well – only after I’ve finished building it, I then upload it automatically to a web site using WinSCP.

    Very cool and makes deployment super easy!

  • davidfung says:

    Hi Andrew, thanks for bringing up the scriptable WinSCP, nice one to add to my toolbox 🙂

  • #define AppSourceExeFileName "D:\Projects\MyProgram\MyProgram.exe"

    #define AppName "MyProgram"

    #define AppVersion GetFileVersion(AppSourceExeFileName)

    #define AppVerName AppName + " " + AppVersion

    [Setup]

    AppName={#AppName}

    AppVerName={#AppVerName}

    AppVersion={#AppVersion}

Leave a Reply

Your email address will not be published. Required fields are marked *