From cbbddfa5b0d28bd9bb7e435e7b28a285acb5632d Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Thu, 1 Mar 2018 14:44:39 +0100
Subject: [PATCH] Make StatusXml a global variable.

---
 Updater/Update-Service.ps1 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1
index 574938b..64f0cad 100644
--- a/Updater/Update-Service.ps1
+++ b/Updater/Update-Service.ps1
@@ -31,7 +31,6 @@ function ServiceIsRunning([string]$ServiceName) {
 
 
 function ServiceIsBusy {
-    $StatusXml = "$($InstallationPath)\status.xml"
     try {
         [xml]$XML = Get-Content $StatusXml -ErrorAction Stop
         # careful, we need a string comparison here:
@@ -551,6 +550,8 @@ $ServiceRunningBefore = ServiceIsRunning $ServiceName
 
 $ConfigPath = "$($InstallationPath)\conf"
 $LogPath = "$($InstallationPath)"
+$StatusXml = "$($InstallationPath)\status.xml"
+
 
 $UpdPathConfig = "$($UpdateSourcePath)\Configs"
 $UpdPathMarkerFiles = "$($UpdateSourcePath)\Service\UpdateMarkers"
-- 
GitLab