summaryrefslogtreecommitdiff
path: root/misc/nsis
diff options
context:
space:
mode:
authorbitraid <bitraid@protonmail.ch>2019-01-17 19:44:37 +0200
committerbitraid <bitraid@protonmail.ch>2019-01-17 19:46:05 +0200
commit052d07d371e95fd1e9199d320e7f54dfc9bf88e0 (patch)
tree6027705c71acbc4ffcd214a6235c7e5768fc6b10 /misc/nsis
parent756bd2111177c6146b52b6a2ef1941bcd32c1c47 (diff)
downloadqutebrowser-052d07d371e95fd1e9199d320e7f54dfc9bf88e0.tar.gz
qutebrowser-052d07d371e95fd1e9199d320e7f54dfc9bf88e0.zip
Delete leftover reg key after elevation
Diffstat (limited to 'misc/nsis')
-rwxr-xr-xmisc/nsis/install.nsh15
1 files changed, 12 insertions, 3 deletions
diff --git a/misc/nsis/install.nsh b/misc/nsis/install.nsh
index cf9b7f169..fc763474b 100755
--- a/misc/nsis/install.nsh
+++ b/misc/nsis/install.nsh
@@ -128,8 +128,7 @@ var KeepReg
; Remove the quotes from path in $R0
System::Call 'Shlwapi::PathUnquoteSpaces(t r10r10)'
IfFileExists $R0 +3 0
- ; Delete the registry key if the uninstaller is missing.
- DeleteRegKey HKLM "${REG_UN}\${PRODUCT_NAME}"
+ ; Return 0 if the uninstaller is missing.
StrCpy $R0 ""
${endif}
${endif}
@@ -262,9 +261,19 @@ Section "Core Files (required)" SectionCoreFiles
${endif}
${endif}
- ; Remove the old uninstaller if it's leftover
+ ; Remove any leftovers from the old NSIS installer
IfFileExists "$INSTDIR\uninst.exe" 0 +2
Delete "$INSTDIR\uninst.exe"
+ ${if} $MultiUser.InstallMode == "AllUsers"
+ SetRegView 32 ; The old NSIS installer writes to 32-bit registry space
+ ReadRegStr $R0 HKLM "${REG_UN}\${PRODUCT_NAME}" "QuietUninstallString"
+ ${if} $R0 != ""
+ DeleteRegKey HKLM "${REG_UN}\${PRODUCT_NAME}"
+ ${endif}
+ ${if} ${RunningX64}
+ SetRegView 64
+ ${endif}
+ ${endif}
SetOutPath $INSTDIR
; Write uninstaller and registry uninstall info as the first step,