miabuild double quotes in compiler variable
Posted: Mon Oct 13, 2025 12:27 am
Hi,
We currently run IA X16 and have had to renew our code signing certificate and have subsequently run in to issues with how InstallAware handles the EV certificate.
After some investigation, I saw that the script itself is just the compiler variable "POST-BUILD-EVENT-COMMANDS" and quickly worked out I can pass this on the "miabuild.exe" command line. Perfect as I can build the commands in one place away from the the IA Project and call "miabuild.exe" with the signing script without have to modify any project files.
However, this does not work! Not because there is an issue with the commands, but because there appears to be no way of passing double quote characters in to a compiler variable. I have tried:
The best solution I have at the moment is to define a quote in the project file, then use:
Am I missing something, is there really no way to pass in a double quote to a compiler variable?
We currently run IA X16 and have had to renew our code signing certificate and have subsequently run in to issues with how InstallAware handles the EV certificate.
Code: Select all
"C:\Program Files (x86)\InstallAware X16\authenticode\signtoolex\signtool.exe" sign /fd SHA256 /as /f "cert.p7b" /csp "eToken Base Cryptographic Provider" /tr "http://timestamp.digicert.com" /td sha256 /du "https://example.com" /d "My Product" /k "[{{}}]=key_1234567890" "Temp\{E8513BFA-661C-4B86-8F90-9F993A40B713}"
- The CSP here is incorrect, and there appears no way to change it.
- There also appears to be no way to provide the /sha1 argument to determine the specific certificate to use
- There is no documentation I can find on the content used in the /k argument for "[{{}}]"
After some investigation, I saw that the script itself is just the compiler variable "POST-BUILD-EVENT-COMMANDS" and quickly worked out I can pass this on the "miabuild.exe" command line. Perfect as I can build the commands in one place away from the the IA Project and call "miabuild.exe" with the signing script without have to modify any project files.
However, this does not work! Not because there is an issue with the commands, but because there appears to be no way of passing double quote characters in to a compiler variable. I have tried:
- "" (2x double quote)
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="""#IADIR#\authenticode\signtool.exe"" sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d ""My Product"" /du https://example.com /csp ""DigiCert Signing Manager KSP"" /kc key_1234567890 ""#PROJDIR#\Release\Single\my project.msi""" - """" (4x double quote)
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="""""#IADIR#\authenticode\signtool.exe"""" sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d """"My Product"""" /du https://example.com /csp """"DigiCert Signing Manager KSP"""" /kc key_1234567890 """"#PROJDIR#\Release\Single\my project.msi""""" - `"`" (2x powershell escaped double quote)
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="`"`"#IADIR#\authenticode\signtool.exe`"`" sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d `"`"My Product`"`" /du https://example.com /csp `"`"DigiCert Signing Manager KSP`"`" /kc key_1234567890 ""#PROJDIR#\Release\Single\my project.msi""" - `"`"`"`" (4x powershell escaped double quote)
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="`"`"`"`"#IADIR#\authenticode\signtool.exe`"`" sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d `"`"`"`"My Product`"`"`"`" /du https://example.com /csp `"`"`"`"DigiCert Signing Manager KSP`"`"`"`" /kc key_1234567890 `"`"`"`"#PROJDIR#\Release\Single\my project.msi`"`"`"`"" - ' (singe quote)
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="'#IADIR#\authenticode\signtool.exe' sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d 'My Product' /du https://example.com /csp 'DigiCert Signing Manager KSP' /kc key_1234567890 '#PROJDIR#\Release\Single\my project.msi' - '' (2x singe quote)
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="''#IADIR#\authenticode\signtool.exe'' sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d ''My Product'' /du https://example.com /csp ''DigiCert Signing Manager KSP'' /kc key_1234567890 ''#PROJDIR#\Release\Single\my project.msi''
The best solution I have at the moment is to define a quote in the project file, then use:
Code: Select all
miabuild.exe "my project.mpr" POST-BUILD-EVENT-COMMANDS="#Q##IADIR#\authenticode\signtool.exe#Q# sign /f cert.p7b /fd sha256 /tr http://timestamp.digicert.com /td sha256 /d #Q#My Product#Q# /du https://example.com /csp #Q#DigiCert Signing Manager KSP#Q# /kc key_1234567890 #Q##PROJDIR#\Release\Single\my project.msi#Q#Am I missing something, is there really no way to pass in a double quote to a compiler variable?