From 9ba5beda417a378e2955607cada0ea8f9371a184 Mon Sep 17 00:00:00 2001 From: Elliot Chernofsky <35854880+emtuls@users.noreply.github.com> Date: Mon, 22 Dec 2025 17:15:57 -0500 Subject: [PATCH] Revert "Fix libraries.python3.vm dependency resolution" --- .../libraries.python3.vm.nuspec | 2 +- .../tools/chocolateyinstall.ps1 | 44 ++++--------------- 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/packages/libraries.python3.vm/libraries.python3.vm.nuspec b/packages/libraries.python3.vm/libraries.python3.vm.nuspec index 741b6ee26..b3538a10b 100644 --- a/packages/libraries.python3.vm/libraries.python3.vm.nuspec +++ b/packages/libraries.python3.vm/libraries.python3.vm.nuspec @@ -2,7 +2,7 @@ libraries.python3.vm - 0.0.0.20251218 + 0.0.0.20251004 Python 3 libraries useful for common reverse engineering tasks. Several, check in pypi.org for every of the libraries diff --git a/packages/libraries.python3.vm/tools/chocolateyinstall.ps1 b/packages/libraries.python3.vm/tools/chocolateyinstall.ps1 index bec327efe..137060e5c 100644 --- a/packages/libraries.python3.vm/tools/chocolateyinstall.ps1 +++ b/packages/libraries.python3.vm/tools/chocolateyinstall.ps1 @@ -10,42 +10,21 @@ try { VM-Pip-Install "pip~=23.2.1" $failures = @() - $pipArgs = @() $modules = $modulesXml.modules.module - - Write-Host "Attempting to install the following Python3 modules:" foreach ($module in $modules) { - Write-Host "[+] $($module.name)" + Write-Host "[+] Attempting to install Python3 module: $($module.name)" $installValue = $module.name if ($module.url) { $installValue = $module.url } - $pipArgs += $installValue - } - - Write-Host "Batch installing Python modules..." - $batchInstallString = $pipArgs -join " " - VM-Pip-Install $batchInstallString - foreach ($module in $modules) { - $pkgName = $module.name + VM-Pip-Install $installValue - # Clean up version pins (e.g., "pywin32==308" -> "pywin32") for install check - if ($pkgName -match "==") { - $pkgName = $pkgName -split "==" | Select-Object -First 1 - } - if ($pkgName -match ">=") { - $pkgName = $pkgName -split ">=" | Select-Object -First 1 - } - - # 'pip show' returns exit code 0 if found, 1 if missing - $null = py -3.10 -m pip show $pkgName 2>&1 - - if ($LASTEXITCODE -ne 0) { - Write-Host "`t[!] Failed to install Python 3.10 module:$pkgName" -ForegroundColor Red - $failures += $pkgName + if ($LastExitCode -eq 0) { + Write-Host "`t[+] Installed Python 3.10 module: $($module.name)" -ForegroundColor Green } else { - Write-Host "`t[+] Installed Python 3.10 module: $pkgName" -ForegroundColor Green + Write-Host "`t[!] Failed to install Python 3.10 module: $($module.name)" -ForegroundColor Red + $failures += $module.Name } } @@ -53,15 +32,10 @@ try { foreach ($module in $failures) { VM-Write-Log "ERROR" "Failed to install Python 3.10 module: $module" } - throw "Package installation failed. The following modules could not be verified: $($failures -join ', ')" + $outputFile = $outputFile.replace('lib\', 'lib-bad\') + VM-Write-Log "ERROR" "Check $outputFile for more information" + exit 1 } - - # Fix issue with chocolately printing incorrect install directory - $pythonPath = py -3.10 -c "import sys; print(sys.prefix)" 2>$null - if ($pythonPath) { - $env:ChocolateyPackageInstallLocation = $pythonPath - } - # Avoid WARNINGs to fail the package install exit 0 } catch {