summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-client
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-client')
-rw-r--r--packages/meshbay-client/build/icon.icobin0 -> 117250 bytes
-rw-r--r--packages/meshbay-client/build/installer.nsh24
-rw-r--r--packages/meshbay-client/package.json27
-rw-r--r--packages/meshbay-client/src/main.js10
4 files changed, 58 insertions, 3 deletions
diff --git a/packages/meshbay-client/build/icon.ico b/packages/meshbay-client/build/icon.ico
new file mode 100644
index 0000000..2766f24
--- /dev/null
+++ b/packages/meshbay-client/build/icon.ico
Binary files differ
diff --git a/packages/meshbay-client/build/installer.nsh b/packages/meshbay-client/build/installer.nsh
new file mode 100644
index 0000000..cf8e5ff
--- /dev/null
+++ b/packages/meshbay-client/build/installer.nsh
@@ -0,0 +1,24 @@
+; electron-builder NSIS customisation (auto-included: build/installer.nsh).
+;
+; Per-user install, no elevation (package.json build.nsis). These macros only
+; deal with the one piece of state that lives outside the install directory:
+; the W3 "run at sign-in" launcher the node's own CLI can create.
+;
+; Deliberately NOT touched here:
+; - %LOCALAPPDATA%\meshbay\ (node.toml, keystore.enc, unlock.key, data/) --
+; the keystore must survive an uninstall/reinstall; installers place files,
+; never remove secrets.
+
+!macro customInstall
+ ; resources\node-runtime\meshbay-node.exe is overwritten by this install; a
+ ; daemon still running from a previous version holds the file open.
+ nsExec::Exec 'taskkill /IM meshbay-node.exe /F'
+!macroend
+
+!macro customUnInstall
+ nsExec::Exec 'taskkill /IM meshbay-node.exe /F'
+ ; meshbay_node.platform._startup_vbs() -- if the user ran "meshbay-node
+ ; autostart install" (or toggled it in the client), this points wscript at
+ ; the binary we are about to delete, and would error at every sign-in.
+ Delete "$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\MeshBay Node.vbs"
+!macroend
diff --git a/packages/meshbay-client/package.json b/packages/meshbay-client/package.json
index 42af9c5..57acff8 100644
--- a/packages/meshbay-client/package.json
+++ b/packages/meshbay-client/package.json
@@ -10,7 +10,8 @@
"scripts": {
"start": "electron .",
"sync-ui": "node scripts/sync-ui.js",
- "dist": "bash ../../packaging/build/build-client.sh"
+ "dist": "bash ../../packaging/build/build-client.sh",
+ "dist:win": "powershell -NoProfile -ExecutionPolicy Bypass -File ../../packaging/win/build-win.ps1"
},
"devDependencies": {
"electron": "^44.1.1",
@@ -22,7 +23,29 @@
"files": [
"src/**",
"ui/**"
- ]
+ ],
+ "win": {
+ "target": "nsis",
+ "icon": "build/icon.ico",
+ "artifactName": "${productName}-Setup-${version}.${ext}",
+ "extraResources": [
+ {
+ "from": "node-runtime",
+ "to": "node-runtime",
+ "filter": ["**/*"]
+ }
+ ]
+ },
+ "nsis": {
+ "oneClick": false,
+ "perMachine": false,
+ "allowElevation": false,
+ "allowToChangeInstallationDirectory": true,
+ "createDesktopShortcut": true,
+ "createStartMenuShortcut": true,
+ "deleteAppDataOnUninstall": false,
+ "runAfterFinish": true
+ }
},
"dependencies": {
"bonjour-service": "^1.4.4",
diff --git a/packages/meshbay-client/src/main.js b/packages/meshbay-client/src/main.js
index d341619..bd82342 100644
--- a/packages/meshbay-client/src/main.js
+++ b/packages/meshbay-client/src/main.js
@@ -792,7 +792,15 @@ function registerBridge() {
});
function findNodeBinary() {
- if (process.platform !== 'win32') {
+ if (process.platform === 'win32') {
+ // A packaged Windows build carries the frozen daemon as an
+ // extraResource (package.json build.win, packaging/win/). Prefer it —
+ // it is the version that shipped with this client.
+ if (app.isPackaged) {
+ const bundled = path.join(process.resourcesPath, 'node-runtime', 'meshbay-node.exe');
+ if (fs.existsSync(bundled)) return bundled;
+ }
+ } else {
const local = path.join(os.homedir(), '.local', 'bin', 'meshbay-node');
if (fs.existsSync(local)) return local;
}