diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index 6a957f5a..8ce9e321 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20241002 + 0.0.0.20241029 Common libraries for VM-packages Mandiant diff --git a/packages/common.vm/tools/vm.common/vm.common.psm1 b/packages/common.vm/tools/vm.common/vm.common.psm1 index c6edc13d..f976e6e0 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -1737,16 +1737,18 @@ function VM-Get-MSIInstallerPathByProductName { } } -# Install Python library with Pip +# Install Python library/ies with Pip function VM-Pip-Install { param ( - [string]$package + [string]$libraries # Comma-separated list of libraries to install, example: "flare-capa", "flare-capa,tabulate" ) # Create output file to log python module installation details $outputFile = VM-New-Install-Log ${Env:VM_COMMON_DIR} - # Ignore warning with `-W ignore` to avoid warnings like deprecation to fail the installation - Invoke-Expression "py -3.10 -W ignore -m pip install $package --disable-pip-version-check 2>&1 >> $outputFile" + ForEach ($library in $libraries.Split(",")) { + # Ignore warning with `-W ignore` to avoid warnings like deprecation to fail the installation + Invoke-Expression "py -3.10 -W ignore -m pip install $library --disable-pip-version-check 2>&1 >> $outputFile" + } } # Install tool using Pip and create shortcut in the Tools directory diff --git a/packages/internet_detector.vm/internet_detector.vm.nuspec b/packages/internet_detector.vm/internet_detector.vm.nuspec index aa7c6ae7..f64f2696 100644 --- a/packages/internet_detector.vm/internet_detector.vm.nuspec +++ b/packages/internet_detector.vm/internet_detector.vm.nuspec @@ -2,11 +2,11 @@ internet_detector.vm - 1.0.0 + 1.0.0.20241029 Elliot Chernofsky and Ana Martinez Gomez Tool that changes the background and a taskbar icon if it detects internet connectivity - + diff --git a/packages/internet_detector.vm/tools/chocolateyinstall.ps1 b/packages/internet_detector.vm/tools/chocolateyinstall.ps1 index a6467801..a999eb58 100644 --- a/packages/internet_detector.vm/tools/chocolateyinstall.ps1 +++ b/packages/internet_detector.vm/tools/chocolateyinstall.ps1 @@ -11,10 +11,8 @@ New-Item -Path $toolDir -ItemType Directory -Force -ea 0 VM-Assert-Path $toolDir # Install pyinstaller (needed to build the Python executable) and tool dependencies ('pywin32') -$dependencies = @('pyinstaller', 'pywin32') -ForEach ($dependency in $dependencies) { - VM-Pip-Install $dependency -} +$dependencies = "pyinstaller,pywin32" +VM-Pip-Install $dependencies # This wrapper is needed because we can't run PyInstaller as admin, so this forces a usermode context. Start-Process -FilePath 'cmd.exe' -ArgumentList "/c pyinstaller --onefile -w --distpath $toolDir --workpath $packageToolDir --specpath $packageToolDir $packageToolDir\internet_detector.pyw" -Wait diff --git a/packages/libraries-extra.python3.vm/libraries-extra.python3.vm.nuspec b/packages/libraries-extra.python3.vm/libraries-extra.python3.vm.nuspec new file mode 100644 index 00000000..34826c1a --- /dev/null +++ b/packages/libraries-extra.python3.vm/libraries-extra.python3.vm.nuspec @@ -0,0 +1,13 @@ + + + + libraries-extra.python3.vm + 0.0.0.20241029 + Install extra Python useful libraries + Several, check in pypi.org for every of the libraries + + + + + + diff --git a/packages/libraries-extra.python3.vm/tools/chocolateyinstall.ps1 b/packages/libraries-extra.python3.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 00000000..21698fdb --- /dev/null +++ b/packages/libraries-extra.python3.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,9 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +try { + $dependencies = "asciinet,bs4,flare_capa,langchain,langchain_google_genai,langchain_openai,networkx,python-statemachine,requests,tabulate,tenacity" + VM-Pip-Install $dependencies +} catch { + VM-Write-Log-Exception $_ +}