Skip to content

Commit

Permalink
[wireshark.vm] Add tshark to PATH and Tools dir
Browse files Browse the repository at this point in the history
Wireshark installs tshark, but it was not added to PATH. Add it to PATH
and to the Tools directory to make it easier to find.
  • Loading branch information
Ana06 committed Jan 16, 2025
1 parent c2c7a01 commit a88feee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion packages/wireshark.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ try {

$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
$executablePath = Join-Path ${Env:ProgramFiles} "Wireshark\Wireshark.exe" -Resolve
$executablePath = Join-Path ${Env:ProgramFiles} "Wireshark\$toolName.exe" -Resolve
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath -RunAsAdmin
VM-Assert-Path $shortcut

# Add tshark (installed by Wireshark) to PATH and to Tools directory
$toolName = 'tshark'
$executablePath = Join-Path ${Env:ProgramFiles} "Wireshark\$toolName.exe" -Resolve
Install-BinFile -Name $toolname -Path $executablePath
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -consoleApp $true
} catch {
VM-Write-Log-Exception $_
}
6 changes: 4 additions & 2 deletions packages/wireshark.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'Wireshark'
$toolNames = @('Wireshark', 'tshark')
$category = 'Networking'

VM-Remove-Tool-Shortcut $toolName $category
ForEach ($toolName in $toolNames) {
VM-Remove-Tool-Shortcut $toolName $category
}
2 changes: 1 addition & 1 deletion packages/wireshark.vm/wireshark.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>wireshark.vm</id>
<version>4.4.2</version>
<version>4.4.2.20250108</version>
<description>Wireshark lets you capture and interactively browse the traffic running on a computer network.</description>
<authors>Gerald Combs, Wireshark team</authors>
<dependencies>
Expand Down

0 comments on commit a88feee

Please sign in to comment.