Open marticliment opened 1 year ago
Can you share the output of winget --info
when emulated to see if the architecture is correctly detected?
Hi - the output of the bundled version is:
winget.exe --info
Windows Package Manager v1.3.0
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.900
System Architecture: X64
Logs: %TEMP%\WinGet\defaultState
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
The output from my local installed version is
winget --info
Windows-Paket-Manager v1.3.2691
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
Windows: Windows.Desktop v10.0.22621.900
Systemarchitektur: Arm64
Paket: Microsoft.DesktopAppInstaller v1.18.2691.0
Protokolle: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Links
-----------------------------------------------------------------------------------------
Datenschutzerklärung https://aka.ms/winget-privacy
Lizenzvereinbarung https://aka.ms/winget-license
Hinweise von Drittanbietern https://aka.ms/winget-3rdPartyNotice
Startseite https://aka.ms/winget
Windows Store Nutzungsbedingungen https://www.microsoft.com/en-us/storedocs/terms-of-sale
Thanks Miro
I see. The "System Architecture" from the bundled version isn't one of our "official releases". Hopefully there is something we can do to detect the architecture differently, but I'm not sure if that's possible.
maybe GetNativeSystemInfo?
https://devblogs.microsoft.com/oldnewthing/20220209-00/?p=106239
As a workaround, you can specify architecture via command line, or you can modify your settings to "prefer" the ARM version of packages.
@marticliment just an FYI.
Here is another Issue related to https://github.com/marticliment/WingetUI.
Hello,
I have found a possible workaround for this issue. It consists on reading the vaule for the environment variable %PROCESSOR_ARCHITECTURE%
. This is the workaround I used on WingetUI to detect arm64 machines from an executable compiled for x86_64 systems, and it appears to work correctly.
Brief description of your issue
If a x64 version is ran on a arm64 machine through emulation, winget will install the x64 version of a package instead of the arm64.
While the user usually has the proper version installed, sometimes, especially with bundled winget executables (such as the one on WingetUI) often cause issues.
This issue applies to updates as well, where Winget will install the x64 update over the previous arm package
Steps to reproduce
Run a x64 version of Winget on an arm system through emulation.
Anothger way is to use the bundled winget executable in WingetUI)
Expected behavior
Winget detected the proper system architecture and installed the corresponding packages, regardless of the architecture of the process itself.
Actual behavior
Winget x64 emulated on arm installs x64 packages on arm machines
Environment