Forum Discussion
MSIX package signing issue with certificate installed in a certificate store
I created MSIX file and later signing the package with this command
signtool sign /fd SHA256 /v /sm /s My /n "ABC Corporation" /t http://timestamp.digicert.com file.msix
But signing failed with this error:
Sign tool Error: This file format cannot be signed because it is not recognized.
- Host using to sign the package: Windows Server 2012
- Our AD team installed the certificate in certificate store of the host I am using to sign.
- I installed Windows 10 SDK and added signtool 'x86' location "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86" to path variable
- For Code signing we are using DigiCert
Appreciate any suggestions to resolve this issue
- James PikeMicrosoft
Hi Sri-Boddupalli ,
Try setting this registry key:
Under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppxSIP; set LogLevel as DWORD to 3
Rerun the Signtool Command and you should see additional logging that may be insightful to your problem.
If that does not help, please share the additional logging with us to review. As with any logs or data you share, please review it before hand for any personal or sensitive information that you would not want to share in a public forum.
Thanks!
James - ToastgunCopper Contributor
Sri-Boddupalli This usually indicates an issue with the package (corrupted file etc.). You should get back to packaging and make the package "simpler" and see if signing works.
- SigmarssonBrass Contributor
Sri-Boddupalli you can try it with the pfx file, maybe it helps;
SignTool.exe sign /fd SHA256 /a /f devcert.pfx /p <pwd> ./abc.msix
- Sri-BoddupalliCopper Contributor
Thank you guys for your valuable suggestions, appreciate your time on this. This is a repeated post
- So I ended up calling the DigiCert support and asked the first question whether they support signing MSIX packages and do they have any document which confirms that. Unfortunately they don't have any document which states all the file formats they support code signing
- Then I ran the Signtool in debug mode as @TIMOTHY MANGAN suggested in here https://techcommunity.microsoft.com/t5/msix-packaging-and-tools/msix-packageing-tool-signtool-certif... and ended up finding another article related to error I was getting.
- As per this thread https://www.advancedinstaller.com/forums/viewtopic.php?t=36104 I uninstalled the Windows 10 SDK i had in the machine and re-installed the latest version of Windows 10 SDK, version 2004 (10.0.19041.0) from here https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
- Then as @TIMOTHY MANGAN suggested above started signing a simple MSI file just to verify nothing wrong with the Certificate and it worked good. Later I signed a custom .EXE we developed and signing went good. So I confirmed nothing wrong with the certificate I am using.
- Finally I signed the MSIX pacakge I created using this command and it worked without any issues.
1) Change the Path to Signtool Location below
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x642) Sign the Package using this command
.\signtool.exe sign /v /sm /s My /n "ABC Corporation" /fd SHA256 /t http://timestamp.digicert.com "<FileLocation>\File.msix"
It was so frustrating to fight with AD team on getting the .PFX file with Password. I understand their security concerns but without that we are pretty much helpless. @John Vintzel @Sharla Akers Any better explanation I can come up with, if our AD team ask why exactly we need .PFX file instead of installing the certificate in cert store and using that? OR if you could develop a Signtool GUI utility that would be wonderful
- amittanwar878Copper Contributor
Error:-
Done Adding Additional Store
Sign Tool Error: This file format cannot be signed because it is not recognized.
Sign Tool Error: An error occurred while attempting to sign: C:\Users\abc878-a\Desktop\SalesforceCLI.msix
Tried to uninstall the windows SDK but no luck.
Via Sign in tool able to sign the .exe and MSI package but when trying to sign the MSIX package getting above error.
Also, when i tried to sign the package via MSIX Hero it works fine.
Could you please guide me how to fix the issue?