Seite 1 von 2

Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 03.10.2021, 14:39
von Holgi
ich nutze ja gerne die Windows LTSC Versionen, also die ohne "Bloatware", wie Spiele, Store etc.
Dennoch wollte ich gerne Winget installieren.
Überall sieht man Installationshinweise, die über den MS Store funktionieren.
Den hatte ich ja nunmal nicht.
Deshalb habe ich hier mal einen Lösungsvorschlag.
zunächst besorgt man sich die benötigten Dateien bei https://store.rg-adguard.net/
von links nach rechts eingeben:
PackageFamilyName Microsoft.DesktopAppInstaller_8wekyb3d8bbwe RP
herunterladen und ggf. umbenennen:
Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx
Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx
Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx
Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx
Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

Die Dateien an einem Ort abspeichern (im Beispiel hier C:\PS)

In einer Powershell Konsole (Admin) folgende Zeilen nacheinander eingeben und enter:

Add-AppxPackage "C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx"
Add-AppxPackage "C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx"
Add-AppxPackage "C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx"
Add-AppxPackage "C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"
Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"

Voilà Winget funktioniert.
Ich wollte das ganze mit
/DependencyPackagePath:
in einer Zeile, das hat aber nicht geklappt.
So ist es etwas umständlicher, aber funktioniert.
Viel Spaß!

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 14:52
von DK2000
-DependencyPackagePath gibt es nur bei Add-AppxProvisionedPackage.

Bei Add-AppxPackage heißt das -DependencyPath oder -DependencyPackages, je nach Kontext.

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 16:52
von Holgi
Danke DK2000 für den Hinweis.
Habe es noch mal mit -DependencyPath und auch -DependencyPackages versucht. Leider erfolglos.
Allerdings habe ich von Powershell so gut wie keine Ahnung.
Mit den folgenden Zeilen habe ich es versucht (4 verschiedene Möglichkeiten), aber es kamen nur Fehlermeldungen.

Code: Alles auswählen

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 
/DependencyPath:"C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx" 
/DependencyPath:"C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx" 
/DependencyPath:"C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx"
/DependencyPath:"C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 
/DependencyPackages:"C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx" 
/DependencyPackages:"C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx" 
/DependencyPackages:"C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx"
/DependencyPackages:"C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 
/DependencyPath:"Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx" 
/DependencyPath:"Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx" 
/DependencyPath:"Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx"
/DependencyPath:"Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 
/DependencyPackages:"Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx" 
/DependencyPackages:"Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx" 
/DependencyPackages:"Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx"
/DependencyPackages:"Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 16:57
von DK2000
Ersetze mal das / durch -, also /DependencyPath durch -DependencyPath.

Und kein : dahinter. Das gibt es nur direkt mit DISM, nicht aber bei den Cmdlets.

Habe es nicht weiter getestet, aber lt. Beschreibug müsste das so aussehen:

Code: Alles auswählen

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -DependencyPath "C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx","C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx","C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx","C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"
Muss ich mal testen, wobei ich nicht weiß, ob das klappt, wenn alles schon installiert ist.

Ok, so läuft es jedenfalls ohne Fehler durch:

Add-AppxPackage <Paket> -DependencyPath <Abhängigkeit1>,<Abhängigkeit2>,<Abhängigkeit3>,...

Ob es letztendlich wirklich klappt, kann ich nicht sagen, da bei mir bereist alles für alle Benutzer als Provisioned Package installiert ist. Aber es werden auch keine Fehler angeziegt.

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 17:42
von Holgi
@DK2000
bekomme es einfach nicht hin. Da fehlt mir einfach das Hintergrundwissen.

Code: Alles auswählen

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 
-DependencyPath"C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx" 
-DependencyPath"C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx" 
-DependencyPath"C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx"
-DependencyPath"C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"
bringt nur Fehlermeldungen.

Code: Alles auswählen

-DependencyPath"C:
oder

Code: Alles auswählen

-DependencyPath "C:
?
Muss das alles in eine Zeile oder kann man das wie hier:
viewtopic.php?t=21834&start=15#p326934
auch untereinander schreiben? Ich habe keine Ahnung.
Eine der Fehlermeldungen war z.B.
Add-AppxPackage : Cannot bind parameter because parameter 'DependencyPath' is specified more than once. To provide
multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter
value1,value2,value3".

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 18:10
von DK2000
Wenn Du das in mehrere Zeilen schreiben willst, so dass es ausführbar bleibt, dann kann das so aussehen:

