Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-Update to partially fix 31 #36

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions package/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,28 @@ else {
}
}

# verify the 64 bit installation, if the update is not found attempt a second update
[array]$32_or_64bitsoftware = get-itemproperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
[array]$32_on_64bitsoftware = get-itemproperty 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
$installedProducts = [system.linq.enumerable]::union([object[]]$32_or_64bitsoftware, [object[]]$32_on_64bitsoftware)
if (($installedProducts | Where-Object {(($_.DisplayName -contains 'Adobe Acrobat (64-bit)') -or ($_.DisplayName -contains 'Adobe Acrobat Reader')) -and ($_.DisplayVersion.replace('.', '') -eq $UpdaterVersion)} | measure).Count -lt 1){
$UpdateArgs = @{
Statements = "/p `"$mspPath`" /norestart /quiet ALLUSERS=1 EULA_ACCEPT=YES $options" +
" /L*v `"$env:TEMP\$env:chocolateyPackageName.$env:chocolateyPackageVersion.Reupdate.log`""
ExetoRun = 'msiexec.exe'
validExitCodes = @(0, 1603)
}
$exitCode = Start-ChocolateyProcessAsAdmin @UpdateArgs

if ($exitCode -eq 1603) {
Write-Warning "For code 1603, Adobe recommends to 'shut down Microsoft Office and all web browsers' and try again."
Write-Warning 'The update log should provide more details about the encountered issue:'
Write-Warning " $env:TEMP\$env:chocolateyPackageName.$env:chocolateyPackageVersion.Update.log"
Throw "Patching of $env:ChocolateyPackageName to the latest version was unsuccessful."
}
}


if ($PackageParameters.NoUpdates -or $UpdateMode -lt 2) {
Unregister-ScheduledTask 'Adobe Acrobat Update Task' -Confirm:$false -ErrorAction SilentlyContinue
}