i have the following scenario: our build server calls makensis.exe with (among others) a parameter that contains Service Pack information. In case the current release is a Service Pack, the parameter has a value. In case it is not, it is empty.
The following code calls makensis.exe:
I then use this information to set the product information in the setup.exe as such:makensis.exe /DINSTALLER_VERSION_STRING=%v% /DINSTALLER_BUILD_NUMBER=%b% /DINSTALLER_SERVICEPACK_STRING=%sp%
VIProductVersion "${INSTALLER_VERSION_STRING}.${INSTALLER_SERVICEPACK_STRING}.0.${INSTALLER_BUILD_NUMBER}"My problem occurs when the build server sends an empty string as INSTALLER_SERVICEPACK_STRING. in this case, the VIProductVersion returns the following error: .Error: invalid VIProductVersion format, should be X.X.X.X
What I would like to do is assign to INSTALLER_SERVICEPACK_STRING the value "0" in case it is empty. I tried using this:
${If} ${INSTALLER_SERVICEPACK_STRING} ""
!define /redef INSTALLER_SERVICEPACK_STRING "0"
${EndIf}This returns the following error: I also tried using this:!insertmacro: macro "_If" requires 4 parameter(s), passed 2!
StrCmp ${INSTALLER_SERVICEPACK_STRING} "" 0 +2
!define /redef INSTALLER_SERVICEPACK_STRING "0"This doesn't return an error but the value is not changed (I still get the original error about the VIProductInfo).Any help is appreciated!
Mircea