diff --git a/packages/arsenalimagemounter.vm/arsenalimagemounter.vm.nuspec b/packages/arsenalimagemounter.vm/arsenalimagemounter.vm.nuspec index 4bb3b1c93..3947a2d66 100644 --- a/packages/arsenalimagemounter.vm/arsenalimagemounter.vm.nuspec +++ b/packages/arsenalimagemounter.vm/arsenalimagemounter.vm.nuspec @@ -2,7 +2,7 @@ arsenalimagemounter.vm - 3.11.279.20240226 + 3.11.279.20240402 Arsenal Recon Mounts the contents of disk images as complete disks in Windows. diff --git a/packages/arsenalimagemounter.vm/tools/chocolateyinstall.ps1 b/packages/arsenalimagemounter.vm/tools/chocolateyinstall.ps1 index 87a34e67d..5846979f1 100644 --- a/packages/arsenalimagemounter.vm/tools/chocolateyinstall.ps1 +++ b/packages/arsenalimagemounter.vm/tools/chocolateyinstall.ps1 @@ -2,6 +2,54 @@ $ErrorActionPreference = 'Stop' Import-Module vm.common -Force -DisableNameChecking try { + ################################### + # Install of drivers dependencies # + ################################### + $zipCliUrl = 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/master/Command%20line%20applications/aim_ll.zip' + $zipCliSha256 = '9c2e6041df7d32093da8899e98462767ad8c8cbecaabe1ff6afefeba87f364f3' + $tempCliDownloadDir = Join-Path ${Env:chocolateyPackageFolder} "aim_ll" + $toolCli = "aim_ll.exe" + + $zipDriverUrl = 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/master/DriverSetup/DriverFiles.zip' + $zipDriverSha256 = 'c5de8e5d5a2c0231baf2cdb74fb0b0f4047658c69105bcab28990734b3979ee3' + $tempDriverDownloadDir = Join-Path ${Env:chocolateyPackageFolder} "temp_$([guid]::NewGuid())" + + $packageArgs = @{ + packageName = ${Env:ChocolateyPackageName} + unzipLocation = $tempCliDownloadDir + url = $zipCliUrl + checksum = $zipCliSha256 + checksumType = 'sha256' + } + Install-ChocolateyZipPackage @packageArgs + VM-Assert-Path $tempCliDownloadDir + + $packageArgs = @{ + packageName = ${Env:ChocolateyPackageName} + unzipLocation = $tempDriverDownloadDir + url = $zipDriverUrl + checksum = $zipDriverSha256 + checksumType = 'sha256' + } + Install-ChocolateyZipPackage @packageArgs | Out-Null + VM-Assert-Path $tempDriverDownloadDir + + if (Get-OSArchitectureWidth -Compare 64) { + $toolCliDir = Join-Path $tempCliDownloadDir "x64" + } + else { + $toolCliDir = Join-Path $tempCliDownloadDir "x32" + } + $toolCliPath = Join-Path $toolCliDir $toolCli + # Install drivers messages displayed in stderr even on successful install, bypass by creating an external process + Start-Process -FilePath $toolCliPath -ArgumentList "--install $tempDriverDownloadDir" -Wait + + # Remove temp driver folder + VM-Remove-PreviousZipPackage ${Env:chocolateyPackageFolder} + + ###################### + # Install of package # + ###################### $toolName = 'ArsenalImageMounter' $category = 'Forensic' $shimPath = "\bin\${toolName}.exe" diff --git a/packages/arsenalimagemounter.vm/tools/chocolateyuninstall.ps1 b/packages/arsenalimagemounter.vm/tools/chocolateyuninstall.ps1 index dff48b058..94f60cd60 100644 --- a/packages/arsenalimagemounter.vm/tools/chocolateyuninstall.ps1 +++ b/packages/arsenalimagemounter.vm/tools/chocolateyuninstall.ps1 @@ -5,3 +5,16 @@ $toolName = 'ArsenalImageMounter' $category = 'Forensic' VM-Remove-Tool-Shortcut $toolName $category + +$tempCliDownloadDir = Join-Path ${Env:chocolateyPackageFolder} "aim_ll" +$toolCli = "aim_ll.exe" + +if (Get-OSArchitectureWidth -Compare 64) { + $toolCliDir = Join-Path $tempCliDownloadDir "x64" +} +else { + $toolCliDir = Join-Path $tempCliDownloadDir "x32" +} + +$toolCliPath = Join-Path $toolCliDir $toolCli +& $toolCliPath "--uninstall"