-
Notifications
You must be signed in to change notification settings - Fork 9
rfc: MSIX auto-updater #21
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
base: main
Are you sure you want to change the base?
Conversation
5a6495c
to
9f823ff
Compare
9f823ff
to
344c351
Compare
Is this a replacement of Squirrel or user can choose modes? |
RFC says that the updater will support both, msix support in the autoUpdater API will enable only when running in a windows package environment I.e. dev chooses, ship a squirrel exe, an msix, or both for fun |
The intention here is to first propose it as an alternative updater solution without explicitly discussing the future of Squirrel.Windows in Electron since it's a bit out of scope. IMO without a clear path for apps to migrate from Squirrel.Windows -> MSIX, I think there's no path to actually removing it from Electron. |
This is an excellent proposal, and I think it covers a lot of what one would need for authoring a net new app using MSIX as a delivery mechanism. I think the decisions are reasonable and easy enough to build on. I don't have enough context to address the Squirrel comments as my experience with MSIX has been shoehorning it into a bespoke system that is made of some For our purposes we'd be adapting an existing build/deploy/upgrade stack so it would be useful to know how modular the proposed delivery would be: where would the code for the That is, if there's the option to have an open source lib with the It exceeds the scope of this document but it does stand to reason that the other big lift for meeting our needs at Notion are being able to build an appropriate In all, this addresses a good first chunk of what we need to get MSIX off the ground. We'll need a good documentation story and references on the other pieces (namely 1. Application Manifest XML files, 2. Knowing what is and is not reasonable to expect from an MSIX installation versus a traditional installer that can spray files and registry keys wherever it wants and 3. How to get up and running digitally signing the packages). It stands to emphasize that an MSIX deployment is a huge lift: it's probably not an appropriate deployment mechanism for a hobbyist project unless it's very simple, it's more for larger enterprise installation cases. |
* | ||
* Throws if the current application has no packaged identity. | ||
*/ | ||
getPackagedAppInfo(): WindowsPackagedAppInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be exposed in the windowsPackagedApp
API? Would that be something apps could import if they wanted lower-level access to these APIs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should expose that API. For many purposes, developers will need to know at runtime of an app whether its MSIX packaged. For example, if you want to check whether Notifications are enabled for your app, you need to call the Window API for that differently. If you are not an MSIX packager app, you have to pass in the AUMID. If you are a MSIX packaged App then you shouldn't pass the AUMID, otherwise the API call fails. So there will be always slight differences in MSIX packaged apps.
* 'FullName' ID. | ||
* e.g. 91750D7E.Slack_4.38.65535.0_arm64__8she8kybcnzg4 | ||
*/ | ||
id: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these values queried using Windows APIs? Might be worth linking to the APIs that will be used to gather this info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This is the API that gives the info https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.package.current?view=winrt-26100
@jasonbot thanks fort the feddback and great questions!
The code needs to be inside electron core. For many purposes, developers will need to know at runtime of an app whether its packaged. For example, if you want to check whether Notifications are enabled for your app, you need to call the Window API for that differently. If you are not an MSIX packager app, you have to pass in the AUMID. If you are a MSIX packaged App then you shouldn't pass the AUMID, otherwise the API call fails. So there will be always slight differences in MSIX packaged apps.
We are doing the same at Slack. But this will be a bit different. Instead of passing in the MSIX URL directly, we need to pass a URL to a json file, the same way how Squirrel on Mac works. We proposed this to align the API between Mac and Windows. That being said, I also thought about accepting either, the json format or a direct link to and MSIX. WHat are your thoughts @samuelmaddock
You will see that electron-windows-msix already has basic manifest generation capability. These capabilities could be extended. The question is how far. The MSIX schema is pretty big and there different namespaces depending on the version. It would be hard to cover all the possible use cases. At some point people will have to write their own manifest tailored to their needs. But there is definitely room to add more common option like protocol handler or startup tasks to the packager.
You area absolutely right! There is a lot of things to consider and the capability around MSIX have changed alot with each Windows version.
I'm curious which parts would be the hardest for a hobbyist project and how we could make it easier. |
MSIX is an app package format developed by Microsoft for Windows. It is designed to replace previous generations of installer formats such as AppX, MSI, and ClickOnce.
This RFC proposes adding first-class support for MSIX packages in Electron by supporting its native auto-update API with Electron's
autoUpdater
module.This change would reroute
autoUpdater
requests for MSIX-packaged apps away from Electron's existing Squirrel.Windows implementation and into a new code path that calls the MSIX update APIs.