microsoft / winget-create

The Windows Package Manager Manifest Creator command-line tool (aka wingetcreate)
MIT License
477 stars 82 forks source link

Wrong architecture parsed from installer #467

Open Eddga opened 8 months ago

Eddga commented 8 months ago

Brief description of your issue

I just tried to update the ElectronicArts.EADesktop app via wingetcreate update interactive mode and the validation failed - see #123938 I then noticed that wingetcreate update recognized it as being x86 while EA Desktop is a x64 only app. Also when you do wingetcreate.exe update --urls https://origin-a.akamaihd.net/EA-Desktop-Client-Download/installer-releases/EAappInstaller.exe --version 13.52.0.5565 ElectronicArts.EADesktop it will throw an error:

Each new installer URL must have a single match to an existing installer based on architecture, installer type and scope. The following installers failed to match an existing installer: Multiple matches found for X86 Burn installer detected from the url: https://origin-a.akamaihd.net/EA-Desktop-Client-Download/installer-releases/EAappInstaller.exe Try using the architecture and/or scope overrides to uniquely match new URLs to existing installer nodes in the manifest.

It only works when you use architecture override.

Steps to reproduce

wingetcreate update ElectronicArts.EADesktop -i with version 13.52.0.5565 and URL https://origin-a.akamaihd.net/EA-Desktop-Client-Download/installer-releases/EAappInstaller.exe OR wingetcreate.exe update --urls https://origin-a.akamaihd.net/EA-Desktop-Client-Download/installer-releases/EAappInstaller.exe --version 13.52.0.5565 ElectronicArts.EADesktop

Expected behavior

Parse the architecture correctly as x64

Actual behavior

Parses architecture as x86

Environment

Windows Package Manager Manifest Creator v1.5.5.0

Windows: Windows.Desktop v10.0.22621.2506
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.2771.0
mdanish-kh commented 8 months ago

The happens when the installer's architecture differs from the installed application architecture. WinGet parses the installer binary for architecture if it can't detect it from the URL / user provides the override. This is related to https://github.com/microsoft/winget-create/issues/118#issuecomment-902193284

Work needs to be done to allow interactive mode to handle these scenarios:

Eddga commented 8 months ago

Thanks for your answer @mdanish-kh! 👌 I see. I already thought of this. Is there an easy way for me to check if the installer's architecture?

mdanish-kh commented 8 months ago

Is there an easy way for me to check if the installer's architecture?

I'm afraid I'm not aware of such. From discussions in https://github.com/microsoft/winget-create/issues/118, I learned that Inno Setup is a 32-bit application which means a number of installers created by that framework would be 32-bit. Other than that I'm not aware of an easy method to check that