Skip to content
Snippets Groups Projects
Commit 420b1786 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Shut down tray app before updating the service.

Closes #27
parent 5be372cb
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,17 @@ function ServiceIsBusy {
}
}
function Stop-TrayApp() {
try {
Stop-Process -Name "ATxTray" -Force -ErrorAction Stop
Start-Sleep -Milliseconds 200
Log-Debug "Stopped Tray App process."
}
catch {
Log-Debug "Unable to stop tray app, is it running?"
}
}
function Exit-IfDirMissing([string]$DirName, [string]$Desc) {
if (Test-Path -PathType Container $DirName) {
......@@ -279,6 +290,7 @@ function Update-ServiceBinaries {
Log-Debug "Found marker [$($MarkerFile)], not updating service."
Return $False
}
Stop-TrayApp
Copy-ServiceFiles
try {
New-Item -Type File "$MarkerFile" -ErrorAction Stop | Out-Null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment