Skip to content

Commit

Permalink
Add windump.vm
Browse files Browse the repository at this point in the history
Closes #948.
  • Loading branch information
vm-packages authored and emtuls committed Mar 7, 2024
1 parent 45790b3 commit f81b616
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
39 changes: 39 additions & 0 deletions packages/windump.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'WinDump'
$category = 'Networking'

$zipUrl = 'https://github.com/hsluoyz/WinDump/releases/download/v0.3/WinDump-for-Npcap-0.3.zip'
$zipSha256 = '7ed45fb06c8c9731ef095db627eaca23b445b2809041e164996121e49b24f5d4'

try {
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName

# Remove files from previous zips for upgrade
VM-Remove-PreviousZipPackage ${Env:chocolateyPackageFolder}

# Download and unzip
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
unzipLocation = $toolDir
url = $zipUrl
checksum = $zipSha256
checksumType = 'sha256'
url64bit = $zipUrl
checksum64 = $zipSha256
}
Install-ChocolateyZipPackage @packageArgs
VM-Assert-Path $toolDir

if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
$executablePath = Join-Path $toolDir "\x86\$toolName.exe" -Resolve
} else {
$executablePath = Join-Path $toolDir "\x64\$toolName.exe" -Resolve
}

VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -consoleApp $true
Install-BinFile -Name $toolName -Path $executablePath
} catch {
VM-Write-Log-Exception $_
}
7 changes: 7 additions & 0 deletions packages/windump.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'WinDump'
$category = 'Networking'

VM-Uninstall $toolName $category
13 changes: 13 additions & 0 deletions packages/windump.vm/windump.vm.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>windump.vm</id>
<version>0.3</version>
<authors>Riverbed Technology and hsluoyz</authors>
<description>Windows version of tcpdump, the command line network analyzer for UNIX</description>
<dependencies>
<dependency id="common.vm" />
<dependency id="npcap.vm" />
</dependencies>
</metadata>
</package>

0 comments on commit f81b616

Please sign in to comment.