Search code examples
windowscontinuous-integrationinno-setupgithub-actionscode-signing

Importing code signing certificate on Windows Server 2019 fails in GitHub Action workflow with `Error: Store::ImportCertObject() failed.`


I'm trying to sign a Unity3D application packaged with Inno Setup v6 on GitHub Actions (Windows Server 2019 runner). I'm currently using a self-signed certificate because I want to get the entire workflow in place first before buying one from a trusted authority.

The entire build and sign process works perfectly with the same certificate on my local development machine, but the signing process fails on GitHub actions with an unhelpful error message:

c:\program files (x86)\inno setup 6>"D:\a\qweebi-unity\qweebi-unity\dist\signing\signtool.exe" sign /v /debug /td sha256 /fd sha256 /tr http://timestamp.digicert.com /f "D:\a\qweebi-unity\qweebi-unity\dist\signing\Cert.pfx" /p *** "D:\a\qweebi-unity\qweebi-unity\dist\uninst.e32.tmp" 
SignTool Error: An unexpected internal error has occurred.
Error information: "Error: Store::ImportCertObject() failed." (-2147467259/0x80004005)
SignTool Error: An unexpected internal error has occurred.
   Sign Tool command failed (Sign Tool command failed with exit code 0x1). Will retry (2 tries left).
SignTool Error: An unexpected internal error has occurred.

I've tried using the /v and /debug flags to print more information as to what might be going wrong, but none of this seems to change the error message that is being printed.

What can I do to figure out what is going wrong here?


Solution

  • This looks like an issue with the certificate itself, not the signing process.

    Double check whether you generated the certificate correctly and the same way in both machines.