Skip to content

Commit 2ba59cb

Browse files
committed
prevent uninstall emptying PATH
1 parent 9bba6b2 commit 2ba59cb

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

nsis/INIfiles/devkitProUpdate.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[devkitProUpdate]
2-
Build=55
2+
Build=56
33
URL=http://downloads.devkitpro.org
4-
Filename=devkitProUpdater-3.0.2.exe
4+
Filename=devkitProUpdater-3.0.3.exe
55

66
[msys2]
77
Version=2.10.0

nsis/devkitPro.nsi

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on
1515

1616
; HM NIS Edit Wizard helper defines
1717
!define PRODUCT_NAME "devkitProUpdater"
18-
!define PRODUCT_VERSION "3.0.2"
18+
!define PRODUCT_VERSION "3.0.3"
1919
!define PRODUCT_PUBLISHER "devkitPro"
2020
!define PRODUCT_WEB_SITE "http://www.devkitpro.org"
2121
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
2222
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
2323
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
24-
!define BUILD "55"
24+
!define BUILD "56"
2525

2626
SetCompressor /SOLID lzma
2727

@@ -358,9 +358,17 @@ Section Uninstall
358358
ReadRegStr $1 HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "PATH"
359359
${UnStrRep} $1 $1 "$INSTDIR\msys\bin;" ""
360360
${UnStrRep} $1 $1 "$INSTDIR\msys2\usr\bin;" ""
361+
362+
StrCmp $1 "" 0 ResetPath
363+
364+
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Trying to set path to blank string!$\nPlease reset path manually"
365+
goto BlankedPath
366+
367+
ResetPath:
361368
WriteRegExpandStr HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "PATH" $1
362369
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
363370

371+
BlankedPath:
364372
DeleteRegKey HKCR ".pnproj"
365373
DeleteRegKey HKCR "PN2.pnproj.1\shell\open\command"
366374
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
@@ -670,7 +678,7 @@ FunctionEnd
670678

671679

672680
;-----------------------------------------------------------------------------------------------------------------------
673-
; Check for a newer version of the installer, download and ask the user if he wants to run it
681+
; Check for a newer version of the installer, download and ask the user if they want to run it
674682
;-----------------------------------------------------------------------------------------------------------------------
675683
Function UpgradedevkitProUpdate
676684
;-----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)