Skip to content

misterdownloadmanager: The ultimate open-source, clean-room download manager written from scratch in pure Rust for Windows, Mac, and Linux

docs-shots: shoot only its own crash report window (#165)

Ahmed Nefzaoui73c7f6e024dc
diff --git a/tools/lab/docs-shots.ps1 b/tools/lab/docs-shots.ps1
index 9051e2a2..3eda46a6 100644
--- a/tools/lab/docs-shots.ps1
+++ b/tools/lab/docs-shots.ps1
@@ -231,8 +231,10 @@ try {
$mon = 0
for ($i = 0; $i -lt 60 -and -not $mon; $i++) {
Start-Sleep -Milliseconds 500
- $mon = (Get-Process misterdownloadmanager -ErrorAction SilentlyContinue |
- Where-Object { $_.Id -ne $app.Id -and (Titles $_.Id) -contains $title } | Select-Object -First 1).Id
+ # Our app's own monitor (its child): never another copy's report window, which this run
+ # would shoot and then close.
+ $mon = (Get-CimInstance Win32_Process -Filter "ParentProcessId=$($app.Id)" -ErrorAction SilentlyContinue |
+ Where-Object { (Titles $_.ProcessId) -contains $title } | Select-Object -First 1).ProcessId
}
if (-not $mon) { throw "no crash report window" }
# The dump read and GitHub searched.