diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-09 18:19:06 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-10 09:57:29 +0200 |
| commit | 42b562fcf312ddceb78438b5daea49d4c9b465c8 (patch) | |
| tree | 770913e96292b4c5123f8c5ecba2d62577307f67 /packages/meshbay-client/build | |
| parent | 25152ddb61a89ea3ea29d3aef5de13343429d32a (diff) | |
| download | meshbay-42b562fcf312ddceb78438b5daea49d4c9b465c8.tar.gz | |
feat(packaging): the Store package declares what the NSIS scripts do
A test-signed install of the MSIX build, in the WindowsApps folder a Store
install uses, showed that every script-made piece of the NSIS model breaks
there, because each names the install folder and every update deletes it:
the firewall rules went stale, the PATH entries piled up pointing at deleted
folders, and the Startup-folder .vbs was refused ("Permission denied") right
after sign-in. The network capabilities the manifest declared covered
nothing: they make rules for sandboxed apps only, and a listener in the
package still got the Windows firewall prompt. The package's own startup
task was on by default, started the node whatever mode the Node page said,
and ran the console executable, whose window stopped the node when closed.
The package now declares what Windows then creates at install, carries
across updates and removes with the app, all without an administrator
prompt (each measured on the real install, through an update and a reboot):
- firewall rules for the node, in a custom manifest template, since only a
package-level element can hold them;
- the startup task, off by default, running meshbay-nodew.exe, a new build
of the daemon without a console;
- an execution alias for meshbay-node.exe, so the app adds no PATH entry.
The node's CLI switches the startup task (platform.startup_task, ctypes over
the WinRT ABI): Windows gives the package's identity to the executables in
it, not to a powershell.exe the app starts, which got "Element not found".
`meshbay-node autostart install | remove | status` therefore works in the
Store package from the app and a terminal alike; the app caches the answer,
since the Node page polls. Starting at boot stays the .exe installer's: the
Store package offers no service mode, and the CLI refuses `service install`
there. Process listings count both image names.
The Node page's status poll cleared the message of a refused action within
five seconds; the two errors are kept apart now (all Windows builds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-client/build')
| -rw-r--r-- | packages/meshbay-client/build/appx-extensions.xml | 16 | ||||
| -rw-r--r-- | packages/meshbay-client/build/appx-manifest.xml | 68 |
2 files changed, 82 insertions, 2 deletions
diff --git a/packages/meshbay-client/build/appx-extensions.xml b/packages/meshbay-client/build/appx-extensions.xml index 1ee1cca..3326dd8 100644 --- a/packages/meshbay-client/build/appx-extensions.xml +++ b/packages/meshbay-client/build/appx-extensions.xml @@ -1,3 +1,15 @@ - <desktop:Extension Category="windows.startupTask" Executable="app\resources\node-runtime\meshbay-node.exe" EntryPoint="Windows.FullTrustApplication"> - <desktop:StartupTask TaskId="MeshBayNodeStartup" Enabled="true" DisplayName="MeshBay Node" /> + <!-- At sign-in: off until the user picks that mode on the Node page, which + switches it through `meshbay-node autostart`. meshbay-nodew.exe, the build + without a console: Windows runs a startup task's executable as is, and + the console one opened a window whose close button stopped the node. --> + <desktop:Extension Category="windows.startupTask" Executable="app\resources\node-runtime\meshbay-nodew.exe" EntryPoint="Windows.FullTrustApplication"> + <desktop:StartupTask TaskId="MeshBayNodeStartup" Enabled="false" DisplayName="MeshBay Node" /> </desktop:Extension> + <!-- `meshbay-node` in a terminal: %LOCALAPPDATA%\Microsoft\WindowsApps is + on PATH already and this alias keeps its path across versions, where a + PATH entry naming the install folder went stale at each update. --> + <uap5:Extension Category="windows.appExecutionAlias" Executable="app\resources\node-runtime\meshbay-node.exe" EntryPoint="Windows.FullTrustApplication"> + <uap5:AppExecutionAlias> + <uap5:ExecutionAlias Alias="meshbay-node.exe" /> + </uap5:AppExecutionAlias> + </uap5:Extension> diff --git a/packages/meshbay-client/build/appx-manifest.xml b/packages/meshbay-client/build/appx-manifest.xml new file mode 100644 index 0000000..a8dba41 --- /dev/null +++ b/packages/meshbay-client/build/appx-manifest.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- electron-builder's own appx template (app-builder-lib/templates/appx/), + plus what only a package-level element can declare: the node's firewall + rules. AppxTarget.js fills in its macros as for the stock one, and fails + on any it does not know, even inside a comment; re-check against that + file when electron-builder is upgraded. --> +<Package + xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" + xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" + xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" + xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" + xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2" + xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"> + <!-- use single quotes to avoid double quotes escaping in the publisher value --> + <Identity Name="${identityName}" + ProcessorArchitecture="${arch}" + Publisher='${publisher}' + Version="${version}" /> + <Properties> + <DisplayName>${displayName}</DisplayName> + <PublisherDisplayName>${publisherDisplayName}</PublisherDisplayName> + <Description>${description}</Description> + <Logo>${logo}</Logo> + </Properties> + <Resources> + ${resourceLanguages} + </Resources> + <Dependencies> + <TargetDeviceFamily Name="Windows.Desktop" MinVersion="${minVersion}" MaxVersionTested="${maxVersionTested}" /> + </Dependencies> + ${capabilities} + <Applications> + <Application Id="${applicationId}" Executable="${executable}" EntryPoint="Windows.FullTrustApplication"> + <uap:VisualElements + BackgroundColor="${backgroundColor}" + DisplayName="${displayName}" + Square150x150Logo="${square150x150Logo}" + Square44x44Logo="${square44x44Logo}" + Description="${description}"> + ${lockScreen} + ${defaultTile} + ${splashScreen} + </uap:VisualElements> + ${extensions} + </Application> + </Applications> + <!-- The node accepts connections from peers (WebRTC, QUIC, casting). Rules + declared here are created by Windows at install with no administrator + prompt, follow the executable's versioned path on every update, and go + with the package. A rule the app made itself named that path and was + stale after the next update; the network capabilities create rules for + sandboxed apps only, which a full-trust process is not. Both measured + on a real install. --> + <Extensions> + <desktop2:Extension Category="windows.firewallRules"> + <desktop2:FirewallRules Executable="app\resources\node-runtime\meshbay-node.exe"> + <desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all" /> + <desktop2:Rule Direction="in" IPProtocol="UDP" Profile="all" /> + </desktop2:FirewallRules> + </desktop2:Extension> + <desktop2:Extension Category="windows.firewallRules"> + <desktop2:FirewallRules Executable="app\resources\node-runtime\meshbay-nodew.exe"> + <desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all" /> + <desktop2:Rule Direction="in" IPProtocol="UDP" Profile="all" /> + </desktop2:FirewallRules> + </desktop2:Extension> + </Extensions> +</Package> |