From bfcd2dd35ac258a43ab9a1b1327e6cf6b4c57927 Mon Sep 17 00:00:00 2001 From: salman Date: Sun, 25 Oct 2026 18:35:43 +0100 Subject: [PATCH] Add confirmed offline runtime installation in Electron Add Linux Preferences actions to check the active tools and install a trusted runtime-download bundle into private user storage. Verify size, archive checksum, extraction paths, disk space, core fingerprints, architecture, and tool startup before selecting the new binaries. Support progress, cancellation, immutable reuse and repair, and keep Fit/Plot disabled during installation. Select the matching ROOT environment only for explicitly configured private runtimes; preserve host installations, startup XML settings, and Windows WSL behavior. Pin the tar extractor, add installer and renderer regression coverage, document the offline workflow, and record existing unrelated dependency advisories for later review. Verified through a real Electron Preferences installation followed by a private-runtime fit. --- CHANGELOG.md | 6 + TODO.md | 5 + ZGUI.css | 11 ++ docs/DESKTOP_DEPLOYMENT.md | 7 +- index.html | 8 + local-runtime.js | 258 +++++++++++++++++++++++++ main.js | 60 ++++++ muSRFitelec.js | 127 +++++++++++- package-lock.json | 113 ++++++++++- package.json | 6 +- packaging/runtime/README.md | 32 ++- preload.js | 18 ++ tests/electron-bundled-runtime.test.js | 66 +++++++ tests/local-runtime.test.js | 153 +++++++++++++++ tests/release-packaging.test.js | 2 + 15 files changed, 864 insertions(+), 8 deletions(-) create mode 100644 local-runtime.js create mode 100644 tests/local-runtime.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index bca49a5..45bb95e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,12 @@ release path documented in [`TODO.md`](TODO.md). selection and actual RUN/ADDRUN entries in the MSR. ### Bundled ROOT + musrfit runtime +- Linux Preferences now offers **Check tools** and confirmed offline runtime + installation from `runtime-download.json`. Installs verify the archive and + extracted tools in a private user directory, support cancellation, and retain + existing system/user installations. A successful **Install and use** selects + the private tools and their matching ROOT environment; merely installing + files does not override host tool selection. Windows WSL behavior is unchanged. - Linux release commands now produce a standalone `.tar.gz` runtime download, SHA-256 sidecar, and versioned JSON download descriptor. The builder validates a private snapshot and publishes complete, content-addressed bundles under diff --git a/TODO.md b/TODO.md index d82adbb..44695d9 100644 --- a/TODO.md +++ b/TODO.md @@ -447,6 +447,11 @@ These defense-in-depth tasks are intentionally deferred until after the stable `1.0.0` workflow release. Pre-1.0 changes should remain focused on reliable fit, plot, editor, synchronization, and result-collection behavior. +- [ ] Review the existing Electron/undici advisories reported by `npm audit` and + test dependency upgrades separately from runtime-installation workflow + changes. The new archive extractor is pinned; unrelated upgrades were not + applied during the offline installer work. + - [ ] Validate shared-configuration links against a strict schema before they mutate GUI state. Restrict control and parameter identifiers, value types, model names, constraint sizes, and detector-map definitions. diff --git a/ZGUI.css b/ZGUI.css index 6fc9e13..5b67181 100644 --- a/ZGUI.css +++ b/ZGUI.css @@ -2397,6 +2397,17 @@ button:not(.tablinks):not(.action-btn):not(.editor-source-tab):not(.status-state width: 100%; } +.runtime-setup-actions { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +#localRuntimeStatus { + white-space: pre-line; + overflow-wrap: anywhere; +} + .preferences-hint { display: block; color: var(--mu-green-muted); diff --git a/docs/DESKTOP_DEPLOYMENT.md b/docs/DESKTOP_DEPLOYMENT.md index 6eaf3fc..fb2cf96 100644 --- a/docs/DESKTOP_DEPLOYMENT.md +++ b/docs/DESKTOP_DEPLOYMENT.md @@ -125,8 +125,11 @@ The plain runtime download can also be checked with its SHA-256 sidecar and extracted into a fresh user-writable directory, without administrator access or FUSE. Set `MUSRFLOW_RUNTIME_ROOT` to the extracted `runtime/` directory. See the [runtime packaging guide](../packaging/runtime/README.md#download-archive) for -the archive layout and descriptor format. Optional in-app download/installation -will build on this format; the application does not download runtimes yet. +the archive layout and descriptor format. On Linux, **File -> Preferences -> +Install runtime...** installs a downloaded bundle after confirmation and selects +its verified tools. **Check tools** tests the saved tool selection. In-app online +downloads and missing-tool startup prompts will follow separately; no runtime +is downloaded automatically. ## Configuration link scheme diff --git a/index.html b/index.html index 318e46e..2e025e7 100644 --- a/index.html +++ b/index.html @@ -767,6 +767,14 @@ pairs of a multi-run (global) fit."> Directory holding musrfit, musrview, msr2data and dump_header +