Skip to content

Not working in Windows Sandbox #23

@ztrhgf

Description

@ztrhgf

In Windows Sandbox it throw error that winget isn't installed. Code below solve this issue:

$ProgressPreference = 'silentlycontinue'
 "Installing WinGet Dependencies"
    "`t-VCLib"
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx' -ErrorAction SilentlyContinue

    "`t-UI.Xaml"
    Invoke-WebRequest "https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.1" -UseBasicParsing -OutFile "$env:TEMP\UI.xaml.zip"
    Expand-Archive "$env:TEMP\UI.xaml.zip" -DestinationPath "$env:TEMP\UI.xaml" -Force
    Add-AppxPackage -Path "$env:TEMP\UI.xaml\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx" -ErrorAction SilentlyContinue

    "Downloading WinGet"
    Invoke-WebRequest "https://aka.ms/getwinget" -UseBasicParsing -OutFile "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
    #Install WinGet MSIXBundle
    Try {
        Write-Host "Installing MSIXBundle for App Installer..."
        Add-AppxProvisionedPackage -Online -PackagePath "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -SkipLicense
        Write-Host "Installed MSIXBundle for App Installer" -ForegroundColor Green
    } Catch {
        Write-Host "Failed to install MSIXBundle for App Installer..." -ForegroundColor Red
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions