summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-08-21 10:04:26 +0800
committerOpportunityLiu <[email protected]>2019-08-21 10:04:26 +0800
commitdde0c9c001ddb75d463be78562e00463a8058cb5 (patch)
tree1c36fcb9b32e967cee94e0b8bb3430459293cb6d /scripts
parentc4dbeb54523b8773c030fd23e227fcc28c84f778 (diff)
fix nev
Diffstat (limited to 'scripts')
-rw-r--r--scripts/installer.nsi14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/installer.nsi b/scripts/installer.nsi
index 1b139447e..2a843d9cf 100644
--- a/scripts/installer.nsi
+++ b/scripts/installer.nsi
@@ -285,9 +285,19 @@ Section "Add to PATH" InstallPath
!macroend
${If} $NOADMIN == "false"
- !insertmacro AddRegPATH ${HKLM}
+ ; 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
+ WriteRegExpandStr ${HKLM} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1;$InstDir"
${Else}
- !insertmacro AddRegPATH ${HKCU}
+ ; Remove the installation path from the $PATH environment variable first
+ ReadRegStr $R0 ${HKCU} "Environment" "Path"
+ ${WordReplace} $R0 ";$InstDir" "" "+" $R1
+
+ ; Write the installation path into the $PATH environment variable
+ WriteRegExpandStr ${HKCU} "Environment" "Path" "$R1;$InstDir"
${EndIf}
SectionEnd