From 485c5f34897559e73fa52b8751529a995ee0f4c2 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Wed, 8 Jan 2025 14:39:59 +0100 Subject: [PATCH] [wireshark.vm] Add tshark to PATH and Tools dir 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. --- packages/wireshark.vm/tools/chocolateyinstall.ps1 | 8 +++++++- packages/wireshark.vm/tools/chocolateyuninstall.ps1 | 6 ++++-- packages/wireshark.vm/wireshark.vm.nuspec | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/wireshark.vm/tools/chocolateyinstall.ps1 b/packages/wireshark.vm/tools/chocolateyinstall.ps1 index c86dd14e8..7d846d085 100644 --- a/packages/wireshark.vm/tools/chocolateyinstall.ps1 +++ b/packages/wireshark.vm/tools/chocolateyinstall.ps1 @@ -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 -arguments "--help" } catch { VM-Write-Log-Exception $_ } diff --git a/packages/wireshark.vm/tools/chocolateyuninstall.ps1 b/packages/wireshark.vm/tools/chocolateyuninstall.ps1 index 30cf82da4..eab16eb9c 100644 --- a/packages/wireshark.vm/tools/chocolateyuninstall.ps1 +++ b/packages/wireshark.vm/tools/chocolateyuninstall.ps1 @@ -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 +} diff --git a/packages/wireshark.vm/wireshark.vm.nuspec b/packages/wireshark.vm/wireshark.vm.nuspec index cfef1130c..12eac6920 100644 --- a/packages/wireshark.vm/wireshark.vm.nuspec +++ b/packages/wireshark.vm/wireshark.vm.nuspec @@ -2,7 +2,7 @@ wireshark.vm - 4.4.2 + 4.4.2.20250108 Wireshark lets you capture and interactively browse the traffic running on a computer network. Gerald Combs, Wireshark team