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

37 lines
1.4 KiB
PowerShell
Raw Normal View History

2017-08-02 15:10:42 +02:00
# Kopano ADS (mmc extension)
# 2017 foo.li systeme + software
# https://www.gnu.org/licenses/gpl.txt
2017-08-02 15:10:42 +02:00
$packageName = 'kopano-ads-nightly'
$packageSearch = 'Kopano ADS'
$installerType = 'msi'
$silentArgs = '/qb'
$version = '1.0.71'
$intversion = '1.0-71'
$url = 'https://download.kopano.io/community/adextension:/KopanoADS-' + $intversion + '-noarch.msi'
$url64 = $url
$checksum = '306C64A745CC796F38A28DC8E367EB28E90B5CC0'
$checksumType = 'sha1'
$checksum64 = $checksum
$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 ADS ' + $version + ' or greater is already installed. ' +
'No need to download and install again. Otherwise uninstall first.'
)
} else {
if (Get-Process 'mmc' -ea SilentlyContinue) { Stop-Process -processname 'mmc' -Force -ea SilentlyContinue }
Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 `
-checksum $checksum -checksumType $checksumType `
-checksum64 $checksum64 -checksumType64 $checksumType64
}
} catch {
throw $_.Exception
}