Give the front end its version through the build environment

vite.config.js reads RUNESTONE_VERSION and falls back to package.json.
The installer build sets RUNESTONE_VERSION and writes all four version
files only after the installer exists. Before, it wrote package.json
before the build and restored it after a failure.

The installation guide and CLAUDE.md now say that setup replaces the
installed app in place. The installer no longer shows a maintenance page.
This commit is contained in:
Knotty Wyvern
2026-10-27 22:59:22 -07:00
parent 7914942698
commit 70510a114f
8 changed files with 37 additions and 24 deletions
+7 -7
View File
@@ -50,17 +50,17 @@ Source: `scripts/buildInstaller.mjs`.
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.
It also writes the configuration override `tauri.version.json` to that folder. The override sets the toolchain version, for example `{"version": "0.1.23+1"}`.
5. Writes the new version to `package.json`. The front-end build reads this version for the Settings dialog.
6. Runs `tauri build --no-bundle --config <override> -- --locked`. This runs `pnpm build` and compiles the release app.
5. Runs `tauri build --no-bundle --config <override> -- --locked` with `RUNESTONE_VERSION` set to the release version. This runs `pnpm build` and compiles the release app.
`vite.config.js` gives `RUNESTONE_VERSION` to the front end for the Settings dialog. Without it, the front end uses the version in `package.json`.
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`.
7. 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.
8. Runs `tauri bundle --bundles nsis --config <override>`. Tauri uses its stock NSIS template with the [installer hooks](#installer-hooks).
9. Moves the setup file into `releases/<version>/`, writes `host.json`, and removes the bundle-folder copy.
10. Writes the new version to `tauri.conf.json`, `Cargo.toml`, and `Cargo.lock`.
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.
9. Writes the new version to `package.json`, `tauri.conf.json`, `Cargo.toml`, and `Cargo.lock`.
### Failure and rollback
If a step fails, or you press Ctrl+C, the script restores `package.json`. The other version files change only in step 10. If step 10 fails, the script restores them too.
The version files change only in step 9. If a step fails, or you press Ctrl+C, the version files keep the previous version. If step 9 fails, the script restores them.
It moves partial setup files and `host.json` into the folder of that attempt with a `.failed-<timestamp>` suffix.
If the process is killed before this cleanup, copy the `*.before` files of the attempt back to their original names.
+1 -1
View File
@@ -26,7 +26,7 @@ Each release file includes the app and its built-in browser. You do not need Nod
3. Open the installer for the same or a newer version.
4. Complete setup.
You do not need to uninstall first. Setup selects reinstall by default, also for the same version.
You do not need to uninstall first. Setup replaces the installed app in place, also for the same version.
Setup keeps your workspace files and settings. It does not install an older version over a newer one.
## Install on macOS