JohnCoffin
Posts: 6
Joined: Wed Apr 21, 2021 11:55 pm

SignTool Error: This file format cannot be signed because it is not recognized

Thu Apr 22, 2021 12:22 am

We're currently working on an MSIX installer for our Windows 10 UWP application. We’ve been using Advanced Installer 15.8 to build our MSI and MSIX installers. During the creation of the MSIX package, SignTool.exe is reporting an error: “SignTool Error: This file format cannot be signed because it is not recognized.”

We’ve tried the following:
- Verifying that the MSI is not signed before by another signer (it isn’t)
- Checking all the parameters in the self-signed digital signature certificate, the application project, and the Advanced Installer project, AppXManifest.xml, etc. (as far as we can see, all match)
- Installing Windows SDK 10 (10.0.19041.0) and the SignTool.exe binary from this package (no change)
- Checking the event logs (there are no errors specific to this problem)
- Running SignTool.exe at a command line to sign the MSIX file (same error)
- Running SingTool.exe at a command line to sign the MSI file (signs without error)
- Creating an Advanced Installer installation that doesn’t have any files (creates and signs the MSIX without issue)
- Using a publishing project in Visual Studio to create an MSIX using the same certificates

We've had a look at the Advanced Installer Community postings (where we got many of the ideas above) and have been unable to resolve this issue. This Community postings best exemplifies our situation (including the version of Advanced Installer). In that posting, it was mentioned that this issue had been addressed in 15.5.1.

We're hoping for information, ideas, and guidance.

Kind regards,

John

JohnCoffin
Posts: 6
Joined: Wed Apr 21, 2021 11:55 pm

Re: SignTool Error: This file format cannot be signed because it is not recognized

Fri Apr 23, 2021 7:52 pm

Microsoft support determined that the problem is not with SignTool itself but that the MSIX file is corrupt. For those that find this interesting and who, like me, are more or less new to this, "each file type has a Subject Interface Package (SIP) provider that handles the hashing, signature creation, and signature embedding. The AppX SIP is responsible for handling MSIX files. While debugging, I can see that the AppX SIP fails to parse the MSIX."

I'm going to take a step back and focus on the creation of the MSIX. I will start with a simpler project. Other people have reported the same error caused by missing NuGet dependencies. It could be as simple as this.

JohnCoffin
Posts: 6
Joined: Wed Apr 21, 2021 11:55 pm

Re: SignTool Error: This file format cannot be signed because it is not recognized

Fri Apr 23, 2021 10:04 pm

Problem found: It appears that the MSIX file has two AppXManifest.xml files (i.e. one from Visual Studio and one from Advanced Installer). Once the VS one is removed, the signing passes.

FYI I got the idea of opening the MSIX with 7zip from this Community post (i.e. "Error parsing the app package" et al).

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: SignTool Error: This file format cannot be signed because it is not recognized

Mon Apr 26, 2021 3:03 pm

Hello John and welcome to our forums,

Thank you for your followup on this and for sharing your solution with us!

I am really glad you were able to find the culprit and I'm sure other users facing a similar scenario will find this useful.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”