Search code examples
inno-setuppascalscript

How to include a script file whose name is read from the INI file?


I would like to include a script file whose name will be read from an INI file. I've tried this:

#include <subfolder\{#ReadIni(SourcePath + "File.ini", "Section", "Key", "")}.iss>

but the compilation fails on this error:

File not found: "subfolder\{#ReadIni(SourcePath + "File.ini", "Section", "Key", "")}.iss"

How can I include a script file whose name is read from the INI file?


Solution

  • You cannot inline function result that way. Do it like this:

    #include "subfolder\" + ReadIni(SourcePath + "File.ini", "Section", "Key", "") + ".iss"