-
Notifications
You must be signed in to change notification settings - Fork 371
/
chocolateyInstall.ps1
39 lines (34 loc) · 1.44 KB
/
chocolateyInstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$packageName = 'flashplayeractivex'
$version = '32.0.0.156'
$majorVersion = '32'
$registry = ( Get-UninstallRegistryKey -SoftwareName "Adobe Flash Player $majorVersion ActiveX" ).DisplayVersion
$checking = ( $registry -eq $version )
$alreadyInstalled = @{$true = "Adobe Flash Player ActiveX for IE $version is already installed."; $false = "Adobe Flash Player ActiveX for IE $version is not already installed."}[ $checking ]
$allRight = $true
if ([System.Environment]::OSVersion.Version -ge '6.2') {
$allRight = $false
Write-Output $packageName $('Your Windows version is not ' +
'suitable for this package. This package is only for Windows XP to Windows 7')
}
if (Get-Process iexplore -ErrorAction SilentlyContinue) {
$allRight = $false
Write-Output $packageName 'Internet Explorer is running. ' +
'The installation will fail an 1603 error. ' +
'Close Internet Explorer and reinstall this package.'
}
if ( $checking ) {
$allRight = $false
Write-Output $alreadyInstalled
}
if ($allRight) {
$packageArgs = @{
packageName = $packageName
fileType = 'msi'
url = 'https://download.macromedia.com/pub/flashplayer/pdc/32.0.0.156/install_flash_player_32_active_x.msi'
silentArgs = '/quiet /norestart REMOVE_PREVIOUS=YES'
softwareName = 'Adobe Flash Player ActiveX'
checksum = '2260e1e47f95a65e8c3d9e3003de2342fbf39a735c65af1e1bcc807af871eaed'
checksumType = 'sha256'
}
Install-ChocolateyPackage @packageArgs
}