Skip to content

Commit

Permalink
Merge pull request #2672 from jamescowens/fix_windows_installer_detec…
Browse files Browse the repository at this point in the history
…t_running_gridcoin

install: Enhance windows installer - detect running gridcoinresearch(d).exe and ask to close before continuing
  • Loading branch information
jamescowens authored Apr 2, 2023
2 parents 2121748 + 888e23f commit d9541af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions share/setup.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ Function .onInit
Abort
${EndIf}
!endif
loop:
ExpandEnvStrings $1 "%COMSPEC%"
ExecWait '$1 /C "$\"$SYSDIR\tasklist.exe$\" /NH /FI $\"IMAGENAME eq @GRIDCOIN_GUI_NAME@@EXEEXT@$\" | $\"$SYSDIR\find.exe$\" /I $\"@GRIDCOIN_GUI_NAME@@EXEEXT@$\""' $0
StrCmp $0 0 0 notRunning_gui
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'The Gridcoin wallet (@GRIDCOIN_GUI_NAME@@EXEEXT@) is running. Please close before continuing.' IDOK loop IDCANCEL end
notRunning_gui:
ExecWait '$1 /C "$\"$SYSDIR\tasklist.exe$\" /NH /FI $\"IMAGENAME eq @GRIDCOIN_DAEMON_NAME@@EXEEXT@$\" | $\"$SYSDIR\find.exe$\" /I $\"@GRIDCOIN_DAEMON_NAME@@EXEEXT@$\""' $0
StrCmp $0 0 0 notRunning_daemon
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'The Gridcoin wallet daemon (@GRIDCOIN_DAEMON_NAME@@EXEEXT@) is running. Please close before continuing.' IDOK loop IDCANCEL end
notRunning_daemon:
; Check for HKCU Path registry and prompt for uninstallation if found
ReadRegStr $0 HKCU "${REGKEY}" "Path"
${IfThen} $0 == "" ${|} Return ${|}
Expand All @@ -184,6 +194,8 @@ Function .onInit
${EndIf}
ExecWait "$1 _?=$0" $0
${IfThen} $0 != 0 ${|} Abort ${|}
end:
Abort
FunctionEnd

# Uninstaller functions
Expand Down

0 comments on commit d9541af

Please sign in to comment.