chocolatey/packages/kopano-deskapp-nightly/tools/chocolateyinstall.ps1

35 lines
1.5 KiB
PowerShell
Raw Normal View History

# Kopano DeskApp
# 2017 foo.li systeme + software
# https://www.gnu.org/licenses/gpl.txt
$packageName = 'kopano-deskapp-nightly'
$packageSearch = 'Kopano DeskApp'
$installerType = 'msi'
$silentArgs = '/qb'
2017-08-28 16:07:54 +02:00
$version = '1.3.22'
$url = 'https://download.kopano.io/community/deskapp:/Windows/kopano-deskapp-' + $version + '-x86.msi'
$url64 = 'https://download.kopano.io/community/deskapp:/Windows/kopano-deskapp-' + $version + '-x64.msi'
2017-10-07 17:25:12 +02:00
$checksum = 'F3AED8F07604DF6F048A155173B19398031BB896'
$checksumType = 'sha1'
2017-10-07 17:25:12 +02:00
$checksum64 = '6D7D262114CFB0942F1231F7AAF7514BFB2E9EC3'
$checksumType64 = $checksumType
try {
$app = Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*') `
-ErrorAction:SilentlyContinue | Where-Object { $_.DisplayName -like $packageSearch }
if ($app -and ([version]$app.DisplayVersion -ge [version]$version)) {
Write-Output $(
'Kopano DeskApp ' + $version + ' or greater is already installed. ' +
'No need to download and install again. Otherwise uninstall first.'
)
} else {
Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 `
-checksum $checksum -checksumType $checksumType `
-checksum64 $checksum64 -checksumType64 $checksumType64
}
} catch {
throw $_.Exception
}