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
  • 167,268
  • 50
  • 405
  • 846
Youngjae
  • 22,962
  • 17
  • 106
  • 189

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
  • 15,857
  • 13
  • 55
  • 132
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
  • 167,268
  • 50
  • 405
  • 846