From ee189a1bde171d64b6ba3edf4a1fcd03985a55dd Mon Sep 17 00:00:00 2001 From: paisley <8197966+su8su@users.noreply.github.com> Date: Wed, 4 Mar 2026 15:14:01 +0800 Subject: [PATCH] fix: override NSIS process check and replace taskkill to prevent black window flashes --- scripts/installer.nsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/installer.nsh b/scripts/installer.nsh index 261fd5032..c437afc66 100644 --- a/scripts/installer.nsh +++ b/scripts/installer.nsh @@ -3,6 +3,19 @@ ; Install: enables long paths, adds resources\cli to user PATH for openclaw CLI. ; Uninstall: removes the PATH entry and optionally deletes user data. +; When customCheckAppRunning is defined, electron-builder skips its conditional +; !include for getProcessInfo.nsh and the "Var pid" declaration. We must do +; both ourselves so ${GetProcessInfo} and $pid are available. +!ifndef getProcessInfo_included + !define getProcessInfo_included + !include "getProcessInfo.nsh" + Var pid +!endif +!ifndef nsProcess_included + !define nsProcess_included + !include "nsProcess.nsh" +!endif + !macro customCheckAppRunning ${GetProcessInfo} 0 $pid $1 $2 $3 $4 ${if} $3 != "${APP_EXECUTABLE_FILENAME}"