Skip to content

Commit

Permalink
fix: wd on windows (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
tribhuwan-kumar authored Feb 20, 2025
1 parent 1f7d97a commit 1c4160d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
13 changes: 0 additions & 13 deletions screenpipe-app-tauri/src-tauri/src/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ pub async fn stop_screenpipe(
.creation_flags(CREATE_NO_WINDOW)
.output()
.await;

// fallback wild kill
tokio::process::Command::new("powershell")
.arg("-NoProfile")
.arg("-WindowStyle")
.arg("hidden")
.arg("-Command")
.arg(format!(
r#"Get-WmiObject Win32_Process | Where-Object {{ $_.CommandLine -like "*screenpipe*" }} | ForEach-Object {{ taskkill.exe /T /F /PID $_.ProcessId }}"#,
))
.creation_flags(CREATE_NO_WINDOW)
.output()
.await
}
}
.await;
Expand Down
8 changes: 4 additions & 4 deletions screenpipe-core/src/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ while ($true) {{
# Add the main process to the list
$allProcesses = @($childPid) + $children
foreach ($pid in $allProcesses) {{
foreach ($processId in $allProcesses) {{
try {{
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
Stop-Process -Id $processId -Force -ErrorAction SilentlyContinue
Write-Host "Stopped process: $pid"
}} catch {{
Write-Host "Process $pid already terminated"
Write-Host "Process $processId already terminated"
}}
}}
Stop-Process -Id $PID -Force
exit
}}
}}
Expand Down

0 comments on commit 1c4160d

Please sign in to comment.