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

Make Update-ServiceBinaries honor the return value of Copy-ServiceFiles.

parent 48c21d13
No related branches found
No related tags found
No related merge requests found
...@@ -356,7 +356,6 @@ function Copy-ServiceFiles { ...@@ -356,7 +356,6 @@ function Copy-ServiceFiles {
# Returns $True for success, $False otherwise. # Returns $True for success, $False otherwise.
Write-Verbose "Copying service binaries from [$($UpdPackage)]..." Write-Verbose "Copying service binaries from [$($UpdPackage)]..."
try { try {
Stop-MyService "Trying to update service using package [$($PkgDir)]."
Copy-Item -Recurse -Force ` Copy-Item -Recurse -Force `
-Path "$($UpdPackage)\$($ServiceName)\*" ` -Path "$($UpdPackage)\$($ServiceName)\*" `
-Destination "$InstallationPath" -Destination "$InstallationPath"
...@@ -371,15 +370,21 @@ function Copy-ServiceFiles { ...@@ -371,15 +370,21 @@ function Copy-ServiceFiles {
function Update-ServiceBinaries { function Update-ServiceBinaries {
$NewService = NewServiceBinaries-Available # Stop the tray application and the service, update the service binaries and
if (-Not ($NewService)) { # create a marker file indicating the service on this host has been updated.
#
# Returns $True if binaries were updated successfully and the marker file
# has been created, $False otherwise.
Stop-TrayApp
Stop-MyService "Trying to update service using package [$($UpdPackage)]."
$Ret = Copy-ServiceFiles
if (-Not $Ret) {
Return $False Return $False
} }
Stop-TrayApp $MarkerFile = "$($UpdPathMarkerFiles)\$($env:COMPUTERNAME)"
Copy-ServiceFiles
try { try {
New-Item -Type File "$MarkerFile" -ErrorAction Stop | Out-Null New-Item -Type File "$MarkerFile" | Out-Null
Log-Debug "Created marker file [$($MarkerFile)]." Log-Debug "Created marker file [$($MarkerFile)]."
} }
catch { catch {
......
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