timmangan
Posts: 47
Joined: Fri Mar 30, 2018 1:17 pm

MSIX Build failure

Wed Aug 28, 2019 10:08 pm

Have app that builds to MSIX. Upgraded Visual Studio to 2019, Advanced Installer to 16.2, VS Extension Advanced Installer for VS 2019 added.

Perform clean and rebuild on project and the setupproject fails to build. For every file reference (including dependencies not touched during rebuild) the Advanced Installer build gives an error. Sample error here:

ERROR: Invalid Portable Executable (PE) file. 'C:\Users\admin\Documents\Visual Studio 2017\Projects\PsfTooling\pfsd\System.Runtime.InteropServices.RuntimeInformation.dll' is not a valid Portable Executable for 'BuildUwpAppX->x64' build

I will note that the project is an AnyCPU executable that has both native 32 and 64 bit dependencies and referenced components in case that is important.

If you provide details on how you are performing the PE check I can investigate further.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: MSIX Build failure

Thu Aug 29, 2019 11:06 am

Hello Tim,

A binary (e.g. System.Runtime.InteropServices.RuntimeInformation.dll) selected to be signed and included into your UWP build, we consider it UWP compatible if is a valid PE, more exactly if it can be successfully signed with SignTool.exe.

Thus if the related file cannot be signed using SignTool.exe we consider it is not a valid PE. So, a quick check for you will be to try to manually sign with SignTool the related DLL and see if the signing operation succeeds.

If the manual signing operation succeeds, then to investigate this further could you please share with us by email at support at advancedinstaller dot com a download link for your VS solution and its projects (only the project files without the source code) so we can investigate this on our side too?

Also, if you could send a download link for the related DLLs (e.g. System.Runtime.InteropServices.RuntimeInformation.dll) this will be great. I run some tests on our side and the version of System.Runtime.InteropServices.RuntimeInformation.dll I used never generated such issues.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

timmangan
Posts: 47
Joined: Fri Mar 30, 2018 1:17 pm

Re: MSIX Build failure

Thu Aug 29, 2019 3:35 pm

I'll first try to troubleshoot, now that I know how you are checking. It sounds like an issue in finding signtool. I'll recheck configurations.

I do notice that some of the files it complains about are part of the package but are not in the list of files to be signed in the aip configuration, so perhaps that list is being ignore anyway.

timmangan
Posts: 47
Joined: Fri Mar 30, 2018 1:17 pm

Re: MSIX Build failure

Thu Aug 29, 2019 4:19 pm

Daniel,

I located the problem. My code signing certificate for the Microsoft store has expired. Perhaps the error message might be improved.

How I troubleshoot this:
1) Ran Procmon with a filter for field OPERATION starting with "Process".
2) The trace shows command lines used for signtool as well as the process exit code (which was 1 and treated as an error).
NOTE: The build process seems to make a copy of exe/dll files into the %temp% folder using random names with a dll extension and runs signtool on that.
3) Opened an elevated command prompt and performed the same command by hand, substituting in one of the real PE files to be signed.
NOTE: Output shown here:
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\signtool.exe" sign /f "C:\Users\admin\Documents\Visual Studio 2017\Projects\SolMan_StoreKey.pfx" /d "23572TimMangan.TMurgent-PsfTooling" /fd SHA256 /td sha256 "C:\Users\admin\AppData\Local\Temp\AAA\PsfTooling.exe"
SignTool Error: No certificates were found that met all the given criteria.
4) Looked at the certificate and found it expired a week ago.

Oddly, Visual Studio is using the same cert to sign some of the components I build and doesn't complain when signtool fails. I'm not happy about that either!

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: MSIX Build failure

Fri Aug 30, 2019 8:32 am

Hello Tim,

Thank you for sharing with us your findings on this. I have forwarded your request to our development team and we will try to explicitly address this error cause in the future with a eloquent error message.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: MSIX Build failure

Tue Jun 09, 2020 10:43 am

Hello Tim,

This improvement has been implemented in Advanced Installer 17.1, released on May 27th, 2020.

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

Return to “Common Problems”