inno-setup

Using GetStringFileInfo in Setup section of Inno Setup


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.


Solution

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

    AppName={#GetStringFileInfo(RootDirectory + "Sample.exe", "Title")}