diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index a29605ce9b989c58b0b6a32055060ff9a4fa8ef6..9f2a170fe84d139eb4e561738a6c9ef66cd9a0cc 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -336,6 +336,23 @@ function NewConfig-IsValid { } +function Find-InstallationPackage { + Write-Verbose "Looking for installation package using pattern: $($Pattern)" + $PkgDir = Get-ChildItem -Path $UpdPathBinaries -Directory -Name | + Where-Object {$_ -match $Pattern} | + Sort-Object | + Select-Object -Last 1 + + if ([string]::IsNullOrEmpty($PkgDir)) { + Log-Error "couldn't find installation package matching '$($Pattern)'!" + Exit + } + $PkgDir = "$($UpdPathBinaries)\$($PkgDir)" + Write-Verbose "Found update installation package: [$($PkgDir)]" + Return $PkgDir +} + + function Copy-ServiceFiles { try { Write-Verbose "Looking for source package using pattern: $($Pattern)"