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

Simple script to provide a new package for the automatic updater.

Refers to #13
parent 8995790e
No related branches found
No related tags found
No related merge requests found
......@@ -206,7 +206,7 @@ function Update-Configuration {
function Copy-ServiceFiles {
try {
Copy-Item -Recurse -Force -ErrorAction Stop `
-Path "$($UpdateBinariesPath)\*" `
-Path "$($UpdateBinariesPath)\$($ServiceName)\*" `
-Destination "$InstallationPath"
}
catch {
......
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)][String] $UpdaterSettings
)
try {
. $UpdaterSettings
}
catch {
$ex = $_.Exception.Message
Write-Host "Error reading settings file: '$($UpdaterSettings)' [$($ex)]"
Exit
}
$UpdateBinariesPath = "$($UpdateSourcePath)\Service\Binaries"
$Pattern = 'build_[0-9]{4}-[0-9]{2}-[0-9]{2}_'
$PackageDir = Get-ChildItem -Directory -Name |
Where-Object {$_ -match $Pattern} |
Sort-Object |
Select-Object -Last 1
if ([string]::IsNullOrEmpty($PackageDir)) {
Write-Host "ERROR: couldn't find any directories matching '$($Pattern)'!"
Exit
}
try {
# exclude some files not be distributed:
$Exclude = @("ScriptsConfig.ps1", "Install-Service.ps1")
Copy-Item -Recurse -Force -ErrorAction Stop `
-Path $PackageDir `
-Exclude $Exclude `
-Destination $UpdateBinariesPath
Write-Host "Copied package [$($PackageDir)] to [$($UpdateBinariesPath)]."
}
catch {
$ex = $_.Exception.Message
Write-Host "Error copying service package: $($ex)"
Exit
}
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