Skip to content

Commit

Permalink
prevent uninstall emptying PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterMute committed Jun 3, 2018
1 parent 9bba6b2 commit 2ba59cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions nsis/INIfiles/devkitProUpdate.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[devkitProUpdate]
Build=55
Build=56
URL=http://downloads.devkitpro.org
Filename=devkitProUpdater-3.0.2.exe
Filename=devkitProUpdater-3.0.3.exe

[msys2]
Version=2.10.0
Expand Down
14 changes: 11 additions & 3 deletions nsis/devkitPro.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "devkitProUpdater"
!define PRODUCT_VERSION "3.0.2"
!define PRODUCT_VERSION "3.0.3"
!define PRODUCT_PUBLISHER "devkitPro"
!define PRODUCT_WEB_SITE "http://www.devkitpro.org"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
!define BUILD "55"
!define BUILD "56"

SetCompressor /SOLID lzma

Expand Down Expand Up @@ -358,9 +358,17 @@ Section Uninstall
ReadRegStr $1 HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "PATH"
${UnStrRep} $1 $1 "$INSTDIR\msys\bin;" ""
${UnStrRep} $1 $1 "$INSTDIR\msys2\usr\bin;" ""

StrCmp $1 "" 0 ResetPath

MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Trying to set path to blank string!$\nPlease reset path manually"
goto BlankedPath

ResetPath:
WriteRegExpandStr HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "PATH" $1
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

BlankedPath:
DeleteRegKey HKCR ".pnproj"
DeleteRegKey HKCR "PN2.pnproj.1\shell\open\command"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
Expand Down Expand Up @@ -670,7 +678,7 @@ FunctionEnd


;-----------------------------------------------------------------------------------------------------------------------
; Check for a newer version of the installer, download and ask the user if he wants to run it
; Check for a newer version of the installer, download and ask the user if they want to run it
;-----------------------------------------------------------------------------------------------------------------------
Function UpgradedevkitProUpdate
;-----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 2ba59cb

Please # to comment.