I have an setup script to generate the setup, this works fine. Now I created a PowerShell script, that takes 2 parameters, "program" - name of the program and "version", version of the program. The PowerShell script just copies the files somewhere based on the version.
In Inno Setup Studio I try to run the PowerShell script after the compile in the [PostCompile]
section with following line:
[PostCompile]
Name: "copysetups.cmd"; Parameters: "Program {#AppVers} "; Flags: cmdprompt redirectoutput
The batch file is called but the variable is not replaced with its value following output is shown in the messages window of Inno Script Studio:
powershell.exe .\copySetups.ps1 -program Program -version {#AppVer}
I also tried doing it via "code:
like this:
[PostCompile]
Name: "copysetups.cmd"; Parameters: "Program ""{code:GetAppVersion}"""; Flags: cmdprompt redirectoutput
The function:
function GetAppVersion( Param: String ): String;
begin
Result := '{#AppVer}';
end;
But this doesn't work either, output is again not with the value from the function.
powershell.exe .\copySetups.ps1 -program Program -version {code:GetAppVersion}