Programmatically define OutputBaseFilename

202 views
Skip to first unread message

Paul Gardiner

unread,
Aug 17, 2023, 6:00:26 AM8/17/23
to innosetup
I'd like to make my installer's file name depend on my program's version. Inno is able to derive the program's version, process that string, and use the value in the definitions of variables, but OutputBaseFilename seems to be a special case, and doesn't permit {code:xx} uses in its definition. Is there a good workaround for this?

Robert van der Hulst

unread,
Aug 17, 2023, 4:58:36 PM8/17/23
to innosetup
Paul,
Use the preprocessor.
Something like this:
#define Version             "a.b.c.d"
#define SetupExeName        "MySetup."+Version
.
.
OutputBaseFilename={#SetupExeName}


Robert
Op donderdag 17 augustus 2023 om 12:00:26 UTC+2 schreef Paul Gardiner:

Paul Gardiner

unread,
Aug 18, 2023, 6:35:41 AM8/18/23
to innosetup
Yes that did it, thanks Robert. The problem I was seeing was only when I tried to use GetVersionNumbersString rather than defining Version explicitly. I had been trying to do it from Pascal code. I hadn't realised that GetVersionNumbersString could be called from the preprocessor. This is a great: now I don't need to update the inno script for eash release.
Reply all
Reply to author
Forward
0 new messages