How to package a Python project into MSIX package?

Question:

I currently work on a Python project, which I’d like to upload to the Microsoft Store in the future.

As far as I am aware, in order to upload applications to the Microsoft Store, it is necessary that the application will be packed into the MSIX format.

Now the question is – is it possible to pack a Python project into the MSIX format?

I already tried two possible approaches


  • The first approach

I assumed that it will be much easier to pack an .exe file into an MSIX package. Since .py files require an interpreter in order to run, I managed to freeze the Python project into a standalone .exe runnable file – and it works pretty good.
I found a useful tool made by Microsoft, which is supposed to pack .exe files under the MSIX format. The tool is MSIX Packaging Tool which is available at the Microsoft Store. I did manage to create an .msix file but I can’t run in since Windows says that I have to sign the .exe first.


  • The second approach

I found out that it is possible to pack a project into an MSIX package, by using built-in tools inside Visual Studio 2019. So I managed to move my whole python project into Visual Studio, and follow the next steps in order to pack my project.
The problem is that already in the early stages, when adding the reference to my python project, the next error occurs:

Stage number 5


I’d love to know if you have any other possible approaches for packing a Python project into an MSIX package.

Asked By: Daniel Reyhanian

||

Answers:

I don’t know how you can package your Python app in Visual Studio but here is a tutorial we wrote for using Advanced Installer.

A quick tutorial on how to create an MSIX from scratch for your Python application: https://www.advancedinstaller.com/create-msi-python-executable.html

The following SO question also dives in this topic a little bit more, it is not exactly what you are looking but maybe it will help you:
How can I programmatically uninstall my MSIX python app?

Disclaimer: I work on the team building Advanced Installer

Answered By: Bogdan Mitrache