aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/nsis
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2008-11-01 00:24:10 +0000
committerGerald Combs <gerald@wireshark.org>2008-11-01 00:24:10 +0000
commitb113a389f0d3fc5c14b0bd29194ef2b6e215a276 (patch)
treec5643b36ceb9194e1869c5ffb3c80d54330f0771 /packaging/nsis
parent8ddc5acb3cddaf33f699975b8e668bf0afbe480f (diff)
Trying to call ExecWait on the Wireshark unistaller won't work, since it
returns immediately. Copy the uninstaller to $TEMP, then run it with flags which make it work as expected. Fix up the old version removal dialog. svn path=/trunk/; revision=26664
Diffstat (limited to 'packaging/nsis')
-rw-r--r--packaging/nsis/wireshark.nsi37
1 files changed, 27 insertions, 10 deletions
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi
index 14b2a1f1fe..f0ca65d725 100644
--- a/packaging/nsis/wireshark.nsi
+++ b/packaging/nsis/wireshark.nsi
@@ -262,30 +262,47 @@ un.unlink.end:
FunctionEnd
Var OLD_UNINSTALLER
+Var OLD_INSTDIR
Var OLD_DISPLAYNAME
+Var TMP_UNINSTALLER
Function .onInit
; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
ReadRegStr $OLD_UNINSTALLER HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
- "UninstallString"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
+ "UninstallString"
StrCmp $OLD_UNINSTALLER "" done
+ ReadRegStr $OLD_INSTDIR HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
+ "Path"
+ StrCmp $OLD_INSTDIR "" done
+
ReadRegStr $OLD_DISPLAYNAME HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
- "DisplayName"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
+ "DisplayName"
StrCmp $OLD_DISPLAYNAME "" done
- MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
- "$OLD_DISPLAYNAME is already installed. $\n$\nClick `OK` to remove it \
- or `Cancel` to cancel this upgrade." \
- IDOK uninst
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+ "$OLD_DISPLAYNAME is already installed.\
+ $\n$\nWould you like to uninstall it first?" \
+ IDYES uninst \
+ IDNO done
Abort
-;Run the uninstaller
+; Copy the uninstaller to $TEMP and run it.
+; The uninstaller normally does this by itself, but doesn't wait around
+; for the executable to finish, which means ExecWait won't work correctly.
uninst:
ClearErrors
- ExecWait $OLD_UNINSTALLER
+ StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
+ ; ...because we surround UninstallString in quotes.
+ StrCpy $0 $OLD_UNINSTALLER -1 1
+ StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
+ StrCpy $2 1
+ System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
+ ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
+ Delete "$TMP_UNINSTALLER"
done:
;Extract InstallOptions INI files