I'm making a setup script in Inno and I was wondering, how can I get non "hardcoded" path. Here is example:
Thanks in advance!
SOLUTION:
You can get .iss folder by using predefined variable
SourcePath
Usage would be like: {#SourcePath}\???\bin\x86\Release\???.exe
Thanks all who contributed!
Best Solution
The reference about the
source directory
says (emphasized by me):This includes also option to specify relative path to the files. So let's assume that you have the following file structure and you didn't specify a different path in the
SourceDir
directive:Now if you'd like to include the
MyProg.exe
into the setup compiled from theScript.iss
script, you could specify just the file name without the path, since theMyProg.exe
file is stored in the same folder as the script, so you could write just:And you can use a relative path to the
MyOtherProg.exe
which is stored in the subfolder of the folder where theScript.iss
script is stored this way:As well as you can use a relative path to include the
SomeFile.txt
stored in a subfolder of the parent folder where the script is stored:More about relative path conventions you can read in
this chapter
.