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

Error when installing #20

Closed uffemcev closed 1 year ago

uffemcev commented 1 year ago

Hello. I have winget, but I decided to run this script to test it and I get this error. The error appears if the system language is Russian. If the system language is English, then there is no problem. Sorry for bad English.

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

Log Windows PowerShell (C) Корпорация Майкрософт (Microsoft Corporation). Все права защищены. Установите последнюю версию PowerShell для новых функций и улучшения! https://aka.ms/PSWindows PS C:\Users\uffemcev> &([ScriptBlock]::Create((irm https://raw.githubusercontent.com/asheroto/winget-install/master/winget-install.ps1))) -Force winget-install 3.0.0 \################################################### \# Downloading & installing 64-разрядная VCLibs... # \################################################### URL: Installing 64-разрядная VCLibs... ПРЕДУПРЕЖДЕНИЕ: Error when trying to download or install VCLibs. Trying alternate method... Installing 64-разрядная VCLibs... ПРЕДУПРЕЖДЕНИЕ: Same version already installed. ПРЕДУПРЕЖДЕНИЕ: That's okay, continuing... \#################################################### \# Downloading & installing 64-разрядная UI.Xaml... # \#################################################### URL: Installing 64-разрядная UI.Xaml... ПРЕДУПРЕЖДЕНИЕ: Error when trying to download or install UI.Xaml. Trying alternate method... Downloading UI.Xaml... Extracting... Installing 64-разрядная UI.Xaml... Get-ChildItem : Не удается найти путь "C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3\tools\AppX\64-разрядная\Release\Microsoft.UI.Xaml.2.7.appx", так как он не существует. строка:706 знак:17 \+ ... Get-ChildItem -Path $XamlAppxPath -Filter *.appx | ForEa ... \+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \+ CategoryInfo : ObjectNotFound: (C:\Users\uffemc...I.Xaml.2.7.appx:String) [Get-ChildItem], ItemNotFoundException \+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand UI.Xaml installed successfully. \###################################### \# Downloading & installing winget... # \###################################### Retrieving download URL for winget from GitHub... Downloading winget... Downloading license... Installing winget... winget installed successfully. \################################################################################################# \# Checking and adding WindowsApps directory to PATH variable for current user if not present... # \################################################################################################# PATH variable already present for Machine, skipping. PATH variable already present for User, skipping. \########################## \# Installation complete! # \########################## Checking if winget is installed and working... winget is installed and working now, you can go ahead and use it. PS C:\Users\uffemcev>
asheroto commented 1 year ago

Hello,

It says that it installed correctly, is it not working when you type winget?

Can you please try downloading this? https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3

Then extract the nupkg with WinRAR/7-Zip and you should get this file... image

Double-click that file and install it. Do you get any errors?

Also, please run this command and post the output:

winget-install -DebugMode
uffemcev commented 1 year ago

I'm testing the script on a system where winget is already installed. So winget works fine anyway. I haven’t tested the script on a freshly installed system yet. However, I am confused by this error during UI.Xaml installation. Should I be worried?

Log with -DebugMode Windows PowerShell (C) Корпорация Майкрософт (Microsoft Corporation). Все права защищены. Установите последнюю версию PowerShell для новых функций и улучшения! https://aka.ms/PSWindows PS C:\Users\uffemcev> &([ScriptBlock]::Create((irm https://raw.githubusercontent.com/asheroto/winget-install/master/winget-install.ps1))) -Force -DebugMode winget-install 3.0.0 \################################################### \# Downloading & installing 64-разрядная VCLibs... # \################################################### URL: Installing 64-разрядная VCLibs... ПРЕДУПРЕЖДЕНИЕ: Error when trying to download or install VCLibs. Trying alternate method... URL: https://aka.ms/Microsoft.VCLibs.64-разрядная.14.00.Desktop.appx Installing 64-разрядная VCLibs... ПРЕДУПРЕЖДЕНИЕ: Same version already installed. ПРЕДУПРЕЖДЕНИЕ: That's okay, continuing... \#################################################### \# Downloading & installing 64-разрядная UI.Xaml... # \#################################################### URL: Installing 64-разрядная UI.Xaml... ПРЕДУПРЕЖДЕНИЕ: Error when trying to download or install UI.Xaml. Trying alternate method... uiXaml: {"url":"https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3","nupkgFolder":"C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3","appxFolder":"tools/AppX/64-разрядная/Release/","nupkgFilename":"C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3.nupkg","appxFilename":"Microsoft.UI.Xaml.2.7.appx"} Downloading UI.Xaml... URL: https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 Deleted: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3 Extracting... Into folder: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3 Installing 64-разрядная UI.Xaml... Installing appx Packages in: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3\tools\AppX\64-разрядная\Release\ Get-ChildItem : Не удается найти путь "C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3\tools\AppX\64-разрядная\Release\Microsoft.UI.Xaml.2.7.appx", так как он не существует. строка:706 знак:17 \+ ... Get-ChildItem -Path $XamlAppxPath -Filter *.appx | ForEa ... \+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \+ CategoryInfo : ObjectNotFound: (C:\Users\uffemc...I.Xaml.2.7.appx:String) [Get-ChildItem], ItemNotFoundException \+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand UI.Xaml installed successfully. Deleted: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3.nupkg Deleted: C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3 \###################################### \# Downloading & installing winget... # \###################################### Retrieving download URL for winget from GitHub... Downloading winget... URL: https://github.com/microsoft/winget-cli/releases/download/v1.6.2561/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle Saving as: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle Downloading license... URL: https://github.com/microsoft/winget-cli/releases/download/v1.6.2561/48b9616cb7824d9e8c8b91fca01fd9db_License1.xml Saving as: C:\Users\uffemcev\AppData\Local\Temp\license1.xml Installing winget... wingetPath: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle wingetLicensePath: C:\Users\uffemcev\AppData\Local\Temp\license1.xml winget installed successfully. Deleted: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle Deleted: C:\Users\uffemcev\AppData\Local\Temp\license1.xml \################################################################################################# \# 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 Machine, skipping. C:\Users\uffemcev\AppData\Local\Microsoft\WindowsApps already present in PATH variable for User, skipping. \########################## \# Installation complete! # \########################## Checking if winget is installed and working... winget is installed and working now, you can go ahead and use it. PS C:\Users\uffemcev>
Error Get-ChildItem : Не удается найти путь "C:\Users\uffemcev\AppData\Local\Temp\Microsoft.UI.Xaml.2.7.3\tools\AppX\64-разрядная\Release\Microsoft.UI.Xaml.2.7.appx", так как он не существует. строка:706 знак:17 /+ Get-ChildItem -Path $XamlAppxPath -Filter *.appx | ForEa ... /+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /+ CategoryInfo : ObjectNotFound: (C:\Users\uffemc...I.Xaml.2.7.appx:String) [Get-ChildItem], ItemNotFoundException /+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
asheroto commented 1 year ago

Ah I see what you're saying.

Can you try downloading that file I mentioned before? Does it download the file in English, or Russian? Maybe the issue is that the filenames are in Russian and the script isn't prepared to work with those filenames. If so I can create a fix.

uffemcev commented 1 year ago

The file is downloaded in English. I checked that your Get-OSInfo function actually outputs Russian values.

asheroto commented 1 year ago

Ah ok. That must be why. Can you please show me the output?

uffemcev commented 1 year ago
Get-OSInfo ReleaseId : 2009 DisplayVersion : 22H2 Name : Майкрософт Windows 11 Домашняя Type : Workstation NumericVersion : 11 EditionId : Core Version : 10.0.22621.0 Architecture : 64-разрядная
asheroto commented 1 year ago

Ah it's because the architecture is getting it as 64-разрядная instead of x64 which corrupts the URL.

I will work on fixing this, thanks again for reporting it! I'll reply back here when ready to test.

asheroto commented 1 year ago

I have fixed this, I think. What I did is have Get-OSInfo get the architecture type and strip out everything except the numbers, then prepend an x to it like x64.

Try this file on the Testing branch.

https://github.com/asheroto/winget-install/blob/Testing/winget-install.ps1

You'll want the raw version of course.

uffemcev commented 1 year ago

Now it works great! Thank you very much for your work!

Log PS C:\Users\uffemcev> &([ScriptBlock]::Create((irm https://raw.githubusercontent.com/asheroto/winget-install/Testing/winget-install.ps1))) -force -DebugMode winget-install 3.0.0 To check for updates, run winget-install -CheckForUpdate /########################################## /# Downloading & installing x64 VCLibs... # /########################################## URL: http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/28edaebf-8019-4844-ba32-8ab019bc9391?P1=1695379484&P2=404&P3=2&P4=nYzJgzp9Ssn5D7hu5sQ%2fAMd8oh7QT6HR5phfl8Pk2FpMxlQzcF%2bpNmuzIr1d2MFs4h%2fOSOlgfrIEHVFs2o2OwA%3d%3d Installing x64 VCLibs... VCLibs installed successfully. /########################################### /# Downloading & installing x64 UI.Xaml... # /########################################### URL: http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/cadae296-3389-40c2-b927-605f7b399b78?P1=1695379567&P2=404&P3=2&P4=VDh%2bSJk0bnTXZ9zAF7PzIRXY%2f9qQIUmjsRVculLeXzvO45KBHlpZvQutKcwG%2bDBddcWbyummlNWHY0bGjkv5UQ%3d%3d Installing x64 UI.Xaml... UI.Xaml installed successfully. /###################################### /# Downloading & installing winget... # /###################################### Retrieving download URL for winget from GitHub... Downloading winget... URL: https://github.com/microsoft/winget-cli/releases/download/v1.6.2631/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle Saving as: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle Downloading license... URL: https://github.com/microsoft/winget-cli/releases/download/v1.6.2631/b416e6fbbafb4c4a8c2fa21b1082986a_License1.xml Saving as: C:\Users\uffemcev\AppData\Local\Temp\license1.xml Installing winget... wingetPath: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle wingetLicensePath: C:\Users\uffemcev\AppData\Local\Temp\license1.xml winget installed successfully. Deleted: C:\Users\uffemcev\AppData\Local\Temp\winget.msixbundle Deleted: C:\Users\uffemcev\AppData\Local\Temp\license1.xml /################################################################################################# /# 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 Machine, skipping. C:\Users\uffemcev\AppData\Local\Microsoft\WindowsApps already present in PATH variable for User, skipping. /########################## /# Installation complete! # /########################## Checking if winget is installed and working... winget is installed and working now, you can go ahead and use it. PS C:\Users\uffemcev>
asheroto commented 1 year ago

Excellent! I will merge this into the main branch and release an update shortly. Thanks!

asheroto commented 1 year ago

FYI ran into another minor glitch but will update the repo in the next few days

uffemcev commented 1 year ago

Thanks for notice

asheroto commented 1 year ago

Version 3.0.1 has been released. Appreciate your time on this!