asheroto / winget-install

Install winget tool using PowerShell! Prerequisites automatically installed. Works on Windows 10/11 and Server 2019/2022.
https://bit.ly/winget-install
GNU General Public License v3.0
272 stars 33 forks source link

Errors when installing #8

Closed uffemcev closed 1 year ago

uffemcev commented 1 year ago

Script verson 1.0.1 Windows 22H2 UAC disable Powershell 5.1 Run as admin

Log PS C:\Users\uffemcev> iwr raw.githubusercontent.com/asheroto/winget-installer/master/winget-install.ps1 | iex Invoke-RestMethod : BlobNotFoundThe specified blob does not exist. RequestId:68001a83-a01e-0069-2c38-a384bb000000 Time:2023-06-20T05:31:37.0098866Z At line:47 char:10 \+ $json = Invoke-RestMethod -Method Get -Uri $url \+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand Cannot index into a null array. At line:49 char:2 \+ $latestVersion = $json.versions[-1] \+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray ################################################## \# Downloading Xaml nupkg file... ################################################## ################################################## \# Downloading & installing x64 VCLibs... ################################################## ################################################## \# Installing x64 XAML... ################################################## Add-AppxPackage : Cannot find path 'C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.\tools\AppX\x64\Release\Microsoft.UI.Xaml..appx' because it does not exist. At line:69 char:2 \+ Add-AppxPackage $pkg -ErrorAction SilentlyContinue \+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\uffemc...t.UI.Xaml..appx:String) [Add-AppxPackage], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand ################################################## \# Downloading winget... ################################################## ################################################## \# Installing winget... ################################################## ################################################## \# Checking and adding WindowsApps directory to PATH variable for current user if not present... ################################################## ################################################## \# Cleaning up... ################################################## Remove-Item : An object at the specified path C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml. does not exist. At line:148 char:1 \+ Remove-Item -Path $nupkgFolder -Recurse \+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Remove-Item], PSArgumentException + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.RemoveItemCommand ################################################## \# Installation complete! ################################################## ################################################## \# Please restart your computer to complete the installation. ################################################## PS C:\Users\uffemcev>
asheroto commented 1 year ago

Hm that's weird...

image

Maybe it was a glitch? Can you get to this page? https://api.nuget.org/v3-flatcontainer/Microsoft.UI.Xaml/index.json

To prevent against that, I will hard code version 2.8.4 as a failsafe in case the server is unavailable.

asheroto commented 1 year ago

I released version 1.0.2. Let me know if that fixes it for you. 😊

uffemcev commented 1 year ago

I released version 1.0.2. Let me know if that fixes it for you. 😊

Thanks for that, but now i get a new error.

Log PS C:\Users\uffemcev> iwr raw.githubusercontent.com/asheroto/winget-installer/master/winget-install.ps1 | iex ################################################## \# Downloading Xaml nupkg file... ################################################## Downloading https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.8.4 Saving as: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4.nupkg.zip Expanding: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4.nupkg.zip Into: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4 ################################################## \# Downloading & installing x64 VCLibs... ################################################## ################################################## \# Installing x64 XAML... ################################################## Something went wrong. Please try again or open an issue at https://github.com/asheroto/winget-install/issues PS C:\Users\uffemcev>
uffemcev commented 1 year ago

1.0.3 version

Log PS C:\Users\uffemcev> iwr raw.githubusercontent.com/asheroto/winget-installer/master/winget-install.ps1 | iex ################################################## \# Downloading Xaml nupkg file... ################################################## Downloading https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.8.4 Saving as: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4.nupkg.zip Expanding: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4.nupkg.zip Into: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4 ################################################## \# Downloading & installing x64 VCLibs... ################################################## ################################################## \# Installing x64 XAML... ################################################## Something went wrong. Please try again or open an issue at https://github.com/asheroto/winget-install/issues Line number: 161 Error: Cannot find path 'C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.8.4.appx' because it does not exist. PS C:\Users\uffemcev>
asheroto commented 1 year ago

Try it again now. For some reason the appx filename is not the same as it should be each time. On my Windows 11 machine it fine but my Windows 10 machine it doesn't. So I just had the script install whatever appx files were in that folder.

uffemcev commented 1 year ago

It seems all is fine, isn't?

Log PS C:\Users\uffemcev> iwr raw.githubusercontent.com/asheroto/winget-installer/master/winget-install.ps1 | iex ################################################## \# Downloading Xaml nupkg file... ################################################## Downloading https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.8.4 Saving as: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4.nupkg.zip Expanding: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4.nupkg.zip Into: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4 ################################################## \# Downloading & installing x64 VCLibs... ################################################## ################################################## \# Installing x64 XAML... ################################################## Installing Appx Packages In: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.8.4\tools\AppX\x64\Release Installing Appx Package: Microsoft.UI.Xaml.2.8.appx Retrieving download URL for winget from GitHub... ################################################## \# Downloading winget... ################################################## Downloading: https://github.com/microsoft/winget-cli/releases/download/v1.4.11071/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle Saving as: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle Downloading: https://github.com/microsoft/winget-cli/releases/download/v1.4.11071/5d9d44b170c146e1a3085c2c75fcc2c1_License1.xml Saving as: C:\Users\uffemcev\AppData\Local\Temp\license1.xml ################################################## \# Installing winget... ################################################## Installing package: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle ################################################## \# Checking and adding WindowsApps directory to PATH variable for current user if not present... ################################################## C:\Users\uffemcev\AppData\Local\Microsoft\WindowsApps already present in PATH variable for current user, skipping. ################################################## \# Cleaning up... ################################################## ################################################## \# Installation complete! ################################################## ################################################## \# Please restart your computer to complete the installation. ################################################## PS C:\Users\uffemcev>
uffemcev commented 1 year ago

Thanks for your help!

asheroto commented 1 year ago

No problem thanks for reporting the bug.

asheroto commented 1 year ago

Yes, all looks good.