Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno setup - relative path to ReadIni

Tags:

inno-setup

How can I set relative path to ini file in ReadIni?

This 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 in the inno script folder.

like image 327
Miroslav Popov Avatar asked Mar 08 '13 06:03

Miroslav Popov


1 Answers

Use the SourcePath predefined variable, like this:

SourcePath str. Points to 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}
like image 105
jachguate Avatar answered Nov 10 '22 19:11

jachguate