From 3d9250c62edb88c7a9d2a1eac15bb190fb2a3c8b Mon Sep 17 00:00:00 2001 From: Peter Beck Date: Fri, 10 Nov 2017 01:43:55 +0100 Subject: [PATCH] OL Extension 1.6.246, non-retail/retail check office (buggy, will not be accepted from chocolatey) --- .../kopano-ol-extension-nightly.nuspec | 4 +- .../tools/chocolateyinstall.ps1 | 38 ++++++++++++++++--- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/packages/kopano-ol-extension-nightly/kopano-ol-extension-nightly.nuspec b/packages/kopano-ol-extension-nightly/kopano-ol-extension-nightly.nuspec index 73fb024..8765a45 100755 --- a/packages/kopano-ol-extension-nightly/kopano-ol-extension-nightly.nuspec +++ b/packages/kopano-ol-extension-nightly/kopano-ol-extension-nightly.nuspec @@ -2,7 +2,7 @@ kopano-ol-extension-nightly - 1.5.239 + 1.6.246 Kopano Outlook Extension Kopano foo.li systeme + software @@ -12,7 +12,7 @@ true Kopano Outlook Extension (nightly) Kopano OL Extension Nightly (unsupported) - upgrade to 1.5.239 (27-09-2017) + upgrade to 1.6.246 (08-11-2017) 2017 Kopano groupware kopano outlook-extension nightly diff --git a/packages/kopano-ol-extension-nightly/tools/chocolateyinstall.ps1 b/packages/kopano-ol-extension-nightly/tools/chocolateyinstall.ps1 index 53db2da..0df2bee 100755 --- a/packages/kopano-ol-extension-nightly/tools/chocolateyinstall.ps1 +++ b/packages/kopano-ol-extension-nightly/tools/chocolateyinstall.ps1 @@ -6,13 +6,13 @@ $packageName = 'kopano-ol-extension-nightly' $packageSearch = 'Kopano OL Extension' $installerType = 'msi' $silentArgs = '/qb' -$version = '1.5.239' -$intvers = '1.5-239' +$version = '1.6.246' +$intvers = '1.6-246' $url = 'https://download.kopano.io/community/olextension:/KopanoOLExtension-' + $intvers + '-32bit.msi' $url64 = 'https://download.kopano.io/community/olextension:/KopanoOLExtension-' + $intvers + '-64bit.msi' -$checksum = '4B2280751803859E47FC738F1D82A1C92C263C42' +$checksum = '6F877FB2C693681F5E2002C5F9B365372A034C77' $checksumType = 'sha1' -$checksum64 = 'AE4E083F83E78D7E045141ECE8E36DF9F0D18E55' +$checksum64 = '1CA137E458ADEB7241F33CBD82E42E44925A109A' $checksumType64 = $checksumType try { @@ -26,14 +26,40 @@ try { "No need to download and install again. Otherwise uninstall first." ) } else { + #check for outlook + #https://www.reddit.com/r/PowerShell/comments/47lhdt/simple_script_to_check_if_outlook_is_installed/ + #if (Get-ItemProperty HKLM:\SOFTWARE\Classes\Outlook.Application -ErrorAction SilentlyContinue) { + # Write-Output "Outlook found" + #} else { + # Write-Output "Outlook could not be found" + # throw $_.Exception + #} if (get-wmiobject Win32_Product |where {$_.Name -like "*Outlook*" -and $_.Version -ge "15"}) { + #works with non-retail... Write-Output "Outlook 2013 (or higher) seems to be present" Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 ` -checksum $checksum -checksumType $checksumType ` -checksum64 $checksum64 -checksumType64 $checksumType64 } else { - Write-Output "unsupported (or no) Outlook Version detected" - throw $_.Exception + #works with retail versions... + $olkey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE' + $olpath = (Get-ItemProperty $olkey -ErrorAction SilentlyContinue).Path + if ($olpath) { + if (Test-Path $olpath) { + if ($olpath -like "*Office15*") { Write-Host -ForegroundColor DarkYellow "Outlook 2013 detected" } + if ($olpath -like "*Office16*") { Write-Host -ForegroundColor DarkYellow "Outlook 2016 detected" } + Write-Output "Outlook 2013 (or higher) seems to be present" + Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 ` + -checksum $checksum -checksumType $checksumType ` + -checksum64 $checksum64 -checksumType64 $checksumType64 + } else { + Write-Output "unsupported (or no) Outlook Version detected" + throw $_.Exception + } + } else { + Write-Output "unsupported (or no) Outlook Version detected" + throw $_.Exception + } } } } catch {