Skip to content

Commit

Permalink
Add additional log sources to view after install (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
MalwareMechanic authored Nov 30, 2022
1 parent f27baca commit 45f1a75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/flarevm.installer.vm/flarevm.installer.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>flarevm.installer.vm</id>
<version>0.0.0.20221128</version>
<version>0.0.0.20221129</version>
<title>FLARE VM Installer</title>
<authors>FLARE</authors>
<description>Generic installer for Mandiant's custom virtual machines. Originally created by FLARE for FLARE VM, a malware analysis environment.</description>
Expand Down
12 changes: 9 additions & 3 deletions packages/flarevm.installer.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ try {
$chocoLibBad = Join-Path ${Env:ProgramData} "chocolatey\lib-bad"
if ((Test-Path $chocoLibBad) -and (Get-ChildItem -Path $chocoLibBad | Measure-Object).Count -gt 0) {
Get-ChildItem -Path $chocoLibBad | Foreach-Object {
VM-Write-Log "ERROR" "$($_.Name)"
$failures[$_.Name] = $true
}
}
Expand All @@ -68,15 +67,22 @@ try {
}

# Log additional info if we found failed packages
$logPath = Join-Path ${Env:VM_COMMON_DIR} "log.txt"
if ((Test-Path $failedPackages)) {
VM-Write-Log "ERROR" "For each failed package, you may attempt a manual install via: choco install -y <package_name>"
VM-Write-Log "ERROR" "Failed package list saved to: $failedPackages"
VM-Write-Log "ERROR" "Please check the following logs for additional errors:"
VM-Write-Log "ERROR" "`t$logPath (this file)"
VM-Write-Log "ERROR" "`t%PROGRAMDATA%\chocolatey\logs\chocolatey.log"
VM-Write-Log "ERROR" "`t%LOCALAPPDATA%\Boxstarter\boxstarter.log"
}

# Display installer log if available
$logPath = Join-Path ${Env:VM_COMMON_DIR} "log.txt"
if ((Test-Path $logPath)) {
Write-Host "[-] Please see installer log for any errors: $logPath" -ForegroundColor Yellow
Write-Host "[-] Please check the following logs for any errors:" -ForegroundColor Yellow
Write-Host "`t[-] $logPath" -ForegroundColor Yellow
Write-Host "`t[-] %PROGRAMDATA%\chocolatey\logs\chocolatey.log" -ForegroundColor Yellow
Write-Host "`t[-] %LOCALAPPDATA%\Boxstarter\boxstarter.log" -ForegroundColor Yellow
Start-Sleep 5
& notepad.exe $logPath
}
Expand Down

0 comments on commit 45f1a75

Please sign in to comment.