aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-client/build/installer.nsh
blob: cf8e5ff7862588cfbb7bef568ba0f8db58d0340c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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