Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions build/installer.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; Picked up by electron-builder as `<buildResources>/installer.nsh` (the NSIS `include` option).

; A silent update of a per-machine install (`/S`, see installsSilently in electron/auto-updater.ts)
; asks for UAC in the install section, by which time the app has already quit. Declining it
; (error 1223) makes electron-builder's installer.nsi just Quit, so OpenScreen stays closed (#1461).
; Elevate here instead, as the stock section would, and bring the app back if that fails. The
; downloaded update stays cached, so the user can retry it.
!macro customInit
${if} ${Silent}
${andIf} $hasPerMachineInstallation == "1"
${andIfNot} ${UAC_IsAdmin}
!insertmacro UAC_RunElevated
${if} $0 != 0
${andIf} ${isForceRun}
ExecShell "open" "$perMachineInstallationFolder\${APP_EXECUTABLE_FILENAME}"
${endIf}
Quit
${endIf}
!macroend
Loading