How to get path, where the InnoSetup script file you are currently compiling is located ?
1 Answer
To get script source path, use the preprocessor's predefined variable SourcePath. That variable you can expand in your script as an ordinary define. In case, the script was not yet been saved, it returns path to My Documents directory. Here's just a useless example to test:
[Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program [Code] procedure InitializeWizard; begin MsgBox(ExpandConstant('{#SourcePath}'), mbInformation, MB_OK); end; Don't forget that you have to compile the script (CTRL + F9) not only run (F9) to invoke preprocessor to rebuild the script.
ExpandConstant('{#SourcePath}'), but script file name... What you gonna do with that information, anyway ?