Skip to content

Commit

Permalink
Add didier-stevens-beta.vm
Browse files Browse the repository at this point in the history
  • Loading branch information
d35ha committed Dec 21, 2023
1 parent 7341e25 commit 252f044
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/didier-stevens-beta.vm/didier-stevens-beta.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-beta.vm</id>
<version>0.0.0.20231221</version>
<authors>Didier Stevens</authors>
<description>Beta versions of Didier Stevens's software</description>
<dependencies>
<dependency id="common.vm" />
<dependency id="python3.vm" />
</dependencies>
</metadata>
</package>
31 changes: 31 additions & 0 deletions packages/didier-stevens-beta.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$category = 'Office'
$zipUrl = 'https://github.com/DidierStevens/Beta/archive/cbb1d5c32d02b4e07128a197c8b8fb6ea597916a.zip'
$zipSha256 = 'e9d83063f45f8e2791d33de194a46850bd7f1921e755bd4651c769cbcdbd5052'

$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}\Beta-*"
VM-Assert-Path $toolDir

# Add shortcut for commonly used office tools
ForEach ($toolName in @('onedump')) {
$executablePath = Join-Path $toolDir "$toolName.py"
VM-Install-Shortcut $toolName $category $executablePath -consoleApp $true -arguments "--help"
}

# Add tools to Path
$path = [Environment]::GetEnvironmentVariable("Path", "Machine") + [IO.Path]::PathSeparator + $toolDir
[Environment]::SetEnvironmentVariable("Path", $path, "Machine")
} catch {
VM-Write-Log-Exception $_
}
12 changes: 12 additions & 0 deletions packages/didier-stevens-beta.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 = 'Office'
ForEach ($toolName in @('onedump')) {
VM-Remove-Tool-Shortcut $toolName $category
}

# Remove tool directory
$toolDir = Get-Item "${Env:RAW_TOOLS_DIR}\Beta-*"
Remove-Item $toolDir -Recurse -Force -ea 0

0 comments on commit 252f044

Please sign in to comment.