In my Inno Setup script, I have a variable called BuildString
defined like below.
#ifndef BuildString
#define BuildString " - No Config"
But in my VS project post-build event, I will have some specific value passed in like "Beta"
/"Admin"
or even just an empty string like " "
.
In my [Icons]
section, I have an if
-statement to conditionally create shortcuts for the software and codes are as follows.
#if SameText(BuildString, " - some text")
Name: "{group}\---"; Filename: "{app}\---.exe"; \
IconFilename: "{app}\---.exe"; Parameters:""
Name: "{commondesktop}\---"; Filename: "{app}\---.exe"; \
IconFilename: "{app}\---.exe"; Parameters:""
#endif
I have tried with the "Beta"
keyword and I can build the installer without issues via VS.
But if I passed in " "
(a space, it's legitimate in my use-case). I then have this error shown in the output window.
Error on line 110 in Installer.iss: [ISPP] Actual parameter S1 is not of the declared type.
Line 110 is referring to the code #if SameText(BuildString, " - some text")
I have tried to compile the same script using Inno Setup compiler and it was no issue. So I wonder if there is any difference between the way VS/Inno Setup compiler compiles the codes.
This is the build config I am building.
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Editor - Master - Obfuscated|x86' ">
<UpgradeCode>00000000000000000000</UpgradeCode>
<BuildString>
</BuildString>
<CmdLineArgs>
</CmdLineArgs>
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<Prefer32Bit>false</Prefer32Bit>
And I call the Inno script using the command below in PostBuildEvent
of my Installer project.
<PostBuildEvent>"$(ProjectDir)InnoSetUp\ISCC.exe" "$(ProjectDir)Installer.iss" "/DProjectDir=$(ProjectDir).." "/DBuildConfig=$(Configuration)" "/DBuildString=$(BuildString)" "/DCmdLineArgs=$(CmdLineArgs)"
Powershell.exe -executionpolicy remotesigned -File "$(ProjectDir)$(OutDir)..\..\Pcmtec.Installer.ps1" "$(BuildString)"</PostBuildEvent>