Files
TRIMSP/package.json
salman 5110ea4827 Build the Windows installer with electron-builder (NSIS)
The Squirrel path (electron-forge maker-squirrel -> electron-winstaller)
required Wine and Mono, plus a 64-bit Wine prefix, to cross-build on Linux.
electron-builder's NSIS target uses its own native tooling, so the same
cross-build now needs no Wine and no Mono, matching how muSRFlow is packaged.

- package.json: add an electron-builder 'build' block (win/nsis, extraResources
  for the engine and the flat rootfs, files allow-list, nsis options) and point
  package:win/make:win at 'electron-builder --win nsis'; drop maker-squirrel.
- packaging/wsl2/require-rootfs.js: fail the Windows build when the rootfs is
  missing (electron-builder has no config-time abort hook).
- forge.config.js: drop the Squirrel maker and the Windows rootfs guard; forge
  now builds Linux/macOS only.
- README/CHANGELOG: document the NSIS build and that no Wine/Mono is needed.

Verified locally: TRIMSP-NL-Workbench-Setup.exe (NSIS, 186 MB) builds with no
Wine/Mono; resources/bin/trimspNL and resources/trimspNL-runtime-rootfs.tar.gz
land where wsl-runtime.js looks; guard fails on a missing rootfs.
2026-10-20 13:35:17 +02:00

101 lines
3.6 KiB
JSON

{
"name": "TrimSP",
"version": "1.6.2",
"description": "TRIMSP-NL Workbench for low-energy muon and ion implantation simulations.",
"main": "main.js",
"scripts": {
"build:fortran": "make -C fortran trimspNL-static && cp fortran/trimspNL-static resources/bin/trimspNL",
"build:fortran:dynamic": "make -C fortran trimspNL && cp fortran/trimspNL resources/bin/trimspNL",
"build:fortran:static": "npm run build:fortran",
"start": "electron-forge start --",
"prepackage": "npm run build:fortran",
"package": "electron-forge package",
"premake": "npm run build:fortran",
"make": "electron-forge make",
"make:dynamic": "npm run build:fortran:dynamic && electron-forge make",
"make:flatpak": "npm run build:fortran && FORGE_FLATPAK=1 electron-forge make --targets=@electron-forge/maker-flatpak",
"build:wsl2": "bash packaging/wsl2/build-wsl2.sh",
"test:wsl-runtime": "node tests/wsl-runtime.test.js && node tests/runtime-gate.test.js",
"package:win": "npm run build:fortran && npm run build:wsl2 && node packaging/wsl2/require-rootfs.js && electron-builder --win nsis --x64 --dir",
"make:win": "npm run build:fortran && npm run build:wsl2 && node packaging/wsl2/require-rootfs.js && electron-builder --win nsis --x64",
"checksums:md5": "sh -c 'for d in out/make/deb/x64 out/make/rpm/x64 out/make/flatpak/x86_64; do [ -d \"$d\" ] || continue; for f in \"$d\"/*; do [ -f \"$f\" ] || continue; case \"$f\" in *.deb|*.rpm|*.flatpak) base=$(basename \"$f\"); (cd \"$d\" && md5sum \"$base\" > \"$base.md5\");; esac; done; done'",
"checksums:sha256": "sh -c 'for d in out/make/deb/x64 out/make/rpm/x64 out/make/flatpak/x86_64; do [ -d \"$d\" ] || continue; for f in \"$d\"/*; do [ -f \"$f\" ] || continue; case \"$f\" in *.deb|*.rpm|*.flatpak) base=$(basename \"$f\"); (cd \"$d\" && sha256sum \"$base\" > \"$base.sha256\");; esac; done; done'",
"checksums": "npm run checksums:md5 && npm run checksums:sha256"
},
"keywords": [
"TRIM",
"TRIM.SP",
"Monte Carlo",
"muon",
"ion implantation",
"multilayer"
],
"author": "Zaher Salman",
"license": "GPL-3.0-or-later",
"devDependencies": {
"@electron-forge/cli": "7.11.2",
"@electron-forge/maker-deb": "7.11.2",
"@electron-forge/maker-flatpak": "7.11.2",
"@electron-forge/maker-rpm": "7.11.2",
"@electron-forge/maker-zip": "7.11.2",
"electron": "44.9.0",
"electron-builder": "26.15.3"
},
"dependencies": {
"plotly.js-dist": "^1.58.4"
},
"config": {},
"homepage": "http://musruser.psi.ch/TRIMSP-NL/",
"repository": {
"type": "git",
"url": "https://gitea.psi.ch/LMU/TRIMSP.git"
},
"build": {
"appId": "ch.psi.lem.trimsp",
"productName": "TRIMSP-NL Workbench",
"artifactName": "TRIMSP-NL-Workbench-Setup.${ext}",
"asar": true,
"directories": {
"output": "dist"
},
"files": [
"main.js",
"wsl-runtime.js",
"TrimSP.html",
"quick-start.html",
"ZGUI.css",
"plotly.css",
"TrimSPweb.js",
"TrimSPelec.js",
"TrimSPlib.js",
"myplots.js",
"appicons/**/*",
"node_modules/**/*"
],
"win": {
"target": [
"nsis"
],
"icon": "icon.ico",
"extraResources": [
{
"from": "resources/bin",
"to": "bin"
},
{
"from": "packaging/wsl2/out",
"to": ".",
"filter": [
"trimspNL-runtime-rootfs.tar.gz"
]
}
]
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true
}
}
}