summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-07-23 20:34:43 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-07-23 20:34:43 +0000
commitdda9beb85c59ddc5d07be5a66dcecde7795626c3 (patch)
tree28a2f2d10c2ca09305f7c8eece850521e60fa036 /packaging
parent30a855786822f15108e3a9d4dbd5579cd656abba (diff)
downloadwireshark-dda9beb85c59ddc5d07be5a66dcecde7795626c3.tar.gz
Installer:
- Installer now includes and installs WinPcap 3.0 (with detection) - Install Sections are grouped now - New Seperate page to select additional tasks like: icons, file extensions ... - New Seperate page for WinPcap detection/installation - Start WinPcap "NPF" service doesn't require a reboot Uninstaller: - New Uninstall sections page (uninstall, settings, plugins, WinPcap) - If uninstallation selected, plugins will now be completely uninstalled (all versions, not only the current one) - If selected, uninstallation of WinPcap svn path=/trunk/; revision=15016
Diffstat (limited to 'packaging')
-rw-r--r--packaging/nsis/AdditionalTasksPage.ini65
-rw-r--r--packaging/nsis/Makefile.am4
-rw-r--r--packaging/nsis/Makefile.nmake10
-rw-r--r--packaging/nsis/WinPcapPage.ini79
-rw-r--r--packaging/nsis/WinPcap_3_0.exebin0 -> 440557 bytes
-rw-r--r--packaging/nsis/ethereal.nsi415
-rw-r--r--packaging/nsis/servicelib.nsh344
7 files changed, 793 insertions, 124 deletions
diff --git a/packaging/nsis/AdditionalTasksPage.ini b/packaging/nsis/AdditionalTasksPage.ini
new file mode 100644
index 0000000000..c920ec09f1
--- /dev/null
+++ b/packaging/nsis/AdditionalTasksPage.ini
@@ -0,0 +1,65 @@
+[Settings]
+NumFields=7
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=45
+Text=Ethereal Shortcuts
+State=1
+
+[Field 2]
+Type=CheckBox
+Left=10
+Right=-1
+Top=10
+Bottom=18
+Text=Start Menu Group
+State=1
+
+[Field 3]
+Type=CheckBox
+Left=10
+Right=-1
+Top=20
+Bottom=28
+Text=Desktop Icon
+State=1
+
+[Field 4]
+Type=CheckBox
+Left=10
+Right=-1
+Top=30
+Bottom=38
+Text=Quick Launch Icon
+State=1
+
+[Field 5]
+Type=GroupBox
+Left=0
+Right=-1
+Top=50
+Bottom=85
+Text=File Extensions
+State=1
+
+[Field 6]
+Type=CheckBox
+Left=10
+Right=-1
+Top=60
+Bottom=68
+Text=Associate trace file extensions to Ethereal (5vw, acp, apc, atc, bfr,
+State=1
+
+[Field 7]
+Type=Label
+Left=20
+Right=280
+Top=70
+Bottom=78
+Text=cap, enc, erf, fdc, pcap, pkt, snoop, syc, tpc, tr1, trace, trc, wpc, wpz)
+
diff --git a/packaging/nsis/Makefile.am b/packaging/nsis/Makefile.am
index 73637ea6f1..ec69028721 100644
--- a/packaging/nsis/Makefile.am
+++ b/packaging/nsis/Makefile.am
@@ -5,4 +5,8 @@ EXTRA_DIST = \
ethereal.nsi \
../../COPYING \
GetWindowsVersion.nsh \
+ servicelib.nsh \
+ AdditionalTasksPage.ini \
+ WinPcapPage.ini \
+ WinPcap_3_0.exe \
Makefile.nmake
diff --git a/packaging/nsis/Makefile.nmake b/packaging/nsis/Makefile.nmake
index f008688657..16a068221f 100644
--- a/packaging/nsis/Makefile.nmake
+++ b/packaging/nsis/Makefile.nmake
@@ -42,7 +42,7 @@ EXE=../../tethereal.exe ../../editcap.exe \
!IFDEF GTK2_DIR
../../ethereal-gtk2.exe \
!ENDIF
- ../../text2pcap.exe ../../mergecap.exe ../../capinfos.exe
+ ../../text2pcap.exe ../../mergecap.exe ../../capinfos.exe WinPcap_3_0.exe
DLL=../../wiretap/wiretap-$(WTAP_VERSION).dll
DOC=../../doc/ethereal.html \
../../doc/tethereal.html \
@@ -89,6 +89,12 @@ PLUGINS=../../plugins/acn/acn.dll \
../../plugins/v5ua/v5ua.dll \
../../plugins/xml/xml.dll
+NSI=ethereal.nsi \
+ GetWindowsVersion.nsh \
+ servicelib.nsh \
+ AdditionalTasksPage.ini \
+ WinPcapPage.ini
+
DELIVERABLES=$(EXE) $(DLL) $(DOC) $(DOC_dos) $(GPL) $(HELP) $(PLUGINS)
all: NEWS.txt $(DEST)-setup-$(VERSION).exe
@@ -96,7 +102,7 @@ all: NEWS.txt $(DEST)-setup-$(VERSION).exe
NEWS.txt: ../../NEWS
$(UNIX2DOS) < ../../NEWS > NEWS.txt
-$(DEST)-setup-$(VERSION).exe : ethereal.nsi $(DELIVERABLES) Makefile.nmake
+$(DEST)-setup-$(VERSION).exe : $(NSI) $(DELIVERABLES) Makefile.nmake
$(MAKENSIS) \
/DDEST=$(DEST) \
!IF "$(MAKENSIS_MODERN_UI)" != ""
diff --git a/packaging/nsis/WinPcapPage.ini b/packaging/nsis/WinPcapPage.ini
new file mode 100644
index 0000000000..576a2daf74
--- /dev/null
+++ b/packaging/nsis/WinPcapPage.ini
@@ -0,0 +1,79 @@
+[Settings]
+NumFields=9
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=25
+Text=Currently installed WinPcap version
+
+[Field 2]
+Type=Label
+Left=10
+Right=250
+Top=10
+Bottom=18
+Text=This text will be replaced with current WinPcap installer version
+
+[Field 3]
+Type=GroupBox
+Left=0
+Right=-1
+Top=30
+Bottom=65
+Text=Install
+
+[Field 4]
+Type=CheckBox
+Left=10
+Right=250
+Top=40
+Bottom=48
+Text=This text will be replaced, depending on current WinPcap version in ethereal.nsi
+State=1
+
+[Field 5]
+Type=Label
+Left=20
+Right=290
+Top=50
+Bottom=58
+Text=This text will be replaced, depending if WinPcap is already installed
+
+[Field 6]
+Type=Button
+Left=0
+Right=150
+Top=120
+Bottom=135
+Text=WinPcap info at the Ethereal Wiki
+State=http://wiki.ethereal.com/WinPcap
+
+[Field 7]
+Type=GroupBox
+Left=0
+Right=-1
+Top=70
+Bottom=105
+Text=Services
+State=1
+
+[Field 8]
+Type=CheckBox
+Left=10
+Right=250
+Top=80
+Bottom=88
+Text=Start Winpcap service "NPF" at startup
+State=0
+
+[Field 9]
+Type=Label
+Left=20
+Right=250
+Top=90
+Bottom=98
+Text=(so users with restricted privileges can capture)
+
diff --git a/packaging/nsis/WinPcap_3_0.exe b/packaging/nsis/WinPcap_3_0.exe
new file mode 100644
index 0000000000..df2259f4fe
--- /dev/null
+++ b/packaging/nsis/WinPcap_3_0.exe
Binary files differ
diff --git a/packaging/nsis/ethereal.nsi b/packaging/nsis/ethereal.nsi
index 268909e993..97e1219229 100644
--- a/packaging/nsis/ethereal.nsi
+++ b/packaging/nsis/ethereal.nsi
@@ -6,7 +6,8 @@
!ifdef MAKENSIS_MODERN_UI
; Set the compression mechanism first
-SetCompressor lzma
+; as of NSIS 2.07, solid compression is no longer default, so set the /SOLID switch (saves ~1MB)
+;SetCompressor /SOLID lzma
!endif
!ifdef GTK1_DIR & GTK2_DIR
@@ -14,6 +15,9 @@ InstType "Ethereal (GTK2 user interface)"
InstType "Ethereal (legacy GTK1 user interface)"
!endif
+InstType "un.Default (keep Personal Settings and WinPcap)"
+InstType "un.All (remove all)"
+
; Used to refresh the display of file association
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
@@ -21,7 +25,6 @@ InstType "Ethereal (legacy GTK1 user interface)"
; Used to add associations between file extensions and Ethereal
!define ETHEREAL_ASSOC "ethereal-file"
-
; ============================================================================
; Header configuration
; ============================================================================
@@ -55,6 +58,7 @@ XPStyle on
; If you are using a different version, it's not predictable what will happen.
!include "MUI.nsh"
+;!addplugindir ".\Plugins"
!define MUI_ICON "..\..\image\ethereal.ico"
!define MUI_UNICON "..\..\image\ethereal.ico"
@@ -63,8 +67,8 @@ XPStyle on
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Ethereal.\r\n\r\nBefore starting the installation, make sure Ethereal is not running.\r\n\r\nClick 'Next' to continue."
-!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
-!define MUI_FINISHPAGE_LINK_LOCATION "http://winpcap.polito.it"
+;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
+;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
; NSIS shows Readme files by opening the Readme file with the default application for
; the file's extension. "README.win32" won't work in most cases, because extension "win32"
@@ -73,6 +77,10 @@ XPStyle on
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+!define MUI_FINISHPAGE_RUN "$INSTDIR\ethereal.exe"
+!define MUI_FINISHPAGE_RUN_NOTCHECKED
+
+
!define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
@@ -83,12 +91,15 @@ XPStyle on
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
!insertmacro MUI_PAGE_COMPONENTS
+Page custom DisplayAdditionalTasksPage
!insertmacro MUI_PAGE_DIRECTORY
+Page custom DisplayWinPcapPage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
@@ -101,6 +112,17 @@ XPStyle on
!endif ; MAKENSIS_MODERN_UI
; ============================================================================
+; Reserve Files
+; ============================================================================
+
+ ;Things that need to be extracted on first (keep these lines before any File command!)
+ ;Only useful for BZIP2 compression
+
+ ReserveFile "AdditionalTasksPage.ini"
+ ReserveFile "WinPcapPage.ini"
+ !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+
+; ============================================================================
; Section macros
; ============================================================================
!include "Sections.nsh"
@@ -131,6 +153,11 @@ XPStyle on
!macroend
; ============================================================================
+; Services
+; ============================================================================
+!include "servicelib.nsh"
+
+; ============================================================================
; License page configuration
; ============================================================================
LicenseText "Ethereal is distributed under the GNU General Public License."
@@ -163,6 +190,7 @@ InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Ethereal "InstallDir"
; Install page configuration
; ============================================================================
ShowInstDetails show
+ShowUninstDetails show
; ============================================================================
; Functions and macros
@@ -225,10 +253,29 @@ un.unlink.end:
pop $R1
FunctionEnd
+Function .onInit
+ ;Extract InstallOptions INI files
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
+FunctionEnd
+
+Function DisplayAdditionalTasksPage
+ !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
+FunctionEnd
+
+Function DisplayWinPcapPage
+ !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
+FunctionEnd
+
; ============================================================================
; Installation execution commands
; ============================================================================
+Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
+;Var ETHEREAL_UNINSTALL ;declare variable for holding the value of a registry key
+
Section "-Required"
;-------------------------------------------
@@ -240,6 +287,8 @@ SectionIn 1 2 RO
!endif
SetShellVarContext all
+
+
SetOutPath $INSTDIR
File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
!ifdef ENABLE_LIBETHEREAL
@@ -391,9 +440,114 @@ WriteUninstaller "uninstall.exe"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe" "" '$INSTDIR\ethereal.exe'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe" "Path" '$INSTDIR'
-SectionEnd
+; Create start menu entries (depending on additional tasks page)
+ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
+StrCmp $0 "0" SecRequired_skip_StartMenu
+SetOutPath $PROFILE
+CreateDirectory "$SMPROGRAMS\Ethereal"
+; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
+; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
+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" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
+;CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Manual.lnk" "$INSTDIR\ethereal.html"
+;CreateShortCut "$SMPROGRAMS\Ethereal\Display Filters Manual.lnk" "$INSTDIR\ethereal-filter.html"
+CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Program Directory.lnk" \
+ "$INSTDIR"
+;CreateShortCut "$SMPROGRAMS\Ethereal\Uninstall Ethereal.lnk" "$INSTDIR\uninstall.exe"
+SecRequired_skip_StartMenu:
+
+
+; Create desktop icon (depending on additional tasks page)
+ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
+StrCmp $0 "0" SecRequired_skip_DesktopIcon
+CreateShortCut "$DESKTOP\Ethereal.lnk" "$INSTDIR\ethereal.exe" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
+SecRequired_skip_DesktopIcon:
-SectionGroup "Ethereal"
+; Create quick launch icon (depending on additional tasks page)
+ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
+StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
+CreateShortCut "$QUICKLAUNCH\Ethereal.lnk" "$INSTDIR\ethereal.exe" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
+SecRequired_skip_QuickLaunchIcon:
+
+; Create File Extensions (depending on additional tasks page)
+ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
+StrCmp $0 "0" SecRequired_skip_FileExtensions
+WriteRegStr HKCR ${ETHEREAL_ASSOC} "" "Ethereal file"
+WriteRegStr HKCR "${ETHEREAL_ASSOC}\Shell\open\command" "" '"$INSTDIR\ethereal.exe" "%1"'
+WriteRegStr HKCR "${ETHEREAL_ASSOC}\DefaultIcon" "" '"$INSTDIR\ethereal.exe",0'
+push $R0
+ StrCpy $R0 ".5vw"
+ Call Associate
+ StrCpy $R0 ".acp"
+ Call Associate
+ StrCpy $R0 ".apc"
+ Call Associate
+ StrCpy $R0 ".atc"
+ Call Associate
+ StrCpy $R0 ".bfr"
+ Call Associate
+ StrCpy $R0 ".cap"
+ Call Associate
+ StrCpy $R0 ".enc"
+ Call Associate
+ StrCpy $R0 ".erf"
+ Call Associate
+ StrCpy $R0 ".fdc"
+ Call Associate
+ StrCpy $R0 ".pcap"
+ Call Associate
+ StrCpy $R0 ".pkt"
+ Call Associate
+ StrCpy $R0 ".snoop"
+ Call Associate
+ StrCpy $R0 ".syc"
+ Call Associate
+ StrCpy $R0 ".tpc"
+ Call Associate
+ StrCpy $R0 ".tr1"
+ Call Associate
+ StrCpy $R0 ".trace"
+ Call Associate
+ StrCpy $R0 ".trc"
+ Call Associate
+ StrCpy $R0 ".wpc"
+ Call Associate
+ StrCpy $R0 ".wpz"
+ Call Associate
+; if somethings added here, add it also to the uninstall section and the AdditionalTask page
+pop $R0
+!insertmacro UpdateIcons
+SecRequired_skip_FileExtensions:
+
+; Install WinPcap (depending on winpcap page setting)
+ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
+StrCmp $0 "0" SecRequired_skip_Winpcap
+; Uinstall old WinPcap first
+ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
+IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
+ExecWait '$WINPCAP_UNINSTALL' $0
+DetailPrint "WinPcap uninstaller returned $0"
+lbl_winpcap_notinstalled:
+SetOutPath $INSTDIR
+File "WinPcap_3_0.exe"
+ExecWait '"$INSTDIR\WinPcap_3_0.exe"' $0
+DetailPrint "WinPcap installer returned $0"
+SecRequired_skip_Winpcap:
+
+; Load Winpcap NPF service at startup (depending on additional tasks page)
+ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
+StrCmp $0 "0" SecRequired_skip_WinpcapService
+WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
+; we have to tell the installer, we need a reboot!
+;SetRebootFlag true
+!insertmacro SERVICE "start" "NPF" ""
+SecRequired_skip_WinpcapService:
+
+SectionEnd ; "Required"
+
+
+SectionGroup "!Ethereal" SecEtherealGroup
!ifdef GTK1_DIR
Section "Ethereal GTK1" SecEtherealGTK1
@@ -459,7 +613,7 @@ File "..\..\tethereal.exe"
File "..\..\doc\tethereal.html"
SectionEnd
-SectionGroup "Plugins / Extensions"
+SectionGroup "Plugins / Extensions" SecPluginsGroup
Section "Dissector Plugins" SecPlugins
;-------------------------------------------
@@ -521,7 +675,7 @@ SectionEnd
SectionGroupEnd ; "Plugins / Extensions"
-SectionGroup "Tools"
+SectionGroup "Tools" SecToolsGroup
Section "Editcap" SecEditcap
;-------------------------------------------
@@ -566,102 +720,13 @@ SectionEnd
SectionGroupEnd ; "Tools"
-SectionGroup "Icons / Shortcuts"
-
-; SectionDivider
-;-------------------------------------------
-
-Section "Start Menu Shortcuts" SecShortcuts
-;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
-SetOutPath $PROFILE
-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" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
-CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Manual.lnk" "$INSTDIR\ethereal.html"
-CreateShortCut "$SMPROGRAMS\Ethereal\Display Filters Manual.lnk" "$INSTDIR\ethereal-filter.html"
-CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Program Directory.lnk" \
- "$INSTDIR"
-CreateShortCut "$SMPROGRAMS\Ethereal\Uninstall Ethereal.lnk" "$INSTDIR\uninstall.exe"
-SectionEnd
-
-Section "Desktop Icon" SecDesktopIcon
-;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
-CreateShortCut "$DESKTOP\Ethereal.lnk" "$INSTDIR\ethereal.exe" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
-SectionEnd
-
-Section "Associate file extensions to Ethereal" SecFileExtensions
-;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
-WriteRegStr HKCR ${ETHEREAL_ASSOC} "" "Ethereal file"
-WriteRegStr HKCR "${ETHEREAL_ASSOC}\Shell\open\command" "" '"$INSTDIR\ethereal.exe" "%1"'
-WriteRegStr HKCR "${ETHEREAL_ASSOC}\DefaultIcon" "" '"$INSTDIR\ethereal.exe",0'
-push $R0
- StrCpy $R0 ".5vw"
- Call Associate
- StrCpy $R0 ".acp"
- Call Associate
- StrCpy $R0 ".apc"
- Call Associate
- StrCpy $R0 ".atc"
- Call Associate
- StrCpy $R0 ".bfr"
- Call Associate
- StrCpy $R0 ".cap"
- Call Associate
- StrCpy $R0 ".enc"
- Call Associate
- StrCpy $R0 ".erf"
- Call Associate
- StrCpy $R0 ".fdc"
- Call Associate
- StrCpy $R0 ".pcap"
- Call Associate
- StrCpy $R0 ".pkt"
- Call Associate
- StrCpy $R0 ".snoop"
- Call Associate
- StrCpy $R0 ".syc"
- Call Associate
- StrCpy $R0 ".tpc"
- Call Associate
- StrCpy $R0 ".tr1"
- Call Associate
- StrCpy $R0 ".trace"
- Call Associate
- StrCpy $R0 ".trc"
- Call Associate
- StrCpy $R0 ".wpc"
- Call Associate
- StrCpy $R0 ".wpz"
- Call Associate
-pop $R0
-!insertmacro UpdateIcons
-SectionEnd
-
-SectionGroupEnd ; "Icons / Shortcuts"
-
-Section "Load Winpcap NPF service at startup" SecNPFservice
-;-------------------------------------------
- WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
-SectionEnd
-
-Section "Uninstall"
+Section "Uninstall" un.SecUinstall
;-------------------------------------------
;
; UnInstall for every user
;
+SectionIn 1 2
SetShellVarContext all
Delete "$INSTDIR\tethereal.exe"
@@ -739,8 +804,6 @@ Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
Delete "$INSTDIR\help\*.*"
-Delete "$INSTDIR\plugins\${VERSION}\*.*"
-Delete "$INSTDIR\plugins\*.*"
Delete "$INSTDIR\diameter\*.*"
Delete "$INSTDIR\snmp\mibs\*.*"
Delete "$INSTDIR\snmp\*.*"
@@ -758,6 +821,7 @@ Delete "$INSTDIR\pcrepattern.3.txt"
Delete "$INSTDIR\radius\*.*"
Delete "$SMPROGRAMS\Ethereal\*.*"
Delete "$DESKTOP\Ethereal.lnk"
+Delete "$QUICKLAUNCH\Ethereal.lnk"
RMDir "$INSTDIR\etc\gtk-2.0"
RMDir "$INSTDIR\etc\pango"
@@ -783,48 +847,101 @@ RMDir "$INSTDIR\share\themes"
RMDir "$INSTDIR\share"
RMDir "$SMPROGRAMS\Ethereal"
RMDir "$INSTDIR\help"
-RMDir "$INSTDIR\plugins\${VERSION}"
-RMDir "$INSTDIR\plugins"
RMDir "$INSTDIR\diameter"
RMDir "$INSTDIR\snmp\mibs"
RMDir "$INSTDIR\snmp"
RMDir "$INSTDIR\radius"
RMDir "$INSTDIR"
+SectionEnd ; "Uinstall"
+
+Section "Un.Plugins" un.SecPlugins
+;-------------------------------------------
+SectionIn 1 2
+;Delete "$INSTDIR\plugins\${VERSION}\*.*"
+;Delete "$INSTDIR\plugins\*.*"
+;RMDir "$INSTDIR\plugins\${VERSION}"
+;RMDir "$INSTDIR\plugins"
+RMDir /r "$INSTDIR\plugins"
+SectionEnd
+
+Section "Un.Global Settings" un.SecGlobalSettings
+;-------------------------------------------
+SectionIn 1 2
+Delete "$INSTDIR\cfilters"
+Delete "$INSTDIR\colorfilters"
+Delete "$INSTDIR\dfilters"
+RMDir "$INSTDIR"
+SectionEnd
+
+Section /o "Un.Personal Settings" un.SecPersonalSettings
+;-------------------------------------------
+SectionIn 2
+SetShellVarContext current
+Delete "$APPDATA\Ethereal\*.*"
+RMDir "$APPDATA\Ethereal"
+SectionEnd
+
+;VAR un.WINPCAP_UNINSTALL
+
+Section /o "Un.WinPcap" un.SecWinPcap
+;-------------------------------------------
+SectionIn 2
+ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
+;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
+;MessageBox MB_OK "WinPcap $1"
+ExecWait '$1' $0
+DetailPrint "WinPcap uninstaller returned $0"
+;SetRebootFlag true
+;un.lbl_winpcap_notinstalled:
+SectionEnd
+
+Section "-Un.Finally"
+;-------------------------------------------
+SectionIn 1 2
+; this test must be done after all other things uninstalled (e.g. Global Settings)
IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
- MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist
+ MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
NoFinalErrorMsg:
-
SectionEnd
+
; ============================================================================
; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
; ============================================================================
!ifdef MAKENSIS_MODERN_UI
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGroup} "${PROGRAM_NAME} is a GUI network protocol analyzer."
!ifdef GTK1_DIR
- !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGTK1} "${PROGRAM_NAME} is a GUI network protocol analyzer."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGTK1} "${PROGRAM_NAME} using the classical GTK1 user interface."
!endif
!ifdef GTK2_DIR
- !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGTK2} "${PROGRAM_NAME} is a GUI network protocol analyzer (using the modern GTK2 GUI toolkit)."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGTK2} "${PROGRAM_NAME} using the modern GTK2 user interface."
!ifdef GTK_WIMP_DIR
- !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKWimp} "GTKWimp is the GTK2 windows impersonator (native Win32 look and feel, for Win2000 and up)."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKWimp} "GTK-Wimp is the GTK2 windows impersonator (native Win32 look and feel, for Win2000 and up)."
!endif
!endif
!insertmacro MUI_DESCRIPTION_TEXT ${SecTethereal} "Tethereal is a text based network protocol analyzer."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Editcap is a program that reads a capture file and writes some or all of the packets into another capture file."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Text2pcap is a program that reads in an ASCII hex dump and writes the data into a libpcap-style capture file."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Ethereal and Tethereal."
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
!insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
!insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
!insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Start menu shortcuts."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopIcon} "Ethereal desktop icon."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecFileExtensions} "Associate standard network trace files to ${PROGRAM_NAME}"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecNPFservice} "Start WinPcap's service at startup, so users with restricted privilegies can capture. Requires a reboot."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Editcap is a program that reads a capture file and writes some or all of the packets into another capture file."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Text2pcap is a program that reads in an ASCII hex dump and writes the data into a libpcap-style capture file."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Ethereal components."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Ethereal versions)."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
+ !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
+
!endif ; MAKENSIS_MODERN_UI
; ============================================================================
@@ -832,6 +949,7 @@ SectionEnd
; ============================================================================
!ifdef GTK1_DIR & GTK2_DIR
;Disable GTK-Wimp for GTK1
+
Function .onSelChange
Push $0
SectionGetFlags ${SecEtherealGTK1} $0
@@ -888,10 +1006,32 @@ FunctionEnd
!include "GetWindowsVersion.nsh"
+!include WinMessages.nsh
Var NPF_START ;declare variable for holding the value of a registry key
+Var WINPCAP_VERSION ;declare variable for holding the value of a registry key
Function myShowCallback
+
+; Uinstall old Ethereal first
+; XXX - doesn't work, but kept here for further experiments
+;ReadRegStr $ETHEREAL_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "UninstallString"
+;IfErrors lbl_ethereal_notinstalled ;if RegKey is unavailable, WinPcap is not installed
+;MessageBox MB_YESNO|MB_ICONQUESTION "Uninstall the old Ethereal version first (recommended)?"
+; Hide the installer while uninstalling
+;GetDlgItem $0 $HWNDPARENT 1
+;FindWindow $0 "#32770" "" $HWNDPARENT
+;MessageBox MB_OK "Window $0"
+;ShowWindow $0 ${SW_HIDE}
+;HideWindow
+;ExecWait '$ETHEREAL_UNINSTALL' $0
+;DetailPrint "WinPcap uninstaller returned $0"
+;GetDlgItem $0 $HWNDPARENT 1
+;ShowWindow $0 ${SW_SHOW}
+;MessageBox MB_OK "Uninstalled"
+;lbl_ethereal_notinstalled:
+
+
; Get the Windows version
Call GetWindowsVersion
Pop $R0 ; Windows Version
@@ -911,16 +1051,47 @@ lbl_select_wimp:
lbl_ignore_wimp:
!endif
- ;Disable Section SecNPFservice for Win OT and if Winpcap is not installed
+
+ ; detect if WinPcap should be installed
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 3.0"
+ ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
+ IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
+ Goto lbl_winpcap_done
+
+lbl_winpcap_installed:
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_VERSION"
+ ; starts the version string with "WinPcap 2."?
+ StrCpy $1 "$WINPCAP_VERSION" 10
+ StrCmp $1 "WinPcap 2." 0 lbl_winpcap_3+
+ ; WinPcap 2.x
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_VERSION will be uninstalled first."
+ Goto lbl_winpcap_done
+
+lbl_winpcap_3+:
+ ; WinPcap 3.x (or later)
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_VERSION will be uninstalled first."
+lbl_winpcap_done:
+
+ ;Disable NPF service setting for Win OT and if Winpcap is not installed
StrCmp $R0 '95' lbl_npf_disable
StrCmp $R0 '98' lbl_npf_disable
StrCmp $R0 'ME' lbl_npf_disable
ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
- IfErrors lbl_npf_disable ;RegKey not available, so do not set it
- IntCmp $NPF_START 3 lbl_done
+ IfErrors lbl_npf_done ;RegKey not available, so do not set it
+ IntCmp $NPF_START 2 0 lbl_npf_done
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
+ Goto lbl_npf_done
;disable
lbl_npf_disable:
- !insertmacro DisableSection ${SecNPFservice}
-
-lbl_done:
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
+lbl_npf_done:
+
+
FunctionEnd
diff --git a/packaging/nsis/servicelib.nsh b/packaging/nsis/servicelib.nsh
new file mode 100644
index 0000000000..2e68a572ca
--- /dev/null
+++ b/packaging/nsis/servicelib.nsh
@@ -0,0 +1,344 @@
+; from http://nsis.sourceforge.net/wiki/NSIS_Service_Lib
+; un. functions disabled to prevent a NSIS warning
+;
+; NSIS SERVICE LIBRARY - servicelib.nsh
+; Version 1.2 - 02/29/2004
+; Questions/Comments - dselkirk@hotmail.com
+;
+; Description:
+; Provides an interface to window services
+;
+; Inputs:
+; action - systemlib action ie. create, delete, start, stop, pause,
+; continue, installed, running, status
+; name - name of service to manipulate
+; param - action parameters; usage: var1=value1;var2=value2;...etc.
+;
+; Actions:
+; create - creates a new windows service
+; Parameters:
+; path - path to service executable
+; autostart - automatically start with system ie. 1|0
+; interact - interact with the desktop ie. 1|0
+; machine - machine name where to install service
+; user - user that runs the service
+; password - password of the above user
+;
+; delete - deletes a windows service
+; start - start a stopped windows service
+; stop - stops a running windows service
+; pause - pauses a running windows service
+; continue - continues a paused windows service
+; installed - is the provided service installed
+; Parameters:
+; action - if true then invokes the specified action
+; running - is the provided service running
+; Parameters:
+; action - if true then invokes the specified action
+; status - check the status of the provided service
+;
+; If run from uninstall define "UN" as "un." gefore running.
+;
+; Usage:
+; Method 1:
+; Push "action"
+; Push "name"
+; Push "param"
+; Call Service
+; Pop $0 ;response
+;
+; Method 2:
+; !insertmacro SERVICE "action" "name" "param"
+;
+; History:
+; 1.0 - 09/15/2003 - Initial release
+; 1.1 - 09/16/2003 - Changed &l to i, thx brainsucker
+; 1.2 - 02/29/2004 - Fixed documentation.
+
+!ifndef SERVICELIB
+ !define SERVICELIB
+
+ !define SC_MANAGER_ALL_ACCESS 0x3F
+ !define SERVICE_ALL_ACCESS 0xF01FF
+
+ !define SERVICE_CONTROL_STOP 1
+ !define SERVICE_CONTROL_PAUSE 2
+ !define SERVICE_CONTROL_CONTINUE 3
+
+ !define SERVICE_STOPPED 0x1
+ !define SERVICE_START_PENDING 0x2
+ !define SERVICE_STOP_PENDING 0x3
+ !define SERVICE_RUNNING 0x4
+ !define SERVICE_CONTINUE_PENDING 0x5
+ !define SERVICE_PAUSE_PENDING 0x6
+ !define SERVICE_PAUSED 0x7
+
+ !ifndef UN
+ !define UN ""
+ !endif
+
+ !macro SERVICE ACTION NAME PARAM
+ Push '${ACTION}'
+ Push '${NAME}'
+ Push '${PARAM}'
+ Call ${UN}Service
+ !macroend
+
+ !macro FUNC_GETPARAM
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Exch 8
+ Pop $1 ;name
+ Exch 8
+ Pop $2 ;source
+ StrCpy $0 ""
+ StrLen $7 $2
+ StrCpy $3 0
+ lbl_loop:
+ IntCmp $3 $7 0 0 lbl_done
+ StrLen $4 "$1="
+ StrCpy $5 $2 $4 $3
+ StrCmp $5 "$1=" 0 lbl_next
+ IntOp $5 $3 + $4
+ StrCpy $3 $5
+ lbl_loop2:
+ IntCmp $3 $7 0 0 lbl_done
+ StrCpy $6 $2 1 $3
+ StrCmp $6 ";" 0 lbl_next2
+ IntOp $6 $3 - $5
+ StrCpy $0 $2 $6 $5
+ Goto lbl_done
+ lbl_next2:
+ IntOp $3 $3 + 1
+ Goto lbl_loop2
+ lbl_next:
+ IntOp $3 $3 + 1
+ Goto lbl_loop
+ lbl_done:
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch 2
+ Pop $6
+ Pop $7
+ Exch $0
+ !macroend
+
+ !macro CALL_GETPARAM VAR NAME DEFAULT LABEL
+ Push $1
+ Push ${NAME}
+ Call ${UN}GETPARAM
+ Pop $6
+ StrCpy ${VAR} "${DEFAULT}"
+ StrCmp $6 "" "${LABEL}" 0
+ StrCpy ${VAR} $6
+ !macroend
+
+ !macro FUNC_SERVICE UN
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Exch 8
+ Pop $1 ;param
+ Exch 8
+ Pop $2 ;name
+ Exch 8
+ Pop $3 ;action
+ ;$0 return
+ ;$4 OpenSCManager
+ ;$5 OpenService
+
+
+ StrCpy $0 "false"
+ System::Call 'advapi32::OpenSCManagerA(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.r4'
+ IntCmp $4 0 lbl_done
+ StrCmp $3 "create" lbl_create
+ System::Call 'advapi32::OpenServiceA(i r4, t r2, i ${SERVICE_ALL_ACCESS}) i.r5'
+ IntCmp $5 0 lbl_done
+
+ lbl_select:
+ StrCmp $3 "delete" lbl_delete
+ StrCmp $3 "start" lbl_start
+ StrCmp $3 "stop" lbl_stop
+ StrCmp $3 "pause" lbl_pause
+ StrCmp $3 "continue" lbl_continue
+ StrCmp $3 "installed" lbl_installed
+ StrCmp $3 "running" lbl_running
+ StrCmp $3 "status" lbl_status
+ Goto lbl_done
+
+ ; create service
+ lbl_create:
+ Push $R1 ;machine
+ Push $R2 ;user
+ Push $R3 ;password
+ Push $R4 ;interact
+ Push $R5 ;autostart
+ Push $R6 ;path
+
+ !insertmacro CALL_GETPARAM $R1 "machine" "n" "lbl_machine"
+ lbl_machine:
+
+ !insertmacro CALL_GETPARAM $R2 "user" "n" "lbl_user"
+ lbl_user:
+
+ !insertmacro CALL_GETPARAM $R3 "password" "n" "lbl_password"
+ lbl_password:
+
+ !insertmacro CALL_GETPARAM $R4 "interact" "0x10" "lbl_interact"
+ StrCpy $6 0x10
+ IntCmp $R4 0 +2
+ IntOp $R4 $6 | 0x100
+ StrCpy $R4 $6
+ lbl_interact:
+
+ !insertmacro CALL_GETPARAM $R5 "autostart" "0x3" "lbl_autostart"
+ StrCpy $6 0x3
+ IntCmp $R5 0 +2
+ StrCpy $6 0x2
+ StrCpy $R5 $6
+ lbl_autostart:
+
+ !insertmacro CALL_GETPARAM $R6 "path" "n" "lbl_path"
+ lbl_path:
+
+ System::Call 'advapi32::CreateServiceA(i r4, t r2, t r2, i ${SERVICE_ALL_ACCESS}, i R4, i R5, i 0, t R6, n, n, R1, R2, R3) i.r6'
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; delete service
+ lbl_delete:
+ System::Call 'advapi32::DeleteService(i r5) i.r6'
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; start service
+ lbl_start:
+ System::Call 'advapi32::StartServiceA(i r5, i 0, i 0) i.r6'
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; stop service
+ lbl_stop:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_STOP}, i $R1) i'
+ System::Free $R1
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; pause service
+ lbl_pause:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_PAUSE}, i $R1) i'
+ System::Free $R1
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; continue service
+ lbl_continue:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_CONTINUE}, i $R1) i'
+ System::Free $R1
+ Pop $R1
+ StrCmp $6 0 lbl_done lbl_good
+
+ ; is installed
+ lbl_installed:
+ !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
+ StrCpy $3 $7
+ Goto lbl_select
+
+ ; is service running
+ lbl_running:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
+ System::Call '*$R1(i, i.r6)'
+ System::Free $R1
+ Pop $R1
+ IntFmt $6 "0x%X" $6
+ StrCmp $6 ${SERVICE_RUNNING} 0 lbl_done
+ !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
+ StrCpy $3 $7
+ Goto lbl_select
+
+ lbl_status:
+ Push $R1
+ System::Call '*(i,i,i,i,i,i,i) i.R1'
+ System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
+ System::Call '*$R1(i, i .r6)'
+ System::Free $R1
+ Pop $R1
+ IntFmt $6 "0x%X" $6
+ StrCpy $0 "running"
+ IntCmp $6 ${SERVICE_RUNNING} lbl_done
+ StrCpy $0 "stopped"
+ IntCmp $6 ${SERVICE_STOPPED} lbl_done
+ StrCpy $0 "start_pending"
+ IntCmp $6 ${SERVICE_START_PENDING} lbl_done
+ StrCpy $0 "stop_pending"
+ IntCmp $6 ${SERVICE_STOP_PENDING} lbl_done
+ StrCpy $0 "running"
+ IntCmp $6 ${SERVICE_RUNNING} lbl_done
+ StrCpy $0 "continue_pending"
+ IntCmp $6 ${SERVICE_CONTINUE_PENDING} lbl_done
+ StrCpy $0 "pause_pending"
+ IntCmp $6 ${SERVICE_PAUSE_PENDING} lbl_done
+ StrCpy $0 "paused"
+ IntCmp $6 ${SERVICE_PAUSED} lbl_done
+ StrCpy $0 "unknown"
+
+ lbl_good:
+ StrCpy $0 "true"
+ lbl_done:
+ IntCmp $5 0 +2
+ System::Call 'advapi32::CloseServiceHandle(i r5) n'
+ IntCmp $4 0 +2
+ System::Call 'advapi32::CloseServiceHandle(i r4) n'
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch 3
+ Pop $5
+ Pop $6
+ Pop $7
+ Exch $0
+ !macroend
+
+ Function Service
+ !insertmacro FUNC_SERVICE ""
+ FunctionEnd
+
+; Function un.Service
+; !insertmacro FUNC_SERVICE "un."
+; FunctionEnd
+
+ Function GetParam
+ !insertmacro FUNC_GETPARAM
+ FunctionEnd
+
+; Function un.GetParam
+; !insertmacro FUNC_GETPARAM
+; FunctionEnd
+
+!endif