I have a requirement to install a setup (created via inno setup) in two different destination folders.
My goal is to use a ini file to determine the destination directory while installing it.
Setup.ini file
[Settings]
#======================================================================
DestDir=C:\\Software\\Path1
#======================================================================
Inno Setup File
#define DestinationDir ReadIni("Setup.ini", "Settings", "DestDir", "")
[Files]
Source: "D:\Publish\MyService.exe"; DestDir: "{#DestDir}"; Flags: ignoreversion
[Run]
Filename: "{#DestDir}\MyService.exe"; Parameters: "-i -name MyService-display ""My Service"""; StatusMsg: "Installing my service";
I copy the installer file (setup.exe) to the server together with the .ini file (set to path1) and run the installer. I expect myService.exe file to be copied into Path1 ("C:\Software\Path1").
Then I will change the .ini file to following and re-run the installer. I expect myService.exe file to be copied into Path2 ("C:\Software\Path2").
[Settings]
#======================================================================
DestDir=C:\\Software\\Path2
#======================================================================
However, this is not working at all. Seems like the ini file can be referred only when we creating the setup installer via inno setup, not while executing the installer. Any suggestions how to achieve this?