from Lars Roland: fix NSIS uninstallation

svn path=/trunk/; revision=9971
This commit is contained in:
Ulf Lamping 2004-02-03 20:03:40 +00:00
parent 41cd2385c3
commit 97172d52a0
2 changed files with 37 additions and 18 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: Makefile.nmake,v 1.34 2004/01/26 21:12:41 ulfl Exp $
# $Id: Makefile.nmake,v 1.35 2004/02/03 20:03:40 ulfl Exp $
#
# NSIS is a free packager/installer/uninstaller program for Win32.
# It was originally written for the Winamp package, but various
@ -9,7 +9,15 @@
include ../../config.nmake
EXE=../../ethereal.exe ../../tethereal.exe ../../editcap.exe \
!IFDEF GTK1
DEST=ethereal
GTK_DIR=$(GTK1_DIR)
!ELSE
DEST=ethereal2
GTK_DIR=$(GTK2_DIR)
!ENDIF
EXE=../../$(DEST).exe ../../tethereal.exe ../../editcap.exe \
../../text2pcap.exe ../../mergecap.exe
DLL=../../wiretap/wiretap-$(WTAP_VERSION).dll
DOC=../../doc/ethereal.html \
@ -49,16 +57,6 @@ PLUGINS=../../plugins/acn/acn.dll \
DELIVERABLES=$(EXE) $(DLL) $(DOC) $(GPL) $(HELP) $(PLUGINS)
!IFDEF GTK1
DEST=ethereal
GTK_DIR=$(GTK1_DIR)
!ELSE
DEST=ethereal2
GTK_DIR=$(GTK2_DIR)
!ENDIF
$(DEST)-setup-$(VERSION).exe : ethereal.nsi $(DELIVERABLES) Makefile.nmake
$(MAKENSIS) \
!IF "$(MAKENSIS_MODERN_UI)" != ""
@ -88,6 +86,7 @@ $(DEST)-setup-$(VERSION).exe : ethereal.nsi $(DELIVERABLES) Makefile.nmake
clean:
rm -f ethereal-setup-$(VERSION).exe
rm -f ethereal2-setup-$(VERSION).exe
distclean: clean

View File

@ -1,7 +1,7 @@
;
; ethereal.nsi
;
; $Id: ethereal.nsi,v 1.42 2004/02/03 01:06:21 ulfl Exp $
; $Id: ethereal.nsi,v 1.43 2004/02/03 20:03:39 ulfl Exp $
!ifdef MAKENSIS_MODERN_UI
@ -275,7 +275,7 @@ CreateDirectory "$SMPROGRAMS\Ethereal"
Delete "$SMPROGRAMS\Ethereal\Ethereal Web Site.lnk"
WriteINIStr "$SMPROGRAMS\Ethereal\Ethereal Web Site.url" \
"InternetShortcut" "URL" "http://www.ethereal.com/"
CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal.lnk" "$INSTDIR\ethereal.exe"
CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal.lnk" "$INSTDIR\${DEST}.exe"
CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Manual.lnk" "$INSTDIR\ethereal.html"
CreateShortCut "$SMPROGRAMS\Ethereal\Display Filters Manual.lnk" "$INSTDIR\ethereal-filter.html"
CreateShortCut "$SMPROGRAMS\Ethereal\Uninstall.lnk" "$INSTDIR\uninstall.exe"
@ -285,20 +285,32 @@ SectionEnd
Section "Desktop Icon" SecDesktopIcon
;-------------------------------------------
CreateShortCut "$DESKTOP\Ethereal.lnk" "$INSTDIR\Ethereal.exe"
CreateShortCut "$DESKTOP\Ethereal.lnk" "$INSTDIR\${DEST}.exe"
SectionEnd
Section "Uninstall"
;-------------------------------------------
DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal"
DeleteRegKey HKEY_LOCAL_MACHINE SOFTWARE\Ethereal
;
; UnInstall for every user
;
SetShellVarContext all
Delete "$INSTDIR\tethereal.exe"
IfErrors 0 NoTetherealErrorMsg
MessageBox MB_OK "Note: Tethereal could not be removed! Probably in use!" IDOK 0 ;skipped if tethereal.exe removed
Abort "Note: tethereal.exe could not be removed! Probably in use! Abort unistall!"
NoTetherealErrorMsg:
Delete "$INSTDIR\${DEST}.exe"
IfErrors 0 NoEtherealErrorMsg
MessageBox MB_OK "Note: Ethereal could not be removed! Probably in use!" IDOK 0 ;skipped if ethereal.exe removed
Abort "Note: ${DEST}.exe could not be removed! Probably in use! Abort uninstall!"
NoEtherealErrorMsg:
DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal"
DeleteRegKey HKEY_LOCAL_MACHINE SOFTWARE\Ethereal
!ifdef GTK2
Delete "$INSTDIR\etc\gtk-2.0\*.*"
Delete "$INSTDIR\etc\pango\*.*"
@ -338,6 +350,14 @@ RMDir "$INSTDIR\snmp\mibs"
RMDir "$INSTDIR\snmp"
RMDir "$INSTDIR"
IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
MessageBox MB_OK "Note: $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist
NoFinalErrorMsg:
IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
MessageBox MB_OK "Note: $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist
NoFinalErrorMsg:
SectionEnd