Replies: 12 comments 10 replies
-
Running from system context, what will be the difference of installing the msixbundle using I'm looking into doing this from Intune with a Win32 package. Thought following would be sufficient. "%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy "Bypass" -NoLogo -NonInteractive -NoProfile -WindowStyle "Hidden" -Command "$null = Add-AppxPackage -Path ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"" Alternatively if needed, install command will be "%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy "Bypass" -NoLogo -NonInteractive -NoProfile -WindowStyle "Hidden" -Command "$null = Add-AppxProvisionedPackage -Online -PackagePath ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -LicensePath ".\9c0fe2ce7f8e410eb4a8f417de74517e_License1"" Edit: Seems first is for user context, while 2nd is system context. Edit2: Ended up downloading msixbundle and license xml from this GitHub repo release section. And dependencies as appx from https://store.rg-adguard.net/. With following install script wrapped in *.intunewin. Click to view#Requires -RunAsAdministrator
#Requires -Version 5.1
<#
.SYNOPSIS
Installs Microsoft App Installer if version included with this script is newer than the one installed.
.NOTES
Author: Olav Rønnestad Birkeland
Created: 211207
Modified: 211207
.EXAMPLE
& $psISE.CurrentFile.FullPath; $LASTEXITCODE
#>
# Input parameters
[OutputType($null)]
Param()
# PowerShell preferences
$ErrorActionPreference = 'Stop'
$InformationPreference = 'Continue'
$ProgressPreference = 'SilentlyContinue'
# Assets
$RequiredVersion = [System.Version] '1.16.12653.0'
$InstalledVersion = [System.Version](
Get-AppxPackage -Name 'Microsoft.DesktopAppInstaller' -AllUsers | Sort-Object -Property 'Version' -Descending | Select-Object -First 1 -ExpandProperty 'Version'
)
$MsixBundlePath = [string]((Get-ChildItem -Path $PSScriptRoot -Filter '*.msixbundle' -File).'FullName')
$LicensePath = [string]((Get-ChildItem -Path $PSScriptRoot -Filter '*.xml' -File).'FullName')
$DependenciesPaths = [string[]]((Get-ChildItem -Path $PSScriptRoot -Filter '*.appx' -File).'FullName')
# Write information
Write-Information -MessageData (
[PSCustomObject]@{
'RequiredVersion' = [string] $RequiredVersion
'InstalledVersion' = [string] $InstalledVersion
'MsixBundlePath' = [string] $MsixBundlePath
'LicensePath' = [string] $LicensePath
'DependeciesPaths' = [string] ($DependenciesPaths -join ';')
} | Format-List | Out-String
).Trim()
# Failproof
if ([string]::IsNullOrEmpty($MsixBundlePath)) {
Throw 'Did not find the *.msixbundle file.'
}
if (-not [System.IO.File]::Exists($MsixBundlePath)) {
Throw ('Path "{0}" does not exist.' -f $MsixBundlePath)
}
# Install
if ($InstalledVersion -lt $RequiredVersion) {
Write-Information -MessageData ('Installing v{0} from "{1}".' -f $RequiredVersion, $MsixBundlePath)
Add-AppxProvisionedPackage -Online -PackagePath $MsixBundlePath -LicensePath $LicensePath -DependencyPackagePath $DependenciesPaths
}
else {
Write-Information -MessageData ('Same or newer version is already installed.')
}
# Exit
Write-Output -InputObject 'Done.'
Exit 0 |
Beta Was this translation helpful? Give feedback.
-
Good question.
For now, I've added this information to the tutorial and assumed that the user wants to install both of them in a system context. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for taking the time to write such a detailed post on this! I've run into this issue in the past, and when I did, I opted to integrate winget directly into the Windows install image using DISM and the Windows 10 ADK to re-pack my changes into an updated ISO file. You can read the thread that explains how I did this here. To clarify a few things:
I hope that can help you out! Ultimately, I do think that the documentation could be improved, but I also think that the real issue here is that Windows 10 LTSC doesn't include the App Installer package by default. This would make it much easier to install winget. Just double-click on the msixbundle file, and you're done! This is unlikely, though, so I agree that more documentation on this would be welcome (or, potentially even packaging winget as an executable binary for systems where the Microsoft Store is disabled/uninstalled). |
Beta Was this translation helpful? Give feedback.
-
Thanks, that is good info.
I put this in the OP.
I did not consider integrating After thinking about this a little more, I feel like in the context of "automatically installing extra software on first Windows boot", integrating |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback! For my use case, my list of packages changes depending on which system I'm installing Windows on. For that reason, while I want winget preinstalled on all of my machines, I don't want the same set of packages shared between them, so I instead opt to use the |
Beta Was this translation helpful? Give feedback.
-
I rescind my previous statement. After another 24 hours of playing with Thus, I have opted to integrate |
Beta Was this translation helpful? Give feedback.
-
Awesome, I'm glad you found that helpful! |
Beta Was this translation helpful? Give feedback.
-
Similar to Windows Server 2022, the Windows Package Manager should be considered experimental only on Windows 10 LTSC 1809 and 21H2. These would still not be officially supported, but they may be possible with released versions of the Windows Package Manager. We're still working through the dependencies and other long term support implications. |
Beta Was this translation helpful? Give feedback.
-
This is unfortunate, albeit expected. UWP apps in general aren't very well supported in Windows 10 LTSC versions as-is, let alone updating them. Has your team considered an approach similar to the one that PowerShell 7 has taken where updates can be handled via Microsoft Update, which works on both LTSC 2019 and 2021? This way, you could distribute an installation package for those who wish to install winget on their Windows 10 Server/LTSC systems, and any updates could be handled either manually or via Microsoft Update. I know this is probably a pretty sizable undertaking, but if it means having official support for Server/LTSC, it might be something to consider. What are your thoughts? |
Beta Was this translation helpful? Give feedback.
-
@mariobrostech we're looking at all of our options here. Unfortunately, you are correct regarding UWP apps on Windows 10 LTSC versions. Anything we add to LTSC versions has a very long engineering support tail. We also need to ensure all other teams agree to take on the additional risk and expense of supporting any additions. Taking the Windows Package Manager down to Windows 10 (1809) was already a large undertaking. Supporting LTSC and Server OS SKUs was not approved based on our 1.0 release date. We have been looking at the next release cycles and working with other teams to understand the total impact and cost for becoming supported on those platforms. If this changes, we will certainly share the exciting news. |
Beta Was this translation helpful? Give feedback.
-
There may be another way for installing winget package on Windows LTSC. Finally you can use winget in command line. Or double clicking msix package to install them directly. This will work even after restarting the system. |
Beta Was this translation helpful? Give feedback.
-
LTSC 2021 method doesn't work. Installing package doesn't create winget.exe in AppData/Local/Microsoft/WindowsApps. You could do it by disabling and re-enabling it in Settings (search for "alias") but when you try to run winget again it will notify you that executable can't be run on this system. While I played with it one time I got it working but after wsreset -i which also should install MS Store but for some reason it didn't. Idk what's going on now, need some advice. I want to install winget with minimal dependencies (but I tried to install UI.Xaml before installation, still nothing). |
Beta Was this translation helpful? Give feedback.
-
Greetings,
As a brand new
winget
user, it was painful to get up and running with this software.This is an issue to request that:
winget
is actually in the path. This leads to broken scripts and hard-to-troubleshoot behavior.I'll do my part to help document what I know in this issue, and I leave it to others to do a pull request and/or integrate this information. In the meantime, this may be useful to other users searching through the GitHub issues.
How to Install
winget
on Windows 10 LTSC / Windows 10 IoT / Windows ServerSummary
winget
.msixbundle
file from the GitHub releases page.Compatibility
winget
will work on:It isn't compatible with earlier versions of LTSC.
I don't know the specific versions of Windows Server or Windows IoT that it will work on, if any.
Step 1
AppxProvisionedPackage
here, you could also useAppxPackage
. The difference is that:AppxProvisionedPackage
will install in a system context (e.g. each new user on a Windows image will get this installed)AppxPackage
installs only for a specific user.winget
installer will silently fail (without any error/warning messages). Specifically, the "winget.exe" file will not be added to "C:\Users[Username]\AppData\Local\Microsoft\WindowsApps".Step 2
Now, you should see the "winget.exe" file appear at "C:\Users[Username]\AppData\Local\Microsoft\WindowsApps". Furthermore, it should also be automatically added to your path.
Gotchas
The point at which winget is added to the path seems random. Sometimes, a sleep of 5 seconds works. Other times, I have to restart my whole computer to get it to show up. So your mileage may vary.
Using
winget
on First Bootwinget
as your primary package manager, you will want to either:winget
installer seems to be unreliable. I was not able to getwinget
to appear in the PATH in post-installation scripts in a consistent way; your mileage may vary.1) Integrating with DISM (recommended)
If you've used DISM before to e.g. integrate drivers into a Windows installation source, this process is almost exactly the same.
The following is a reference batch script to accomplish this:
2) Using autounattend.xml + PowerShell (not recommended)
winget
, you have two main options:curl
) and then execute that. (This is the simplest way, but you may not want your script to be public, or you may not have internet access on first boot, etc.)install-winget.ps1:
Beta Was this translation helpful? Give feedback.
All reactions