Skip to content

Commit

Permalink
Merge pull request #667 from Ana06/didier-stevens-suite
Browse files Browse the repository at this point in the history
Add didier-stevens-suite.vm
  • Loading branch information
Ana06 authored Sep 29, 2023
2 parents 6df3070 + d6102ce commit 804d188
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/didier-stevens-suite.vm/didier-stevens-suite.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>didier-stevens-suite.vm</id>
<version>0.0.0.20230928</version>
<authors>Didier Stevens</authors>
<description>Tools colection by Didier Stevens</description>
<dependencies>
<dependency id="common.vm" />
<dependency id="python3" version="[3.10.0, 3.11.0)" />
</dependencies>
</metadata>
</package>
27 changes: 27 additions & 0 deletions packages/didier-stevens-suite.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -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 $_
}
12 changes: 12 additions & 0 deletions packages/didier-stevens-suite.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 804d188

Please sign in to comment.