Inno setup - relative path to ReadIni

How to set relative path to ini file in ReadIni?

It works:

#define MyAppVersion ReadIni("C:\Users\Popov\Documents\Release\Install.ini", "Release", "VersionNumber") 

But I want this:

 #define MyAppVersion ReadIni("Install.ini", "Release", "VersionNumber") 

Where Install.ini is located in the inno script folder.

+6
source share
1 answer

Use the predefined SourcePath variable, for example:

SourcePath str. Indicates the directory where the current script is located, or the My Documents directory, if the script has not yet been saved.

 #define MyAppVersion ReadIni(SourcePath + "\Install.ini", "Release", "VersionNumber") [Setup] AppName=My Program AppVersion={#MyAppVersion} 
+10
source

All Articles