diff --git a/Other/Update/PortableAppsCommon.psm1 b/Other/Update/PortableAppsCommon.psm1 index 72f9ce4..d6f1f10 100644 --- a/Other/Update/PortableAppsCommon.psm1 +++ b/Other/Update/PortableAppsCommon.psm1 @@ -2,7 +2,7 @@ # Description: Common classes and functions for portable apps powershell # scripts # Author: Urs Roesch -# Version: 0.9.4 +# Version: 0.9.5 # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- @@ -160,6 +160,11 @@ Function Download-Checksum() { # Multiline file with file name suffix Return $Line -replace "^($Pattern)\s+\*?$File", "`$1" } + "^$Pattern\s+.+/$File$" { + # Multiline file with multiple entries e.g. putty + # 2f49ec1e6c35e10c.... w32/putty.zip + Return $Line -replace "^($Pattern)\s+.*", "`$1" + } default { Debug debug "No match in line '$Line'" } diff --git a/Other/Update/Update.ps1 b/Other/Update/Update.ps1 index fcd6582..ff4b450 100644 --- a/Other/Update/Update.ps1 +++ b/Other/Update/Update.ps1 @@ -37,7 +37,7 @@ Param( # ----------------------------------------------------------------------------- # Globals # ----------------------------------------------------------------------------- -$Version = "0.0.35-alpha" +$Version = "0.0.36-alpha" $Debug = $True # ----------------------------------------------------------------------------- @@ -214,10 +214,13 @@ Function Update-Application() { } # ----------------------------------------------------------------------------- -Function Postinstall() { - $Postinstall = "$PSScriptRoot\Postinstall.ps1" - If (Test-Path $Postinstall) { - . $Postinstall +Function Source-InstallScript() { + Param( + [String] $Mode + ) + $Script = "$PSScriptRoot\$Mode.ps1" + If (Test-Path $Script) { + . $Script } } @@ -325,8 +328,9 @@ Function Invoke-Helper() { # Main # ----------------------------------------------------------------------------- $Config = Read-IniFile -IniFile $UpdateIni +Source-InstallScript Preinstall Update-Application Update-Appinfo -Postinstall +Source-InstallScript Postinstall Create-Launcher Create-Installer