Code: Alles auswählen

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_2021.923.524.0_neutral___8wekyb3d8bbwe.msixbundle"`
-DependencyPath "C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x64__8wekyb3d8bbwe.appx",`
                "C:\PS\Microsoft.UI.Xaml.2.6_2.62108.18004.0_x86__8wekyb3d8bbwe.appx",`
                "C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx",`
                "C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"
Wichtig dabei ist das kaum erkennbare ` (Backtick) am Ende der Zeilen. Dann wird das bei c&p in die PowerShell als eine Zeile interpretiert. Das macht die Sache etwas lesbarer. Muss dann aber auch wirklich als Ganzes in die PowerShell kopiert werden.

Und -DependencyPath nur einmal verwenden.

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 19:35
von Holgi
Danke DK2000! :dankeschoen:
Da wäre ich nie drauf gekommen.
Mußte das noch mal etwas abändern, weil in einer Windows Sandbox (wo es auch funzt) die "Microsoft.UI.Xaml.-Dateien" überflüssig waren (und sogar zu einer Fehlermeldung führten).
So sieht das dann aus (und funktioniert):

Code: Alles auswählen

Add-AppxPackage "C:\PS\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"`
-DependencyPath "C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx",`
                "C:\PS\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"
oder alternativ, wenn sich das Powershell-Script und die MSIXBundle- bzw. APPX-Dateien im gleichen Ordner befinden:

Code: Alles auswählen

Add-AppxPackage "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"`
-DependencyPath "Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx",`
                "Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x86__8wekyb3d8bbwe.appx"

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo)

Verfasst: 03.10.2021, 19:36
von Holgi
gelöst

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 15.05.2022, 12:34
von Holgi
irgendwie hatte ich mit der alten Methode (oben) plötzlich keinen Erfolg mehr.
Deshalb hier noch mal mein derzeitiges Powershell Script. Funktioniert in einer Windows Sandbox. Jetzt braucht es plötzlich wieder die UI.XAML

Code: Alles auswählen

Add-AppxPackage "Microsoft.VCLibs.140.00_x64_8wekyb3d8bbwe.appx"
Add-AppxPackage "Microsoft.UI.Xaml_x64_8wekyb3d8bbwe.appx"
Add-AppxPackage "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 15.05.2022, 16:39
von Holgi
hier noch ein schönes Script, welches ich im Internet gefunden habe. Dies lädt einem die erforderlichen Dateien bei bestehender Internet-Verbindung selbständig herunter und installiert Winget.

Code: Alles auswählen

# WinGet Version Installation Scrip for Server 2019
# Work with Version 1.2.10271 or internal Version="1.17.10271.0"
# Or Bundle Version="2022.127.2322.0" 
# Andreas Nick 2022

Write-Host "Download and install winget" -ForegroundColor Yellow

if(!(Get-Module -ListAvailable -Name 'NTObjectManager')){
    Install-Module  'NTObjectManager' -scope CurrentUser -Force -Confirm:$false
    
} 

Import-Module  'NTObjectManager'

$Offline = $true 
$RepoPath = "$env:TEMP\WinGetTemp"
$BaseURL = 'https://www.microsoft.com/store/productId/9NBLGGH4NNS1'
$DownloadFiles = @( 'Microsoft.DesktopAppInstaller_2022.127.2322.0_neutral_~_8wekyb3d8bbwe.msixbundle',
                     'Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.appx',
                     'Microsoft.UI.Xaml.2.7_7.2203.17001.0_x64__8wekyb3d8bbwe.appx')

# Version 1.2.10271 !!
$LicenseFileURL = 'https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/b0a0692da1034339b76dce1c298a1e42_License1.xml'

if(Test-Path $RepoPath   ) 
{
   #Remove-Item $RepoPath -Recurse 
} else {
    New-Item $RepoPath -ItemType Directory
}

function Get-AppXPackageURL {
[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 
  }
}


#Download Winget 2022.127.2322.0 and Dependencies
$Packlist = @()
if(-not $Offline){
  $Packlist = @(Get-AppXPackageURL -Uri $BaseURL)
  #Download License file
  Invoke-WebRequest -Uri $LicenseFileURL -OutFile (Join-Path $RepoPath -ChildPath 'license.xml' )

  #Download package files
  foreach($item in $DownloadFiles)
  {
    if(-not (Test-Path (Join-Path $RepoPath  -ChildPath $item )))
    {
       $dlurl = [string]($Packlist | Where-Object -Property filename -match $item)[0].downloadurl
       Invoke-WebRequest -Uri  $dlurl -OutFile (Join-Path $RepoPath -ChildPath $item )
    } else 
    {
        Write-Information "The file $($item) already exist in the repo. Skip download"
    }
  }

}

