You can simply start the Wireshark installer without any command line parameters, it will show you the usual interactive installer.
For special cases, there are some command line parameters available:
/NCRC disables the CRC check
/S runs the installer or uninstaller silently with default values. Please note: The silent installer won't install WinPCap!
/desktopicon installation of the desktop icon, =yes - force installation, =no - don't install, otherwise use defaults / user settings. This option can be useful for a silent installer.
/quicklaunchicon installation of the quick launch icon, =yes - force installation, =no - don't install, otherwise use defaults / user settings.
/D sets the default installation directory ($INSTDIR), overriding InstallDir and InstallDirRegKey. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces
"wireshark-win32-1.9.0.exe /NCRC /S /desktopicon=yes
/quicklaunchicon=no /D=C:\Program Files\Foo"
I've created 2 scripts, one for installation and one for removal.
==========Install===========
The script is created for Wireshark-win64-1.8.4.exe, but you can modify it for any version.
Install.vbs:
Option explicit
'=============================
'==== Install Wireshark ====
'=============================
Dim strScriptPath : strScriptPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")-1)
Dim objWSH
Dim strArch
Dim SetupCMD
Set objWSH = CreateObject("WScript.Shell")
DisableSecurity()
'Installation will be done without Desktop Icon and Quicklaunch Icon
SetupCMD = """" & strScriptPath & "\Wireshark-win64-1.8.4.exe" & """" & " /S /NCRC /desktopicon=no /quicklaunchicon=no"
objWSH.Run SetupCMD
'=================================
'==== Install WinPCap 4.1.2 ====
'=================================
Dim MSIInstalCMD
Dim ProductCode
ProductCode = "{342A9145-3489-4533-A21D-C4D9AEEE2F9D}"
MSIInstalCMD = "msiexec /i """ & strScriptPath & "\WinPCap 4.1.2 x64 en.msi"" /qn"
objWSH.Run MSIInstalCMD,,True
'=============================
'==== Sub's and Functions ====
'=============================
Sub DisableSecurity()
Dim objEnvProc, objWSH
Set objWSH = CreateObject("WScript.Shell")
Set objEnvProc = objWSH.Environment("PROCESS")
objEnvProc("SEE_MASK_NOZONECHECKS") = 1
End Sub
=========Remove==========
For removal I created a script to read the UninstallStrig registry key from:
Remove.vbs:
Option explicit
'=============================
'==== Uninstall Wireshark ====
'=============================
Dim UninstallStr_x86
Dim UninstallStr_x64
Dim UninstallStr
UninstallStr_x86 = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark\UninstallString"
UninstallStr_x64 = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark\UninstallString"
DisableSecurity()
If ProcArchitecture("x86") then
If ExistRegKey(UninstallStr_x86) then
UninstallStr = GetRegValue(UninstallStr_x86)
Launch_App UninstallStr, "/S"
End IF
End if
If ProcArchitecture("AMD64") then
If ExistRegKey(UninstallStr_x86) then
UninstallStr = GetRegValue(UninstallStr_x86)
'msgbox UninstallStr
Launch_App UninstallStr, "/S"
End IF
If ExistRegKey(UninstallStr_x64) Then
UninstallStr = GetRegValue(UninstallStr_x64)
'msgbox UninstallStr
Launch_App UninstallStr, "/S"
End IF
End if
'=================================
'==== Uninstall WinPCap 4.1.2 ====
'=================================
Dim MSIRemoveCMD
Dim ProductCode
Dim objWSH
Set objWSH = CreateObject("WScript.Shell")
ProductCode = "{342A9145-3489-4533-A21D-C4D9AEEE2F9D}"
MSIRemoveCMD = "msiexec /x " & ProductCode & " /QN"
If MSIInstalled(ProductCode) then
objWSH.Run MSIRemoveCMD,,True
End If
'=============================
'==== Sub's and Functions ====
'=============================
Function ExistRegKey(regKey)
Dim wshShell, str
Set wshShell = CreateObject("WScript.Shell")
On Error Resume Next
str = wshShell.RegRead(regKey)
If str = "" Then
ExistRegKey = False
Else
ExistRegKey = True
End If
Set wshShell = Nothing
End Function
Function GetRegValue(regKey)
Dim wshShell, str
Set wshShell = CreateObject("WScript.Shell")
If ExistRegKey(regKey) Then
str = wshShell.RegRead(regKey)
GetRegValue = str
Else
GetRegValue = "NOT FOUND"
End If
Set wshShell = Nothing
End Function
Function Launch_App (strExePath, strArg)
Dim strScriptPath : strScriptPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")-1)
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
'msgbox strExePath & " " & strArg
WshShell.Run strExePath & " " & strArg,,True
End Function
Sub DisableSecurity()
Dim objEnvProc, objWSH
Set objWSH = CreateObject("WScript.Shell")
Set objEnvProc = objWSH.Environment("PROCESS")
objEnvProc("SEE_MASK_NOZONECHECKS") = 1
End Sub
Function MSIInstalled(strProductCode)
Dim colList
Dim strItem
Dim objWI
Set objWI = CreateObject("WindowsInstaller.Installer")
For Each strItem In objWI.Products
If UCase(strProductCode) = UCase(strItem) Then
MSIInstalled = True
Exit Function
End If
Next
MSIInstalled = False
End Function
Function ProcArchitecture(strProcArch)
Dim strArch
Dim objEnvSys
Dim objWSH
Set objWSH = CreateObject("WScript.Shell")
Set objEnvSys = objWSH.Environment("System")
strArch = objEnvSys("PROCESSOR_ARCHITECTURE")
If UCase(strArch) = UCase(strProcArch) then
ProcArchitecture = True
Else
ProcArchitecture = False
End If
End Function
Important: Both scripts have to be placed in the same folder with Wireshark setup executable and WinPCap 4.1.2 x64 en.msi.
View inventory records anonymously contributed by opt-in users of the K1000 Systems Management Appliance.