I have used Inno Setup many years ago and the following worked well#define MyAppVersion GetStringFileInfo( "AddBackslash(SourcePath) + \someApp.exe", "ProductVersion" )
Then I figured in [Setup] I could use the GetVersion function with OutputBaseFilename={#SetupBaseName}{code:GetVersion}.


Hi Martijn,Thank you for the quick reply. I have tried both defines you shared; neither are working for me.
On Thursday, February 26, 2026 at 9:46:50 AM UTC-6 Martijn Laan wrote:Hi,
Op 26-2-2026 om 16:33 schreef 'Dan Bomsta' via innosetup:
I have used Inno Setup many years ago and the following worked well#define MyAppVersion GetStringFileInfo( "AddBackslash(SourcePath) + \someApp.exe", "ProductVersion" )
The first quote is in the wrong place, so I do not think this can have ever worked. There is also an extra, unneeded backslash.
This works for me:
#define MyAppVersion GetStringFileInfo(AddBackslash(SourcePath) + "someApp.exe", "ProductVersion")
Which can be written shorter as:
#define MyAppVersion GetFileProductVersion(AddBackslash(SourcePath) + "someApp.exe")
Then I figured in [Setup] I could use the GetVersion function with OutputBaseFilename={#SetupBaseName}{code:GetVersion}.Using {code:} does not work here because it is runtime functionality, not compile time.
Greetings,
Martijn
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/1bf22984-e80e-4ea0-bbcb-7e07a213a9c5n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/7aa55384-268f-488c-929f-80eda2bafe5cn%40googlegroups.com.
Jeff's second solution works, I didn't try the first. I defined verinfo_source as the full path string to the exe.
Jeff's second solution works, I didn't try the first. I defined verinfo_source as the full path string to the exe.It is unclear why the usual way #define MyAppVersion GetFileProductVersion(AddBackslash(SourcePath) + "someApp.exe") is not working. At least I have a working solution now.
Jeff's second solution works, I didn't try the first. I defined verinfo_source as the full path string to the exe.
It is unclear why the usual way #define MyAppVersion GetFileProductVersion(AddBackslash(SourcePath) + "someApp.exe") is not working. At least I have a working solution now.