#Install Winget without license
#Add-AppxPackage -Path $(Join-Path $RepoPath -ChildPath  $DownloadFiles[0]) -DependencyPath  $(Join-Path $RepoPath -ChildPath  $DownloadFiles[1]), $(Join-Path $RepoPath -ChildPath  $DownloadFiles[2]) 
#Get-AppxPackage Microsoft.DesktopAppInstaller | Remove-AppxPackage

#Install Winget with license
Add-AppxProvisionedPackage -PackagePath $(Join-Path $RepoPath -ChildPath  $DownloadFiles[0]) -LicensePath $(Join-Path $RepoPath -ChildPath 'license.xml') -online `
                           -DependencyPackagePath $(Join-Path $RepoPath -ChildPath  $DownloadFiles[1]), $(Join-Path $RepoPath -ChildPath  $DownloadFiles[2])  


# Here is the trick of Thorsten Butz. We create a rebase point ourselves
# The alias can be defined somewhere in the $Temp:Path. For example, in C:\Windows\System32
Set-ExecutionAlias -Path "$env:windir\winget.exe" -Target $((Get-AppxPackage *DesktopAppInstaller*).InstallLocation + '\winget.exe') -PackageName `
                  'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' -AppType Desktop -EntryPoint 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe!winget' -Version 3

#Get-ExecutionAlias  'c:\windows\winget.exe'
#Remove-Item  'c:\windows\winget.exe'
#'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' 
pause

            
Quelle: https://www.appbot.de/113-winget-on-server-2019.html

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 04.02.2023, 18:05
von FatBoySlim
Im Scrip aus dem netz ist ein Trojaner :sauer:

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 04.02.2023, 18:08
von FatBoySlim
Bild :sauer:

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 04.02.2023, 18:32
von Holgi

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 26.07.2023, 20:06
von Holgi
von MS selbst gibt es ebenfalls noch eine elegante Methode:
https://learn.microsoft.com/de-de/windo ... er/winget/

Code: Alles auswählen

$progressPreference = 'silentlyContinue'
$latestWingetMsixBundleUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object {$_.EndsWith(".msixbundle")}
$latestWingetMsixBundle = $latestWingetMsixBundleUri.Split("/")[-1]
Write-Information "Downloading winget to artifacts directory..."
Invoke-WebRequest -Uri $latestWingetMsixBundleUri -OutFile "./$latestWingetMsixBundle"
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile Microsoft.UI.Xaml.x64.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.UI.Xaml.x64.appx
Add-AppxPackage $latestWingetMsixBundle
das Script wurde von mir noch etwas erweitert:
die Microsoft.UI.Xaml.2.7 kann ggf. erforderlich sein.
BTW: weiß jemand, ob es für die Microsoft.VCLibs.140.00_14.0.XXXXXX.0_x64_8wekyb3d8bbwe.Appx (also die ohne Desktop) ebenfalls eine statische Download Adresse gibt (so in der Art https://aka.ms/ .....)?

Gibt es eine Übersicht für https://aka.ms/ .....?

hier mal ein paar Beispiele:

Code: Alles auswählen

https://aka.ms/vs/17/release/vc_redist.x86.exe
https://aka.ms/vs/17/release/vc_redist.x64.exe

https://aka.ms/directx_x86_appx
https://aka.ms/directx_x64_appx

https://aka.ms/Microsoft.VCLibs.x86.14.00.Desktop.appx
https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx

https://aka.ms/Microsoft.VCLibs.arm64.14.00.Desktop.appx
https://aka.ms/Microsoft.VCLibs.arm.14.00.Desktop.appx

Re: Winget (Desktop App Installer) für Windows Versionen ohne Store installieren (HowTo) [gelöst]

Verfasst: 25.01.2024, 15:18
von Holgi
hier noch mal ein "Einzeilen-Shorty". Hab ich irgendwo aus dem Internet.

Code: Alles auswählen

@Echo off
echo ======================
echo Installiere Winget
echo ====================== & echo.

powershell -command "$ProgressPreference = 'SilentlyContinue' ; write-host "Downloade und installiere Abhängigkeiten" ; Invoke-WebRequest -Uri  https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; Invoke-WebRequest -Uri  https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 -OutFile .\microsoft.ui.xaml.2.7.3.nupkg.zip ; Expand-Archive -Path .\microsoft.ui.xaml.2.7.3.nupkg.zip -Force ; Add-AppXPackage -Path .\microsoft.ui.xaml.2.7.3.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx; Add-AppXPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; write-host "Installiere Winget" ;  Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.6.3482/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 2> nul