Skip to content

Commit 6eec831

Browse files
committed
Forcefully attempt to kill FuckingNode for updates
1 parent a050190 commit 6eec831

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

docs/install.ps1

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ $INSTALL_DIR = "C:\$($APP_NAME.CASED)"
88
$EXE_PATH = Join-Path -Path $INSTALL_DIR -ChildPath "$($APP_NAME.CLI).exe"
99

1010
Function Remove-IfNeeded {
11-
if ($args.Count -gt 0) {
11+
if ($args.Count -gt 0) {
1212
$procId = $args[0] -as [int]
13-
if ($procId) {
14-
Write-Output "Updating existing install (PID $procId)"
15-
Stop-Process -Id $procId -Force
16-
Remove-Item $EXE_PATH -Force
17-
}
13+
}
14+
else {
15+
$proc = Get-Process -Name $APP_NAME.CLI -ErrorAction SilentlyContinue | Select-Object -First 1
16+
if ($proc) { $procId = $proc.Id }
17+
}
18+
19+
if ($procId) {
20+
Write-Output "FuckingNode found to be running. Removing existing install (PID $procId) for updating."
21+
Stop-Process -Id $procId -Force
22+
Remove-Item $EXE_PATH -Force
1823
}
1924
}
2025

0 commit comments

Comments
 (0)