summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-02-27 10:56:11 +0800
committerruki <[email protected]>2017-02-27 10:56:11 +0800
commit44943aea9e4b82f09a35ebd999b2a4f866254df5 (patch)
tree81f20f68a65f816017895252af9209ac86305915
parent92c6f33e0d4a9c4e657f2f30ef277795062e2fc4 (diff)
remove repeat path for windows installer
-rw-r--r--installer.nsi7
1 files changed, 5 insertions, 2 deletions
diff --git a/installer.nsi b/installer.nsi
index b9f0fda78..f9579ac8c 100644
--- a/installer.nsi
+++ b/installer.nsi
@@ -85,9 +85,12 @@ Section "xmake (required)" Installer
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xmake" "NoRepair" 1
WriteUninstaller "uninstall.exe"
+ ; Remove the installation path from the $PATH environment variable first
+ ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
+ ${WordReplace} $R0 ";$INSTDIR" "" "+" $R1
+
; Write the installation path into the $PATH environment variable
- ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
- WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$0;$INSTDIR"
+ WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1;$INSTDIR"
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment"
SectionEnd