At the end of an installation I need to run a Pascal function that updates a flight simulator .cfg file (called .ini file in Inno Setup). The Pascal function exists in its [Code] section and runs correctly. I would like to run this Pascal function in the [Run] section using StatusMsg to tell the user what is going on.
[Run]
Filename: {code:FsxEditSceneryFile|Add#<scenerySpec>}; StatusMsg: "Add scenery to FSX";
; <scenerySpec> is just a place holder of the actual scenery specification!
All works as expected with the exception that Inno Setup forces me to use a string as return value of the Pascal function. However the Filename statement requires a Boolean as return value to specify if the execution was successful (True) or failed (False). This type mismatch produces an error message box at the end of the execution of the Filename statement saying
CreateProcess failed; Code 87. Wrong Parameter.
Any proposal how this could be solved? I know that event functions exist that I could use e.g. CurStepChanged() but I find the StatusMsg mechanism very nice to tell the user what is done by the installation.