chore: add PowerShell installer for vendored HexStrike deps; call from setup.ps1

This commit is contained in:
giveen
2026-01-11 20:43:22 -07:00
parent 704b5056ea
commit 57a0e6e7c8
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<#
Install vendored HexStrike Python dependencies (Windows/PowerShell).
This mirrors `scripts/install_hexstrike_deps.sh` for Windows users.
#>
Set-StrictMode -Version Latest
Write-Host "Installing vendored HexStrike dependencies (Windows)..."
# Load .env if present (simple parser: ignore comments/blank lines)
if (Test-Path -Path ".env") {
Write-Host "Sourcing .env"
Get-Content .env | ForEach-Object {
$line = $_.Trim()
if ($line -and -not $line.StartsWith("#") -and $line.Contains("=")) {
$parts = $line -split "=", 2
$name = $parts[0].Trim()
$value = $parts[1].Trim()
# Only set if not empty
if ($name) { $env:$name = $value }
}
}
}
$req = Join-Path -Path (Get-Location) -ChildPath "third_party/hexstrike/requirements.txt"
if (-not (Test-Path -Path $req)) {
Write-Host "Cannot find $req. Is the HexStrike subtree present?" -ForegroundColor Yellow
exit 1
}
# Prefer venv python if present
$python = "python"
if (Test-Path -Path ".\venv\Scripts\python.exe") {
$python = Join-Path -Path (Get-Location) -ChildPath ".\venv\Scripts\python.exe"
}
Write-Host "Using Python: $python"
& $python -m pip install --upgrade pip
& $python -m pip install -r $req
Write-Host "HexStrike dependencies installed. Note: many external tools are not included and must be installed separately as described in third_party/hexstrike/requirements.txt." -ForegroundColor Green
exit 0

View File

@@ -95,6 +95,17 @@ PENTESTAGENT_DEBUG=false
New-Item -ItemType Directory -Force -Path "loot" | Out-Null
Write-Host "[OK] Loot directory created"
# Install vendored HexStrike dependencies automatically if present
$hexReq = Join-Path -Path (Get-Location) -ChildPath "third_party/hexstrike/requirements.txt"
if (Test-Path -Path $hexReq) {
Write-Host "Installing vendored HexStrike dependencies..."
try {
& .\scripts\install_hexstrike_deps.ps1
} catch {
Write-Host "Warning: Failed to install HexStrike deps: $($_.Exception.Message)" -ForegroundColor Yellow
}
}
Write-Host ""
Write-Host "Setup complete!"
Write-Host ""