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

Allow for specifying updater config, make script location-agnostic

parent d0e2d241
Branches
Tags
No related merge requests found
$UpdaterSettings = "C:\Tools\AutoTx-Updater\UpdaterConfig.inc.ps1" # Helper script to facilitate the package-deploy-update cycle. Its purpose is to
# automate reading the updater config (optionally just using the default
# location) and subsequently call the `Make-Package.ps1` and
# `Provide-UpdaterPackage.ps1` scripts followed by a removal of the update
# marker file for the local computer, all using the parameters collected from
# the configuration file.
. $UpdaterSettings [CmdletBinding()]
Param(
[String] $UpdaterSettings = "C:\Tools\AutoTx-Updater\UpdaterConfig.inc.ps1"
)
$ErrorActionPreference = "Stop"
try {
. $UpdaterSettings
}
catch {
$ex = $_.Exception.Message
Write-Host "Error reading settings file: '$($UpdaterSettings)' [$($ex)]"
Exit
}
# Make sure to run from the directory containing the script itself:
$BaseDir = $(Split-Path $MyInvocation.MyCommand.Path)
Push-Location $BaseDir
.\Make-Package.ps1 .\Make-Package.ps1
.\Provide-UpdaterPackage.ps1 -UpdaterSettings $UpdaterSettings .\Provide-UpdaterPackage.ps1 -UpdaterSettings $UpdaterSettings
...@@ -8,4 +31,6 @@ $UpdaterSettings = "C:\Tools\AutoTx-Updater\UpdaterConfig.inc.ps1" ...@@ -8,4 +31,6 @@ $UpdaterSettings = "C:\Tools\AutoTx-Updater\UpdaterConfig.inc.ps1"
$Marker = "$($UpdateSourcePath)\Service\UpdateMarkers\$($env:COMPUTERNAME)" $Marker = "$($UpdateSourcePath)\Service\UpdateMarkers\$($env:COMPUTERNAME)"
if (Test-Path $Marker) { if (Test-Path $Marker) {
Remove-Item -Force -Verbose $Marker Remove-Item -Force -Verbose $Marker
} }
\ No newline at end of file
Pop-Location
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment