MSIX packages on Windows Sandbox?
Asked Answered
I

1

8

I'm trying to work out how to package a WinUI desktop application in MSIX. We don't want to upload to Windows Store or anything, just to be able to give people an installer (much like a .msi file), and have them install that for themselves on their desktop PC.

I'm using VS2022 to package the most basic of WinUI applications, i.e. the application which the framework creates for you. I've successfully managed to create a .msix file for it. But when I copy that onto a Windows Sanbox instance, it doesn't appear to know what to do with the .msix extension. Windows Sandbox is version 2004, which according to this page should be good enough.

However, double-clicking the .msix file doesn't work:

enter image description here

Can anyone suggest why this is?

Also, this article seems to suggest that even if I can get the msix to open, it will still require the end-user to manually install the dependencies! Surely this can't be right? No end-user is going to want to have to do that, are they? The article is a little old now (things move on quickly), so can anyone tell me if that's still the state of msix package installers. Is there a nice way to package apps so that they have a simple installation?

Ikkela answered 21/11, 2022 at 14:28 Comment(1)
Can you install the App Installer (apps.microsoft.com/store/detail/app-installer/…) and try again? Regarding the question, the article mentions that this is a bug with the .NET assembly trimming. Users do not need to install the framework if you package your app.Palocz
A
5

It's indeed possible to install and use MSIX in Windows Sandbox; however, the GUI for handling the .msix extension directly is not available (not out of the box). What you can do is:

Activate Developer Mode to enable sideloading of applications. This step is essential for allowing the installation of MSIX packages directly. enter image description here enter image description here

Then, launch PowerShell within the Windows Sandbox. You can install an MSIX package using the following command:

Add-AppxPackage -Path mySetup.msix

This allows you to manually install your MSIX packaged application.

For the graphical user interface approach, you can also install the App Installer from the Microsoft Store (use the Add-AppxPackage command for this package https://apps.microsoft.com/detail/9NBLGGH4NNS1?hl=en-us&gl=us), which enables installing MSIX packages by double-clicking them. However, remember that installing the App Installer or any other software in Windows Sandbox is temporary. Once the Sandbox session ends, these installations will not persist, making the PowerShell command perhaps the most straightforward solution for testing purposes.

Applicant answered 7/2, 2024 at 13:51 Comment(1)
I just forgot to enable Developer Mode, but it worked fine regardless, so I think Developer Mode is not mandatory.Applicant

© 2022 - 2025 — McMap. All rights reserved.