If we can use the Store as we do in Windows 10, one option is to send a request to The insider program for windows package manager. A better way in this case is to download the package directly from Github.
For the "Package Manager" Insider Program we can sign up and here. >>LINK<<
The AppInstaller can be found here in the Microsoft Store >>LINK<<
After installing the app installer from the Insider program, new Commands available in the command line.
A Winget installation with "Install":
A version with the Winget tool winds up as a release and MSIX package in Github. (since recently as version 1.x). There exists the download :
Windows Package Manager v1.0.11692
With which under Windows 10 easily a version with Winget can be post-installed without having to use the store (a double click is enough).
Now. we want to install the whole thing as automated as possible and with all dependencies. this time on server 2022.
After downloading the "msixbuldle" from the release page, we see in the package. AppInstaller_X64.msix a dependency on a VCLib. These are more or less the MSIX equivalent to the Visual C++ runtime environments. In this case this is a prerequisite that must be installed on a 2022 server for the app installer to work works with Winget.
Extract from the AppxManifest:
<Dependencies> <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18362.0"/> <PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.29231.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"/> </Dependencies>
We first need to get this package from the store in the appropriate architecture extract. Using the URL https://store.rg-adguard.net/, we can get the download URL for our component pretty easily to the download URL for our component. By the way, you can also find always a version in the current Windows Kit. First we download VC140.00 as Appx package with the following script and install the package with Add-AppPackage. User rights are enough.
# Install-VCLibs.140.00 Version 14.0.30035 # Andreas Nick 2021 $StoreLink = 'https://www.microsoft.com/de-de/p/app-installer/9nblggh4nns1' $StorePackageName = 'Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx' $RepoName = 'AppPAckages' $RepoLokation = $env:Temp $Packagename = 'Microsoft.VCLibs.140.00' $RepoPath = Join-Path $RepoLokation -ChildPath $RepoName $RepoPath = Join-Path $RepoPath -ChildPath $Packagename # # Function Source # Idea from: https://serverfault.com/questions/1018220/how-do-i-install-an-app-from-windows-store-using-powershell # modificated version. Now able to filte and return msix url's # function Download-AppPackage { [CmdletBinding()] param ( [string]$Uri, [string]$Filter = '.*' #Regex ) process { #$Uri=$StoreLink $WebResponse = Invoke-WebRequest -UseBasicParsing -Method 'POST' -Uri 'https://store.rg-adguard.net/api/GetFiles' -Body "type=url&url=$Uri&ring=Retail" -ContentType 'application/x-www-form-urlencoded' $result =$WebResponse.Links.outerHtml | Where-Object {($_ -like '*.appx*') -or ($_ -like '*.msix*')} | Where-Object {$_ -like '*_neutral_*' -or $_ -like "*_"+$env:PROCESSOR_ARCHITECTURE.Replace("AMD","X").Replace("IA","X")+"_*"} | ForEach-Object { $result = "" | Select-Object -Property filename, downloadurl if( $_ -match '(?<=rel="noreferrer">).+(?=</a>)' ) { $result.filename = $matches.Values[0] } if( $_ -match '(?<=a href=").+(?=" r)' ) { $result.downloadurl = $matches.Values[0] } $result } $result | Where-Object -Property filename -Match $filter } } $package = Download-AppPackage -Uri $StoreLink -Filter $StorePackageName if(-not (Test-Path $RepoPath )) { New-Item $RepoPath -ItemType Directory -Force } if(-not (Test-Path (Join-Path $RepoPath -ChildPath $package.filename ))) { Invoke-WebRequest -Uri $($package.downloadurl) -OutFile (Join-Path $RepoPath -ChildPath $package.filename ) } else { Write-Information "The file $($package.filename) already exist in the repo. Skip download" } #Install the Runtime add-AppPackage (Join-Path $RepoPath -ChildPath $package.filename )
Then we download the Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle package from the GitHub repository and install the package using AppAppPackage.
# Install-Winget Version v1.0.11692 # Andreas Nick 2021 # From github $WinGet_Link = 'https://github.com/microsoft/winget-cli/releases/download/v1.0.11692/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle' $WinGet_Name = 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle' $RepoName = 'AppPAckages' $RepoLokation = $env:Temp $Packagename = 'Winget' $RepoPath = Join-Path $RepoLokation -ChildPath $RepoName $RepoPath = Join-Path $RepoPath -ChildPath $Packagename if(-not (Test-Path $RepoPath )) { New-Item $RepoPath -ItemType Directory -Force } if(-not (Test-Path (Join-Path $RepoPath -ChildPath $WinGet_Name ))) { Invoke-WebRequest -Uri $WinGet_Link -OutFile (Join-Path $RepoPath -ChildPath $WinGet_Name ) } else { Write-Information "The file $WinGet_Name already exist in the repo. Skip download" } #Install the Package Add-AppPackage (Join-Path $RepoPath -ChildPath $WinGet_Name)
Once that happens, Winget on Server 2022 can be used from the command line. Of course, this is how it will work on Windows 10.
On top of that, AppInstaller is now available. With an AppInstaller configuration file you can automatically update applications like Winget. You can find more information about this in the Microsoft documentation or from me in our MSIX course:
https://docs.microsoft.com/en-us/windows/msix/app-installer/app-installer-file-overview
With the AppInstaller a double click on a MSIX, AppX or a msixbundle is integrated in the system. A dialog for installation appears when the double click is done.
Finally, a picture of a new Server 2022 showing Winget integration.
Comments 9
Thanks! helped with this script to install Dev Tools on Windows Server 2022 -
Add-DevToMyWinServer.ps1
https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3
Download, rename too .zip, unzip to folder
Add-AppxPackage -Path "C:\INSTALL\WINGET\microsoft.ui.xaml.2.7.3\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx"
Add-AppxPackage ".\Microsoft.VCLibs.x64.14.00.Desktop.appx"
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
VCLIB installer script is not working on Datacenter 2022. Pops open the PS shell then closes quickly. Second script seems to work but winget is still an unrecognized command. Thoughts?
Sorry for the late reply but notifications have stopped working! Maybe the execution policy for the PowerShell is missing? I would run this in the ISE.
fresh install of server 2022
fails with
add-AppPackage : Deployment failed with HRESULT: 0x80073CF0, Package could not be opened.
error 0x80070003: Opening the package from location failed.
NOTE: For additional information, look for [ActivityId] e85da987-bcb8-0000-f6c3-5de8b8bcd801 in the Event Log or use the command line Get-AppPackageLog -ActivityID
e85da987-bcb8-0000-f6c3-5de8b8bcd801
At line:72 char:1
+ add-AppPackage (Join-Path $RepoPath -ChildPath $package.filename )
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (C:\Users\ADMINI....VCLibs.140.00\:String) [Add-AppxPackage], FileNotFoundException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
I am getting
Sorry for the late reply but notifications have stopped working! No module is imported. The error must have another cause. Which PowerShell version are you using?
This is just want I need
Thank you , I just get the server 2022 on ... , and want to install the WinGet and AppInstaller, and per your instruction , everything is running now