Setup programs created with Inno Setup could read an INI file through /LOADINF option. Is it possible to read custom variables through this INI file? Is there a function to get the name of the INI file given with this option? (Then it is possible with the INI utility functions.)
2
votes
2 Answers
2
votes
1
votes
We simply iterate over the commandline arguments using the ParamStr(i)
function and look for an argument starting with "/LOADINF=
" and then extract the file name from there.
One gotcha that got us initially was that the file name might be a relative path descriptor (e.g. just the file name). However, if you use compression then the current working directory will be some sub-folder in your %TEMP%
folder rather than the directory where your setup.exe is. You should therefore make sure to detect this and prepend the given file name with AddBackslash(ExpandConstant('{src}'))
if necessary.