r/devops • u/konkon_322 • Jul 17 '26
Discussion How to combine MD5 hash + code sign
We build and package our installer files using Advanced Installer. Up until last years version, we code signed using a .pfx and had the AI(Adv. Installer) also embed MD5 into the files. So both hashing and code signing is handled by the same tool, bing bong works fine.
But now, our team wants to move away from using a dedicated .pfx file, and instead wants to code sign it using a signtool.exe on the buildmachine, with the private key stored on a remote KMS. Thus, i integrated our pipeline to also have a task that code signs the installer. Now, when i tested installing with the installer,it is corrupted. Looked up on release notes, the custom signing via 3rd party does exist,but its on v17, my company is on v16 ๐.
I tried disabling hashing via the AI, and let the build machine handle it (ofc via the preset task in pipeline), but just found out im only calculating MD5 hash value for the files, not embed the values IN the actual files
I really need some ideas, i feel like im trying to do the impossible here.
3
u/nevotheless Jul 17 '26
what does that even mean and what does creating hashes has to do with signing your app and installer?
2
u/catalin-advinst Jul 29 '26
a bit late to the party, but decided to tune in to try and help anyway since I work for Advanced Installer.
first of all, v16 is really old (like 7 years old), so I would advise upgrading to a newer version if possible.
"and instead wants to code sign it using a signtool.exe"
Advanced Installer uses signtool.exe for signing anyway.
However, signing only the resulted package will result in an error, just like you've seen.
If you build an EXE file, only that will end up being signed, while the embedded MSI and CAB files inside will not be signed.
Now, a possible fix to make sure everything is signed correctly in your case (if you really cannot upgrade to the newer version that contains the "Custom" option for signing) would be:
Step 1 and 2 should be done in "Builds" page, under "Build Events" tab. Now, the build event itself can be a PowerShell script to automate the signing of the files.
This is a bit of a hassle, not gonna lie, but if you can not upgrade to a newer version, this might be the only solution for your scenario.
3
u/Normal_Red_Sky Jul 17 '26
Got to ask why you're using md5, have you looked at SHA?