Sync common files - 2020-07-02

This commit is contained in:
Urs Roesch
2020-07-02 00:13:48 +00:00
parent ed0bf0824f
commit db45940bca
4 changed files with 35 additions and 13 deletions
+1
View File
@@ -1,4 +1,5 @@
*.exe
Data/
App/AppInfo/pac_installer_log.ini
App/Git
Download
+1 -1
View File
@@ -4,6 +4,6 @@ Display = 2.27.0-beta4-uroesch
[Archive]
URL1 = https://github.com/git-for-windows/git/releases/download/v2.27.0.windows.1/PortableGit-2.27.0-32-bit.7z.exe
Checksum1 = SHA256:8cbe1e3b57eb9d02e92cff12089454f2cf090c02958080d62e199ef8764542d3
Checksum1 = SHA256::8cbe1e3b57eb9d02e92cff12089454f2cf090c02958080d62e199ef8764542d3
TargetName1 = Git
ExtractName1 =
+6 -9
View File
@@ -11,7 +11,7 @@ Using module ".\PortableAppsCommon.psm1"
# -----------------------------------------------------------------------------
# Globals
# -----------------------------------------------------------------------------
$Version = "0.0.2-alpha"
$Version = "0.0.3-alpha"
$Debug = $True
$SiteUrl = "https://github.com"
$ReleaseUrl = "$SiteUrl/uroesch/$AppName/releases/"
@@ -79,24 +79,21 @@ Function Invoke-Installer() {
param(
[string] $Command
)
Set-Location "$AppRoot\.."
$PARoot = (Get-Location)
$Arguments = "/AUTOCLOSE=true " +
"/DESTINATION=""$(ConvertTo-WindowsPath $PARoot)\\"""
# Addtional Switches for paf.exe
# /HIDEINSTALLER=true
# /SILENT=true
Switch (Test-Unix) {
$True {
Set-Location "$AppRoot\.."
$PARoot = (Get-Location)
$Arguments = "/SILENT=true /AUTOCLOSE=true /DESTINATION=""$(ConvertTo-WindowsPath $PARoot)\\"""
$Arguments = "$Command $Arguments"
$Command = "wine"
break
}
default {
Set-Location "$AppRoot"
$AppRoot = (Get-Location)
$Arguments = "/AUTOCLOSE=true /DESTINATION=""$(ConvertTo-WindowsPath $AppRoot)"""
}
default { }
}
Debug info "Run PA $Command $Arguments"
+27 -3
View File
@@ -10,6 +10,7 @@
$AppRoot = $(Convert-Path "$PSScriptRoot\..\..")
$AppName = (Get-Item $AppRoot).Basename
$AppDir = "$AppRoot\App"
$DownloadDir = "$AppRoot\Download"
$AppInfoDir = "$AppDir\AppInfo"
$AppInfoIni = "$AppInfoDir\appinfo.ini"
$UpdateIni = "$AppInfoDir\update.ini"
@@ -191,6 +192,25 @@ Function Debug() {
Write-Host $Message.Replace($(Switch-Path "$AppRoot\"), '')
}
# -----------------------------------------------------------------------------
Function Download-Checksum() {
Param(
[String] $Uri
)
Try {
$OutFile = $DownloadDir + "\" + ($Uri.split('/'))[-1]
Invoke-WebRequest `
-Uri $Uri `
-OutFile $OutFile
$Sum = (Get-Content -Path $OutFile)
Return $Sum
}
Catch {
Debug error "Unable to download checksum from URL '$Uri'"
Exit 124
}
}
# -----------------------------------------------------------------------------
Function Compare-Checksum {
param(
@@ -198,7 +218,11 @@ Function Compare-Checksum {
[string] $Checksum
)
($Algorithm, $Sum) = $Checksum.Split(':')
($Algorithm, $Sum) = $Checksum.Split('::')
If ($Sum -like 'http*') {
$Sum = Download-Checksum -Uri $Sum
$Checksum = $Algorithm + "::" + $Sum
}
$Result = Get-Checksum -Path $Path -Algorithm $Algorithm
Debug info "Checksum of INI ($($Checksum.ToUpper())) and download ($Result)"
return ($Checksum.ToUpper() -eq $Result)
@@ -206,12 +230,12 @@ Function Compare-Checksum {
# -----------------------------------------------------------------------------
Function Get-Checksum {
param(
Param(
[string] $Path,
[string] $Algorithm
)
$Hash = (Get-FileHash -Path $Path -Algorithm $Algorithm).Hash
Return ($Algorithm + ":" + $Hash).ToUpper()
Return ($Algorithm + "::" + $Hash).ToUpper()
}
# -----------------------------------------------------------------------------