tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] Windows - Build MSIX Packages to Support Package Extensions

Open madaster97 opened this issue 2 years ago • 11 comments

Describe the problem

There are a number of windows features that require a desktop app to have package identity. For example, you can use a package extension to have websites redirect to your desktop application (app URI handlers) similar to universal links on iOS.

The issue is that Tauri apps build to msi which cannot have package identity, so we can't use the features above in our apps. We'd need to build to MSIX to do this.

Describe the solution you'd like

Enabling Package Extensions from Config

If we implemented package identity under the hood (as in, build msix packages), then it'd be great to give config options for some useful package extensions, such as windows.appUriHandler. This would for instance increase OAuth 2.0 support in Tauri, since we'd have a method other than custom URI schemes or localhost servers to accept OAuth 2.0 requests from the system default browser. Discord thread for reference.

Option for Package Identity: Sparse Package

Microsoft outlines 2 ways to obtain package identity:

  • Build MSIX directly from your source code (discussed as an alternative below)
  • Build a sparse package, which notably is ⚠ only supported in Windows 10 version 2004 and later

A sparse package effectively sits beside your existing apps and adds additional features using an MSIX that points at your existing MSI based app. It seems like a much lower lift than building MSIX from source, for some reasons discussed in the alternatives section below.

Microsoft has a nice tutorial outlining how to generate a sparse package, and here's where I expect the complexity to be for Tauri:

  • The additional build step includes signing the package. We'd need a system for choosing/generating a certificate to sign the package with
  • There is a run-time registration step we'd need to introduce. I'm not actually sure if this goes in the MSI or MSIX 🤷‍♂️. That tutorial includes a code snippet, and WiX has some documentation on injecting the action with a template. We'd just need to write a dll for this and include it in the %AppData%\Local\tauri\WixTools folder (I think)

Alternatives considered

Creating full MSIX packages instead of or in addition to MSI. This is nice because it's supported before ✔Windows 10 version 2004, but has a couple big drawbacks ❌:

  • Wix doesn't currently support MSIX, so we'd have to re-tool to one of the techniques in the link above
  • There are a ton of prereqs Tauri would need to meet in terms of what windows features it uses (example: Using a background task instead of a windows service)
  • [ ] I would appreciate if someone could review the prereqs list

Additional context

I researched this because it's important for flexibility in using Tauri as an OAuth 2.0 client app. In issue 323 I saw some confusion on this and wanted to call out based on RFC 8252 section 8.12 you shouldn't be conducting OAuth 2.0 from a web-view. Instead, you should be launching to the system default browser and having it redirect back to the initial native app. Adding app URI Handler support would be a great way for Tauri apps to conduct this redirect.

madaster97 avatar Aug 01 '22 01:08 madaster97

Maybe we can do that as part of the NSIS implementation.

lucasfernog avatar Aug 01 '22 05:08 lucasfernog

I have plans to make a MSIX bundle for tauri but probably in v3 (unless someone else wants to do it before that).

If you just want to have deep-link, then we can add it for both WiX and NSIS once #4674 is merged.

amrbashir avatar Aug 02 '22 22:08 amrbashir

Thanks both!

@amrbashir - Yeah getting a custom URI scheme with WiX or NSIS would be great. I see that sticking around for some time, precisely because people won't have to deal with MSIX files.

madaster97 avatar Aug 04 '22 00:08 madaster97

I leave this issue open for msix but there is already an issue for deep linking here #323

amrbashir avatar Aug 04 '22 11:08 amrbashir

When I submitted the msi application generated by Tauri to the Microsoft Store, I received the following message:

If your EXE or MSI cannot comply with Microsoft Store policy 10.2.9, you can consider repackaging your existing EXE or MSI to MSIX format. Microsoft Store offers many complimentary benefits for MSIX format such as code signing, hosting etc. For more details, click here.

You can run your EXE or MSI installers through MSIX Packaging Tool and obtain an MSIX package that you can submit to the Microsoft Store as MSIX packaged app. Note that you have to delete your app name from existing Win32 app in Partner Center in case you want to use the same for MSIX packaged app.


I manually converted the msi package to an msix installation package using the MSIX Packaging Tool. I will try to submit this content to the Microsoft Store and provide updates on progress.

gezihuzi avatar Mar 21 '24 09:03 gezihuzi

@gezihuzi Hi, I want to do the same, do you need to sign the msix or can I upload it to MS Store without sign it? I read that Microsoft sign the msix installers on the store but to upload it for review it stills need to be signed.

eythaann avatar Apr 04 '24 19:04 eythaann

@gezihuzi Hi, I want to do the same, do you need to sign the msix or can I upload it to MS Store without sign it? I read that Microsoft sign the msix installers on the store but to upload it for review it stills need to be signed.

To my knowledge, there are currently two options for creating products in the Microsoft Store:

  1. MSIX and PWA, MSIX supports packages uploaded without requiring signing, as Microsoft Store automatically signs them.

  2. EXE and MSI, which require purchasing a certificate for signing.

If you are only publishing to the Microsoft Store, choose the first option and submit an unsigned package created using the MSIX Packaging Tool.


The package I submitted has been uploaded and approved. I will write an article later on how I submitted a Tauri app to the Microsoft Store.

gezihuzi avatar Apr 05 '24 14:04 gezihuzi

Cool I did the same, now I'm waiting for certification or approval. And yes an article sounds great currently there are no articles or something talking about msix with tauri.

eythaann avatar Apr 05 '24 21:04 eythaann