microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.27k stars 1.14k forks source link

Bug with Winget on New Installation of Windows 11 Breaks RNW Dependency Script #13336

Closed chiaramooney closed 3 months ago

chiaramooney commented 4 months ago

There is a known issue on the winget repository that the version of winget installed with new installations of Windows 11 is a broken version. See https://github.com/microsoft/winget-cli/issues/3832#issuecomment-1872387214.

As a result, our RNW dependency script (which relies on winget for dependency installation) fails to correctly install dependencies.

We should update our dependency script to check if the version of winget installed on the computer is the broken version, and if so, we should run the following command to install a working version:

Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile winget.msixbundle
Add-AppPackage -ForceApplicationShutdown .\winget.msixbundle
del .\winget.msixbundle

Then the script can proceed as normal.

chrisglein commented 3 months ago

Script should have a version check for the broken version of winget, and if so, run the workaround.