Repository navigation
Windows installer for Cortex Desktop - #35
Conversation
npm run desktop:installer wraps release/Cortex-win32-x64 (from desktop:package) with electron-builder --prepackaged into release/Cortex-Setup-<version>.exe. Per-user NSIS, choose the folder, Start menu and desktop shortcuts, app data kept on uninstall.
A21-devs
left a comment
There was a problem hiding this comment.
Built it from this branch and listed the payload: the packaged folder goes in as-is, runner included. Two things the build log points at.
| # Wraps the folder from `npm run desktop:package` (release/Cortex-win32-x64) in a Windows installer: | ||
| # release/Cortex-Setup-<version>.exe. Used by `npm run desktop:installer`, which passes --prepackaged, | ||
| # so electron-builder doesn't repackage the app itself. Not signed yet. | ||
| appId: io.github.a21devs.cortex |
There was a problem hiding this comment.
electron-builder logs author is missed in the package.json. NSIS uses that as the publisher, so Settings > Apps shows Cortex with a blank Publisher, which looks a lot like malware next to a SmartScreen warning. Add "author": "A21-devs" to package.json (it doesn't affect the plugin build, manifest.json is separate).
| "desktop:build": "node scripts/build-desktop.mjs", | ||
| "desktop:shot": "node scripts/desktop-shot.mjs", | ||
| "desktop:package": "node scripts/package-desktop.mjs", | ||
| "desktop:installer": "node scripts/package-desktop.mjs && electron-builder --win nsis --prepackaged release/Cortex-win32-x64 --publish never", |
There was a problem hiding this comment.
desktop:package already runs buildDesktop(), so this is a full rebuild every time, fine. But electron-builder resolves the version from package.json (0.1.0) while the packaged app reports 0.1.0+<build stamp>. Not wrong, just worth knowing the installer name and the About box differ by the stamp on local builds. No change needed.
|
Added |
A21-devs
left a comment
There was a problem hiding this comment.
Second pass: author is set and a rebuild with electron-builder no longer warns about it. The second note needed no change. Fixed.
Closes #34
What
electron-builder26.18.0 (exact pin, like the other dev dependencies) andelectron-builder.yml: NSIS, x64, per-user, folder choice, Start menu + desktop shortcuts, Cortex icon for the installer and uninstaller,deleteAppDataOnUninstall: falsenpm run desktop:installer: runsdesktop:package, thenelectron-builder --prepackaged release/Cortex-win32-x64, so the app folder is exactly what the zip ships (unpacked, no asar, the runner starts from it)desktop:packageand attachesCortex-Setup-<tag>.exenext to the zips. Release notes list it firstTesting
npm run check: 2801 passed, 1 skipped, build oknpm run desktop:installerlocally:release/Cortex-Setup-0.1.0.exe, 116 MBCortex.exe,resources\app\main.js,resources\app\cortex-runner.jsand the rest of the packaged folder are inside (87 files)