From d69b2d925e66b398dea04d0063621a173fca227d Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch> Date: Wed, 13 Dec 2017 13:43:51 +0100 Subject: [PATCH] Make config file path configurable in updater scripts. Refers to #18 --- Updater/Update-Service.ps1 | 3 ++- Updater/UpdaterConfig-Example.inc.ps1 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index 45a725b..9382ef6 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -244,7 +244,7 @@ function Update-File { function Update-Configuration { $NewConfig = "$($UpdateConfigPath)\configuration.xml" if (Test-Path -PathType Leaf $NewConfig) { - $ret = Update-File $NewConfig $InstallationPath + $ret = Update-File $NewConfig $ConfigPath } else { $ret = $False Write-Verbose "No configuration file found at '$($NewConfig)'." @@ -387,6 +387,7 @@ $UpdateBinariesPath = "$($UpdateSourcePath)\Service\Binaries" $LogfileUpload = "$($UpdateSourcePath)\Logs\$($env:COMPUTERNAME)" Exit-IfDirMissing $InstallationPath "installation" +Exit-IfDirMissing $ConfigPath "configuration files" Exit-IfDirMissing $UpdateSourcePath "update source" Exit-IfDirMissing $UpdateConfigPath "configuration update" Exit-IfDirMissing $UpdateMarkerPath "update marker" diff --git a/Updater/UpdaterConfig-Example.inc.ps1 b/Updater/UpdaterConfig-Example.inc.ps1 index 21bea61..6c3d3e6 100644 --- a/Updater/UpdaterConfig-Example.inc.ps1 +++ b/Updater/UpdaterConfig-Example.inc.ps1 @@ -2,6 +2,7 @@ $ServiceName = "AutoTx" $InstallationPath = "C:\Tools\$($ServiceName)" +$ConfigPath = "$($InstallationPath)" $LogPath = "$($InstallationPath)" $UpdateSourcePath = "\\fileserver.mydomain.xy\share\_AUTOTX_" -- GitLab