Skip to content

Commit

Permalink
Only remove items from PATH on uninstall, not upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie committed Jan 5, 2025
1 parent e46ba9a commit 1be24bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions resources/win/installer.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1be24bb

Please sign in to comment.