From 1be24bb619a7058730d993b8a49a70f5c5b6b372 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 4 Jan 2025 21:02:53 -0800 Subject: [PATCH] Only remove items from PATH on uninstall, not upgrade --- resources/win/installer.nsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/win/installer.nsh b/resources/win/installer.nsh index effd4b4b2d..7313e8c1d7 100644 --- a/resources/win/installer.nsh +++ b/resources/win/installer.nsh @@ -10,8 +10,13 @@ XPStyle on !macro customUnInstall ; Macro called by electron-builder ; Since adding the PATH occurs during installation, we want to ensure to remove it. ; Luckily 'EnvVarUpdate' handles the case of it not being present - ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\resources" - ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\resources\app\ppm\bin" + ${ifNot} ${isUpdated} + ; Only run uninstall steps if truly uninstalling. Prevents this step from + ; running during an upgrade, where it technically runs after the upgrade's + ; install steps, ultimately removing Pulsar from the PATH + ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\resources" + ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\resources\app\ppm\bin" + ${endIf} !macroend !macro MUI_PAGE_ADD_TO_PATH ; Define our custom macro