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

35 lines
1.5 KiB
PowerShell
Raw Normal View History

# Kopano DeskApp
2018-01-07 18:59:37 +01:00
# 2017-2018 foo.li systeme + software
# https://www.gnu.org/licenses/gpl.txt
$packageName = 'kopano-deskapp-nightly'
$packageSearch = 'Kopano DeskApp'
$installerType = 'msi'
$silentArgs = '/qb'
2018-12-04 22:02:00 +01:00
$version = '2.0.32'
$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'
2018-12-04 22:02:00 +01:00
$checksum = '362D76E37A5CEB0401208D5026DAE58C704A4F31'
$checksumType = 'sha1'
2018-12-04 22:02:00 +01:00
$checksum64 = '3C27C1A2AE6515188A2AB06C3B06260B0AAB1A76'
$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
}