From d6102cef6e91266da579ca86cab1d2c5af446c18 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Thu, 28 Sep 2023 12:33:05 +0200 Subject: [PATCH] Add didier-stevens-suite.vm Add didier-stevens-suite.vm and adds shortcuts for the tools pdfid and pdf-parser in the PDF category. --- .../didier-stevens-suite.vm.nuspec | 13 +++++++++ .../tools/chocolateyinstall.ps1 | 27 +++++++++++++++++++ .../tools/chocolateyuninstall.ps1 | 12 +++++++++ 3 files changed, 52 insertions(+) create mode 100644 packages/didier-stevens-suite.vm/didier-stevens-suite.vm.nuspec create mode 100644 packages/didier-stevens-suite.vm/tools/chocolateyinstall.ps1 create mode 100644 packages/didier-stevens-suite.vm/tools/chocolateyuninstall.ps1 diff --git a/packages/didier-stevens-suite.vm/didier-stevens-suite.vm.nuspec b/packages/didier-stevens-suite.vm/didier-stevens-suite.vm.nuspec new file mode 100644 index 000000000..321b5c52d --- /dev/null +++ b/packages/didier-stevens-suite.vm/didier-stevens-suite.vm.nuspec @@ -0,0 +1,13 @@ + + + + didier-stevens-suite.vm + 0.0.0.20230928 + Didier Stevens + Tools colection by Didier Stevens + + + + + + diff --git a/packages/didier-stevens-suite.vm/tools/chocolateyinstall.ps1 b/packages/didier-stevens-suite.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..89c95e1db --- /dev/null +++ b/packages/didier-stevens-suite.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,27 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +try { + $category = 'PDF' + $zipUrl = 'https://github.com/DidierStevens/DidierStevensSuite/archive/8190354314d6f42c9ddc477a795029dc446176c5.zip' + $zipSha256 = 'fe37ef5b81810af99820a7360aa26e7fec669432875dd29e38f307880bb53c37' + + $packageArgs = @{ + packageName = ${Env:ChocolateyPackageName} + unzipLocation = ${Env:RAW_TOOLS_DIR} + url = $zipUrl + checksum = $zipSha256 + checksumType = 'sha256' + } + Install-ChocolateyZipPackage @packageArgs + $toolDir = Get-Item "${Env:RAW_TOOLS_DIR}\DidierStevensSuite-*" + VM-Assert-Path $toolDir + + # Add shortcut for commonly used PDF tools + ForEach ($toolName in @('pdfid', 'pdf-parser')) { + $executablePath = Join-Path $toolDir "$toolName.py" + VM-Install-Shortcut $toolName $category $executablePath -consoleApp $true + } +} catch { + VM-Write-Log-Exception $_ +} diff --git a/packages/didier-stevens-suite.vm/tools/chocolateyuninstall.ps1 b/packages/didier-stevens-suite.vm/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..e784769de --- /dev/null +++ b/packages/didier-stevens-suite.vm/tools/chocolateyuninstall.ps1 @@ -0,0 +1,12 @@ +$ErrorActionPreference = 'Continue' +Import-Module vm.common -Force -DisableNameChecking + +# Remove shortcuts +$category = 'PDF' +ForEach ($toolName in @('pdfid', 'pdf-parser')) { + VM-Remove-Tool-Shortcut $toolName $category +} + +# Remove tool directory +$toolDir = Get-Item "${Env:RAW_TOOLS_DIR}\DidierStevensSuite-*" +Remove-Item $toolDir -Recurse -Force -ea 0