11

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?

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. Commented Jan 6, 2023 at 13:16

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

3 Comments

I just forgot to enable Developer Mode, but it worked fine regardless, so I think Developer Mode is not mandatory.
powershell approach doesn't work. it says Provide the framework "Microsoft.WindowsAppRuntime.1.5" and the app store approach gives: add-appxpackage "apps.microsoft.com/detail/9NBLGGH4NNS1?hl=en-us&gl=‌​us" add-appxpackage : Deployment failed with HRESULT: 0x80073CF0, Package could not be opened. error 0x80D0201A: Opening the package from location 9NBLGGH4NNS1?hl=en-us&gl=us failed. NOTE: For additional information, look for [ActivityId] 03fa2669-d973-0000-a15d-fb0373d9db01 in the Event Log and the event log has no helpful info

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.