summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-08-21 10:09:11 +0800
committerOpportunityLiu <[email protected]>2019-08-21 10:09:11 +0800
commitc6786f85771ce5eed276c8dbf6831d5944c6b1c9 (patch)
treee54e946524a2e06f4e4a54a9102e22480d4ded96 /scripts
parentdde0c9c001ddb75d463be78562e00463a8058cb5 (diff)
fix #540
Diffstat (limited to 'scripts')
-rw-r--r--scripts/installer.nsi34
1 files changed, 12 insertions, 22 deletions
diff --git a/scripts/installer.nsi b/scripts/installer.nsi
index 2a843d9cf..b3723a3ca 100644
--- a/scripts/installer.nsi
+++ b/scripts/installer.nsi
@@ -275,15 +275,6 @@ SectionEnd
Section "Add to PATH" InstallPath
- !macro AddRegPATH RootKey
- ; Remove the installation path from the $PATH environment variable first
- ReadRegStr $R0 ${RootKey} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
- ${WordReplace} $R0 ";$InstDir" "" "+" $R1
-
- ; Write the installation path into the $PATH environment variable
- WriteRegExpandStr ${RootKey} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1;$InstDir"
- !macroend
-
${If} $NOADMIN == "false"
; Remove the installation path from the $PATH environment variable first
ReadRegStr $R0 ${HKLM} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
@@ -333,23 +324,22 @@ FunctionEnd
Section "Uninstall"
- !macro RemoveReg RootKey
- ; Remove registry keys
- DeleteRegKey ${RootKey} ${RegUninstall}
-
- ; Remove the installation path from the $PATH environment variable
- ReadRegStr $R0 ${RootKey} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
- ${WordReplace} $R0 ";$InstDir" "" "+" $R1
- ; MessageBox MB_OK|MB_USERICON '$R0 - $InstDir - $R1 '
- WriteRegExpandStr ${RootKey} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1"
- !macroend
-
; Remove directories used
RMDir /r "$InstDir"
+
+ ; Clean reg
${If} $NOADMIN == "false"
- !insertmacro RemoveReg ${HKLM}
+ DeleteRegKey ${HKLM} ${RegUninstall}
+ ; Remove the installation path from the $PATH environment variable
+ ReadRegStr $R0 ${HKLM} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
+ ${WordReplace} $R0 ";$InstDir" "" "+" $R1
+ WriteRegExpandStr ${HKLM} "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1"
${Else}
- !insertmacro RemoveReg ${HKCU}
+ DeleteRegKey ${HKCU} ${RegUninstall}
+ ; Remove the installation path from the $PATH environment variable
+ ReadRegStr $R0 ${HKCU} "Environment" "Path"
+ ${WordReplace} $R0 ";$InstDir" "" "+" $R1
+ WriteRegExpandStr ${HKCU} "Environment" "Path" "$R1"
${EndIf}
SectionEnd