From b6e4ce377948f4e2e885447208750be9349767ae Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Fri, 8 Dec 2017 15:19:24 +0100
Subject: [PATCH] Update path for service binaries, adapt REAMDE to latest
 changes.

Refers to #13
---
 AutoTx-Updater/README.md          | 34 +++++++++++++++++++++++++++++--
 AutoTx-Updater/Update-Service.ps1 |  2 +-
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/AutoTx-Updater/README.md b/AutoTx-Updater/README.md
index 94a0e25..bd66668 100644
--- a/AutoTx-Updater/README.md
+++ b/AutoTx-Updater/README.md
@@ -1,14 +1,44 @@
 Service Installation Updates
 ============================
 
-The service can automatically be updated by running the `Update-AutoTxService.ps1`
-script. It will check a remote location (configured in the script header) and do
+The service can automatically be updated by running the `Update-Service.ps1`
+script. It will check a remote location (configurable via a config file) and do
 the following tasks:
 
 - check for new service binaries and update the local ones if applicable
 - check for a new configuration file for this host and update the local one
 - try to restart the service if one of the previous tasks was done
 
+Config File Options
+-------------------
+
+An example config file for the update script is provided as
+`UpdaterConfig-Example.inc.ps1`. The values should be mostly self-explaining, so
+just a few comments here:
+
+- `$InstallationPath` refers to the local directory where the service
+  executables have been installed, e.g. `C:\Tools\AutoTx`
+- `$UpdateSourcePath` points to the base directory on a storage location (most
+  likely some UNC path) where the service update files are provided. See the
+  next section for details on the structure therein.
+
+Folder Structure
+----------------
+
+The `$UpdateSourcePath` folder structure is expected to be like this:
+
+```
+├─── Configs
+│   └─── <HOSTNAME>
+│       └─── configuration.xml
+└─── Service
+    ├─── Binaries
+    │   ├─── Latest
+    │   └─── build_2018-01-23_11-22-33
+    └─── UpdateMarkers
+        └─── <HOSTNAME>
+```
+
 Automatic Updates
 -----------------
 
diff --git a/AutoTx-Updater/Update-Service.ps1 b/AutoTx-Updater/Update-Service.ps1
index bddcd37..25f2e86 100644
--- a/AutoTx-Updater/Update-Service.ps1
+++ b/AutoTx-Updater/Update-Service.ps1
@@ -310,7 +310,7 @@ Check-ServiceState $ServiceName
 
 $UpdateConfigPath = "$($UpdateSourcePath)\Configs\$($env:COMPUTERNAME)"
 $UpdateMarkerPath = "$($UpdateSourcePath)\Service\UpdateMarkers"
-$UpdateBinariesPath = "$($UpdateSourcePath)\Service\LatestBinaries"
+$UpdateBinariesPath = "$($UpdateSourcePath)\Service\Binaries\Latest"
 
 Exit-IfDirMissing $InstallationPath "installation"
 Exit-IfDirMissing $UpdateSourcePath "update source"
-- 
GitLab