2

After referencing GetStringFileInfo post, I try to read Assembly information and apply AppName and FileVersion to Inno Setup script as below.

But compiled installation wizard shows just "GetStringFileInfo("{#RootDirectory}Sample.exe","Title")" as a software title. The GetStringFileInfo was not processed at all. How can I make it run correctly?

#define RootDirectory "bin\Release\"

[Setup]
AppName=GetStringFileInfo("{#RootDirectory}Sample.exe","Title")
AppVersion=GetStringFileInfo("{#RootDirectory}Sample.exe","FileVersion")

Note that I'm using Script Studio and the file resides in setup.iss which created by Inno Setup wizard.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Youngjae
  • 24,352
  • 18
  • 113
  • 198

2 Answers2

2

This is an alternative approach based on the example provided with Inno Setup. Their code shows:

#define AppVersion GetFileVersion(AddBackslash(SourcePath) + "MyProg.exe")

[Setup]
AppVersion={#AppVersion}
VersionInfoVersion={#AppVersion}

I have cut out the rest of the example. Notice that the call to GetFileVersion was done outside of the [Setup] section. The other answer has a more direct way to do it within the [Setup] section.

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
1

GetStringFileInfo is a preprocessor function. A syntax for an inline call of a preprocessor function is:

AppName={#GetStringFileInfo(RootDirectory + "Sample.exe", "Title")}
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992