Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish WinGet as an MSIX with dependencies included #401

Closed
felipecrs opened this issue Jun 4, 2020 · 11 comments
Closed

Publish WinGet as an MSIX with dependencies included #401

felipecrs opened this issue Jun 4, 2020 · 11 comments
Labels
Issue-Feature This is a feature request for the Windows Package Manager client.
Milestone

Comments

@felipecrs
Copy link
Contributor

felipecrs commented Jun 4, 2020

Description of the new feature/enhancement

Publish the WinGet installer as an MSIX with the dependencies included, just like Windows Terminal.

Motivation

Currently, the WinGet .appxbundle has two required dependencies from VCLibs. This prevents people to install in environments where there is no Microsoft Store available, such as the Windows Sandbox. This would help microsoft/winget-pkgs#827.

Proposed technical implementation details

Follow the same approach of Windows Terminal, tracked on microsoft/terminal#3097 and microsoft/terminal#5661.

This can also help -> https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net

@felipecrs felipecrs added the Issue-Feature This is a feature request for the Windows Package Manager client. label Jun 4, 2020
@ghost ghost added the Needs-Triage Issue need to be triaged label Jun 4, 2020
@JohnMcPMS JohnMcPMS added this to the Package Manager Backlog milestone Jun 5, 2020
@JohnMcPMS JohnMcPMS removed the Needs-Triage Issue need to be triaged label Jun 5, 2020
@ghost ghost added the In-PR Issue related to a PR label Jun 24, 2020
@driver1998
Copy link

I guess the better way would be asking MS to release those dependency package outside the store, in a support document or something.

They provide direct appx downloads for WSL distros in WSL docs after all.

@grzegor
Copy link

grzegor commented Feb 6, 2021

[...] release those dependency package outside the store

They're available to download from the Microsoft docs site over here.

@felipecrs
Copy link
Contributor Author

Not all of the needed deps seems to be there, as per my comments in the TestSandbox PR

@grzegor
Copy link

grzegor commented Feb 6, 2021

Oh, right - just read about VCLibs in your original post. I didn't realize there's also a separate VCLibsUWP package.

@ghost ghost removed the In-PR Issue related to a PR label Jun 17, 2021
ElliotKillick added a commit to ElliotKillick/qvm-create-windows-qube that referenced this issue Jun 13, 2023
The winget.ps1 script is currently not working. Microsoft is still doing
work on this front so I'm going to wait until the dust settles here.

If you need non-interactive installation of WinGet now then see here:
https://github.com/asheroto/winget-installer/blob/master/winget-install.ps1

WinGet GitHub issues to track:
microsoft/winget-cli#401
microsoft/winget-cli#2434

Also, perhaps MSIX Core so we can get Windows 7 support:
https://learn.microsoft.com/en-us/windows/msix/msix-core/msixcore
However, that's only MSIX, MS isn't targeting WinGet for below Windows
10 1809 (but maybe someone will build a small compatability layer):
microsoft/winget-cli#1686 (comment)
@denelon
Copy link
Contributor

denelon commented Mar 6, 2024

@felipecrs we're not likely to pull the dependencies into WinGet and include them in our bundle. We've created the Repair-WinGetPackageManger cmdlet in the Microsoft.WinGet.Client powershell module to make it easier to bootstrap/upgrade WinGet when the Microsoft Store isn't available. We've also added the App Installer (with "winget" moniker) to the community repository along with the dependencies.

I've also got a sample WinGet configuration over at https://aka.ms/dsc.yaml for launching the Windows Sandbox and bootstrapping WinGet inside the sandbox.

Note: I've refactored it to match our guidance over at Microsoft Learn rather than using the Repair-WinGetPackageManager and that PR hasn't been merged as of today.

@denelon denelon modified the milestones: Backlog-Client, 1.8 Client Mar 6, 2024
@felipecrs
Copy link
Contributor Author

@denelon Alright. I honestly don't care about this anymore. And I have not given Repair-WinGetPackageManager a try yet.

Please close the issue if you feel there's nothing else to be done.

@akbyrd
Copy link

akbyrd commented Mar 6, 2024

@denelon Are there instructions available for bootstrapping winget from a terminal in an environment like Windows Sandbox? Packaging a program into a single file with all it's dependencies is a standard software practice. Currently with winget I have to jump through hoops to manually download and install dependencies from a script and that fails every time the dependency set changes.

function Install-WinGet
{
	# Using github instead of the store since it's not guaranteed to be installed (Windows Sandbox,
	# corporate environments, etc).
	# https://learn.microsoft.com/en-us/windows/package-manager/winget/#install-winget-on-windows-sandbox

	# We have to manually grab dependencies. This is fragile and will hopefully be fixed one day.
	# https://github.com/microsoft/winget-cli/issues/401
	$wingetUrls = @(
		"https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx",
		"https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx",
		"https://aka.ms/getwinget"
	)

	# Disable progress because it slows downloads to a crawl
	$progressPreference = "silentlyContinue"
	$tempDir = "dotfiles-temp"
	Write-Information "Downloading WinGet and its dependencies..."
	New-Item $tempDir -ItemType Directory -Force | Out-Null
	for ($i = 0; $i -lt $wingetUrls.Length; $i++)
	{
		$url = $wingetUrls[$i]
		$filename = "$tempDir\WingetFile_$i.msixbundle";

		Invoke-WebRequest -Uri $url -OutFile $filename
		Add-AppxPackage $filename
		Remove-Item $filename
	}
	Remove-Item $tempDir
	$progressPreference = "Continue"
}

@felipecrs
Copy link
Contributor Author

At this point, I think there's no good reason for Windows Sandbox not to come with WinGet preinstalled btw. 😄

@Trenly
Copy link
Contributor

Trenly commented Mar 6, 2024

@denelon Are there instructions available for bootstrapping winget from a terminal in an environment like Windows Sandbox? Packaging a program into a single file with all it's dependencies is a standard software practice. Currently with winget I have to jump through hoops to manually download and install dependencies from a script and that fails every time the dependency set changes.

This is what I use inside a PowerShell script

Install-PackageProvider -Name NuGet -Force
Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery
Repair-WinGetPackageManager

@denelon
Copy link
Contributor

denelon commented Mar 6, 2024

At this point, I think there's no good reason for Windows Sandbox not to come with WinGet preinstalled btw. 😄

I'm working with the Windows Sandbox team on doing this 😊

@denelon
Copy link
Contributor

denelon commented Mar 6, 2024

@akbyrd: https://learn.microsoft.com/windows/package-manager/winget/#install-winget-on-windows-sandbox

@denelon denelon closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants