Ship the browser engine as its own release file
The installer no longer bundles the engine, and the installer script stops when the bundle names it or when the setup file is over 30 MB. pnpm build:browser-engine packages the engine, writes a deterministic ZIP and its record to releases/browser-engine/<version>/, and pins the ZIP in the host. The installer hooks remove the engine folder that 0.1.48 leaves behind, and uninstall removes the downloaded engine.
This commit is contained in:
+48
-10
@@ -13,7 +13,7 @@ Use the [release policy](releases.md) to select the version, store the files, an
|
||||
Prerequisites:
|
||||
|
||||
- The source setup in [Run from source](development.md#run-from-source).
|
||||
- A Windows Browser runtime staged in `src-tauri/browser-engine`. See [Built-in browser runtime](development.md#built-in-browser-runtime). The installer bundles that folder.
|
||||
- The pin of the browser engine in `src-tauri/browser-engine.json`. To build a new engine first, see [Build the browser engine](#build-the-browser-engine). The installer does not include the engine.
|
||||
- Internet access for the first build. Tauri downloads NSIS and the WebView2 bootstrapper.
|
||||
|
||||
Procedure, in the RuneStone repository root:
|
||||
@@ -45,7 +45,7 @@ Source: `scripts/buildInstaller.mjs`.
|
||||
|
||||
1. Reads the version and makes sure that all version fields match the current version.
|
||||
2. Makes sure that downgrade protection stays on in `tauri.conf.json` and `tauri.windows.conf.json`.
|
||||
Makes sure that `tauri.windows.conf.json` names the installer hooks and that the browser runtime is staged.
|
||||
Makes sure that `tauri.windows.conf.json` names the installer hooks and that `tauri.conf.json` does not bundle the browser engine.
|
||||
3. Stops if the setup file or `host.json` exists in the bundle folder or in `releases/<version>/`.
|
||||
A dry run prints the plan and stops here.
|
||||
4. Saves copies of the four version files as `*.before` in `output/installer-build/<version>/<time>/`, a new folder for each attempt.
|
||||
@@ -55,7 +55,8 @@ Source: `scripts/buildInstaller.mjs`.
|
||||
Tauri gives the override to the Rust build script and to the app. Cargo keeps the previous package version, so the app must not use `CARGO_PKG_VERSION`.
|
||||
6. Runs `scripts/setWindowsVersion.ps1`. It writes the release version to the `FileVersion` and `ProductVersion` strings of `runestone.exe`. Tauri can write only a SemVer version to these strings.
|
||||
7. Runs `tauri bundle --bundles nsis --config <override>`. Tauri uses its stock NSIS template with the [installer hooks](#installer-hooks).
|
||||
8. Moves the setup file into `releases/<version>/`, writes `host.json`, and removes the bundle-folder copy.
|
||||
8. Stops if the setup file is larger than 30 MB. The core installer is about 10 MB.
|
||||
Moves the setup file into `releases/<version>/`, writes `host.json`, and removes the bundle-folder copy.
|
||||
9. Writes the new version to `package.json`, `tauri.conf.json`, `Cargo.toml`, and `Cargo.lock`.
|
||||
|
||||
### Failure and rollback
|
||||
@@ -77,6 +78,8 @@ Keep these properties when you change the installer configuration or hooks:
|
||||
| Windows shows the release version in installed apps. | The hooks write the release version, such as `0.1.23a`, to `DisplayVersion`. |
|
||||
| The app identity stays the same across upgrades. | The identifier stays `com.runestone.app`. |
|
||||
| WebView2 is available. | The installer embeds the WebView2 bootstrapper. If the runtime is missing, setup downloads it. |
|
||||
| An update removes the engine folder of releases up to 0.1.48. | `NSIS_HOOK_POSTINSTALL` removes `$INSTDIR\browser-engine`. The uninstaller of the old version does not run, so nothing else removes it. |
|
||||
| Uninstall removes the downloaded browser engine. The browser profiles stay unless the user deletes the app data. | `NSIS_HOOK_POSTUNINSTALL` removes `browser-engine` in the local app data folder, except during an update. |
|
||||
|
||||
The installer uses the RuneStone icon, installs for the current Windows account, and adds a Start menu shortcut and an uninstaller.
|
||||
It does not register document types or start RuneStone when Windows starts.
|
||||
@@ -93,7 +96,8 @@ RuneStone uses the stock NSIS template of the Tauri CLI.
|
||||
| --- | --- | --- |
|
||||
| `RuneStoneGuiInit`, set as `MUI_CUSTOMFUNCTION_GUIINIT` | Interactive and passive (`/P`) setup, before the first page | Stops a downgrade. Makes the maintenance page skip itself. |
|
||||
| Section `-RuneStoneVersionCheck` | All modes, before the Tauri sections | Restores the current-user context. Stops a downgrade. Silent setup shows no pages, so it needs this check. |
|
||||
| `NSIS_HOOK_POSTINSTALL` | At the end of the Tauri `Install` section | Writes `DisplayVersion`, `RuneStoneReleaseVersion`, and `RuneStoneWindowsVersion`. |
|
||||
| `NSIS_HOOK_POSTINSTALL` | At the end of the Tauri `Install` section | Writes `DisplayVersion`, `RuneStoneReleaseVersion`, and `RuneStoneWindowsVersion`. Removes `$INSTDIR\browser-engine`. |
|
||||
| `NSIS_HOOK_POSTUNINSTALL` | At the end of the Tauri `Uninstall` section | Removes `$LOCALAPPDATA\com.runestone.app\browser-engine`, except in update mode. |
|
||||
|
||||
Tauri includes the hooks file before the template variables, pages, and sections.
|
||||
Thus only the `NSIS_HOOK_*` macros can use template symbols such as `${VERSION}`.
|
||||
@@ -147,12 +151,15 @@ Do all checks in this table for the first installer that uses the stock template
|
||||
| Open RuneStone from the Start menu | The app opens without a terminal or a development server. |
|
||||
| Create a workspace outside the installation folder | Notes save and open again. |
|
||||
| Install the new version over 0.1.44 | Setup shows no maintenance page and does not start the uninstaller. It updates the app and keeps workspace files and settings. |
|
||||
| Install the new version over 0.1.48 | The `browser-engine` folder in the installation folder is gone. At the first browser start, the browser profiles move from `%APPDATA%` to `%LOCALAPPDATA%`. |
|
||||
| Open a browser tab, then select **Download the engine** | The download shows its progress. Then the tab opens its page. |
|
||||
| Open a browser tab without internet access | The tab shows the cause, **Retry**, and **Install from file…**. Web links in documents open in the system browser. |
|
||||
| Install the same version again | Setup shows no maintenance page and does not start the uninstaller. It keeps workspace files and settings. |
|
||||
| Install an older version, for example 0.1.44 | Setup blocks the downgrade. |
|
||||
| Silent downgrade attempt | See the procedure below this table. Setup stops with exit code 2 and changes nothing. |
|
||||
| Open **Settings → Apps → Installed apps** in Windows | The RuneStone entry shows the release version, such as `0.1.45` or `0.1.45a`. |
|
||||
| Install a hotfix over its base version | Setup updates the app. |
|
||||
| Remove RuneStone through Windows Settings | The app and shortcuts are removed. The separate workspace stays. |
|
||||
| Remove RuneStone through Windows Settings | The app, the shortcuts, and the downloaded browser engine are removed. The separate workspace stays. |
|
||||
|
||||
Silent downgrade attempt, in PowerShell on the test account:
|
||||
|
||||
@@ -165,12 +172,43 @@ Silent downgrade attempt, in PowerShell on the test account:
|
||||
5. Run the same command with `-ArgumentList '/P'`. Setup shows a message, then stops with exit code `2`.
|
||||
6. Restore the registry value: set `RuneStoneWindowsVersion` to the `windowsVersion` value in `host.json`.
|
||||
|
||||
## Build the browser engine
|
||||
|
||||
`pnpm build:browser-engine` packages the browser engine for 64-bit Windows (x64) as a ZIP. Then it pins that ZIP in `src-tauri/browser-engine.json`. Each later host build downloads the pinned engine on first use.
|
||||
Build and publish the engine before the installer that pins it. An installer needs a new engine only when the engine changes.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- Windows x64. The script stops on other systems, because no other platform has a published engine yet.
|
||||
- `npm ci --prefix browser-runtime`, then `pnpm browser:check` and `pnpm browser:test`. See [Built-in browser runtime](development.md#built-in-browser-runtime).
|
||||
- The public folder URL of the engine release. See [Publish a browser engine](releases.md#publish-a-browser-engine).
|
||||
|
||||
Procedure, in the RuneStone repository root:
|
||||
|
||||
1. Select the engine version with the [version policy](releases.md#versions). The engine version is in `browser-runtime/package.json`.
|
||||
2. Run `pnpm build:browser-engine --release-url <folder URL> --version <version> --dry-run`. Make sure that the plan shows the correct version and URL. A dry run changes no file.
|
||||
3. Run `pnpm build:browser-engine --release-url <folder URL> --version <version>`.
|
||||
4. Publish the ZIP. See [Publish a browser engine](releases.md#publish-a-browser-engine).
|
||||
|
||||
Output:
|
||||
|
||||
| File | Contents |
|
||||
| --- | --- |
|
||||
| `releases/browser-engine/<version>/RuneStone-Browser_<version>_win32-x64.zip` | The engine files at the archive root, in name order, with a fixed time stamp |
|
||||
| `releases/browser-engine/<version>/engine.json` | The version, the protocol, the platform key, the file name, the URL, the size in bytes, and the SHA-256 hash |
|
||||
| `src-tauri/browser-engine.json` | The pin: the engine version, the protocol, and the URL, size, and SHA-256 for `windows-x86_64` |
|
||||
|
||||
The script prints `Engine available: <path>`, the size, the hash, and the upload URL when it completes.
|
||||
The script writes the new version to `browser-runtime/package.json` and `package-lock.json` before it packages the engine, because the engine reports that version. If a step fails, the script restores these files and the pin. The backups are in `output/browser-engine-build/<version>/<time>/`.
|
||||
The script reads `PROTOCOL` in `src-tauri/src/browser_engine.rs` and the protocol of the `ready` event in `browser-runtime/src/engine-main.mjs`. It stops if they differ.
|
||||
|
||||
Example, with Electron 44.5.1 from `browser-runtime/package.json`: the engine files are 377 MB, and the ZIP is about 160 MB.
|
||||
|
||||
## Build Linux packages
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- The [Linux development prerequisites](linux.md) on the processor architecture of the package.
|
||||
- A Linux Browser runtime for that architecture, staged in `src-tauri/browser-engine`.
|
||||
- The new version in all RuneStone version fields. No Linux script sets or restores them. See [Versions](releases.md#versions).
|
||||
|
||||
Procedure, in the RuneStone repository root. The commands use the Tauri CLI from `package.json` and the bundle settings in `src-tauri/tauri.linux.conf.json`.
|
||||
@@ -194,6 +232,7 @@ If the build fails, restore the previous version fields.
|
||||
Example, from the 0.1.44 download link in the README: the x86_64 Debian build of version `0.1.44` is `RuneStone_0.1.44_amd64.deb`.
|
||||
|
||||
`pnpm build:installer` does not build Linux packages. It stops on operating systems other than Windows.
|
||||
Linux packages do not include the browser engine, and no Linux engine is published yet. The browser tab says that no engine is available for the platform.
|
||||
No Linux script encodes hotfix versions, and Tauri rejects a letter suffix in `tauri.conf.json`. Report this blocker before a Linux hotfix build.
|
||||
|
||||
The Debian package depends on `libc6 (>= 2.39)`, as set in `tauri.linux.conf.json`.
|
||||
@@ -217,7 +256,7 @@ For an example record, see the [Linux 0.1.44 validation](archive/linux-validatio
|
||||
|
||||
macOS packages are experimental. RuneStone has no validated macOS release procedure.
|
||||
|
||||
Prerequisites: a Mac, the source setup, and a Browser runtime packaged and staged on that Mac.
|
||||
Prerequisites: a Mac and the source setup.
|
||||
|
||||
In the RuneStone repository root, run:
|
||||
|
||||
@@ -227,9 +266,8 @@ pnpm tauri build --bundles app -- --locked
|
||||
|
||||
Tauri puts the application bundle in `src-tauri/target/release/bundle/macos/`. No script sets the version fields on macOS.
|
||||
|
||||
Example, from the [macOS 0.1.44 record](archive/macos-validation-0.1.44.md): the 0.1.44 DMG used manual steps after this build.
|
||||
Those steps replaced the bundled Browser resources with a copy that keeps the Electron framework symbolic links.
|
||||
Then they applied ad hoc signatures and created the DMG.
|
||||
macOS packages do not include the browser engine, and no macOS engine is published yet.
|
||||
The [macOS 0.1.44 record](archive/macos-validation-0.1.44.md) describes the ad hoc signatures and the DMG steps of that release.
|
||||
|
||||
Developer ID signing, notarization, Intel builds, and desktop acceptance tests are not done for macOS.
|
||||
See [Tauri's macOS application bundle guide](https://v2.tauri.app/distribute/macos-application-bundle/).
|
||||
|
||||
Reference in New Issue
Block a user