New Java 1.8.60 has been released – How to upgrade with psappdeploytoolkit – Mobile-First Cloud-First
[CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateSet(‘Install’,’Uninstall’)] [string]$DeploymentType = ‘Install’, [Parameter(Mandatory=$false)] [ValidateSet(‘Interactive’,’Silent’,’NonInteractive’)] [string]$DeployMode = ‘Interactive’, [Parameter(Mandatory=$false)] [switch]$AllowRebootPassThru = $false, [Parameter(Mandatory=$false)] [switch]$TerminalServerMode = $false
)
Try { ## Set the script execution policy for this process
Try { Set-ExecutionPolicy -ExecutionPolicy ‘ByPass’ -Scope ‘Process’ -Force -ErrorAction ‘Stop’ } Catch {}
##*=============================================== ##* VARIABLE DECLARATION ##*=============================================== ## Variables: Application [string]$appVendor = ‘Oracle’ [string]$appName = ‘Java’ [string]$appVersion = ‘8.60 x64’ [string]$appArch = ” [string]$appLang = ‘EN’ [string]$appRevision = ’01’ [string]$appScriptVersion = ‘1.0.0’ [string]$appScriptDate = ’08/27/2015′
[string]$appScriptAuthor = ‘Per Larsen – https://osddeployment.wordpress.com’
##*===============================================
##* Do not modify section below
#region DoNotModify
## Variables: Exit Code
[int32]$mainExitCode = 0
## Variables: Script [string]$deployAppScriptFriendlyName = ‘Deploy Application’ [version]$deployAppScriptVersion = [version]’3.6.0′ [string]$deployAppScriptDate = ’03/11/2015′
[hashtable]$deployAppScriptParameters = $psBoundParameters
## Variables: Environment
[string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
## Dot source the required App Deploy Toolkit Functions Try { [string]$moduleAppDeployToolkitMain = “$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1” If (-not (Test-Path -Path $moduleAppDeployToolkitMain -PathType Leaf)) { Throw “Module does not exist at the specified location [$moduleAppDeployToolkitMain].” } . $moduleAppDeployToolkitMain } Catch { [int32]$mainExitCode = 1 Write-Error -Message “Module [$moduleAppDeployToolkitMain] failed to load: `n$($_.Exception.Message)`n `n$($_.InvocationInfo.PositionMessage)” -ErrorAction ‘Continue’ Exit $mainExitCode
}
#endregion ##* Do not modify section above ##*=============================================== ##* END VARIABLE DECLARATION
##*===============================================
If ($deploymentType -ine ‘Uninstall’) { ##*=============================================== ##* PRE-INSTALLATION ##*===============================================
[string]$installPhase = ‘Pre-Installation’
## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
Show-InstallationWelcome -CloseApps ‘iexplore,chrome,firefox,javacpl,javaw’
## Show Progress Message (with the default message)
Show-InstallationProgress
##
# Remove any previous versions of Java
# Uninstall Java 8 Update 60 Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F86418060F0}’ # Uninstall Java 8 Update 51 Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F86418045F0}’ # Uninstall Java 8 Update 45 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86418040F0}” # Uninstall Java 8 Update 31 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86418031F0}” # Uninstall Java 8 Update 25 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86418025F0}” # Uninstall Java 7 Update 67 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F06417067FF}” # Uninstall Java 7 Update 60 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F06417060FF}” # Uninstall Java 7 Update 55 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417055FF}” # Uninstall Java 7 Update 51 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417051FF}” # Uninstall Java 7 Update 45 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417045FF}” # Uninstall Java 7 Update 40 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417040FF}” # Uninstall Java 7 Update 25 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417025FF}” # Uninstall Java 7 Update 21 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417021FF}” # Uninstall Java 7 Update 17 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417017FF}” # Uninstall Java 7 Update 16 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417016FF}” # Uninstall Java 7 Update 15 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417015FF}” # Uninstall Java 7 Update 14 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417014FF}” # Uninstall Java 7 Update 13 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417013FF}” # Uninstall Java 7 Update 12 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417012FF}” # Uninstall Java 7 Update 11 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417011FF}” # Uninstall Java 7 Update 10 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417010FF}” # Uninstall Java 7 Update 9 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417009FF}” # Uninstall Java 7 Update 8 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417008FF}” # Uninstall Java 7 Update 7 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417007FF}” # Uninstall Java 7 Update 6 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417006FF}” # Uninstall Java 7 Update 5 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417005FF}” # Uninstall Java 7 Update 4 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417004FF}” # Uninstall Java 7 Update 3 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417003FF}” # Uninstall Java 7 Update 2 Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417002FF}” # Uninstall Java 7 Update 1
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F86417001FF}”
##*=============================================== ##* INSTALLATION ##*===============================================
[string]$installPhase = ‘Installation’
##
Execute-MSI -Action Install -Path “jre1.8.0_60.msi” -Arguments “JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 IEXPLORER=1 MOZILLA=1 deployment.security.level=MEDIUM”
##*=============================================== ##* POST-INSTALLATION ##*===============================================
[string]$installPhase = ‘Post-Installation’
## Set-RegistryKey -Key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy’ -Name EnableAutoUpdateCheck -Value 0 Set-RegistryKey -Key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy’ -Name EnableJavaUpdate -Value 0 Set-RegistryKey -Key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy’ -Name NotifyDownload -Value 0 Set-RegistryKey -Key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy’ -Name NotifyInstall -Value 0 ## Display a message at the end of the install #Show-InstallationPrompt -Message “You can customize text to appear at the end of an install or remove it completely for unattended installations.” -ButtonRightText ‘OK’ -Icon Information -NoWait } ElseIf ($deploymentType -ieq ‘Uninstall’) { ##*=============================================== ##* PRE-UNINSTALLATION ##*===============================================
[string]$installPhase = ‘Pre-Uninstallation’
## Show Welcome Message, close Internet Explorer with a 60 second countdown before automatically closing
#Show-InstallationWelcome -CloseApps ‘iexplore,chrome,firefox,javacpl,javaw’ -CloseAppsCountdown 60
## Show Progress Message (with the default message)
Show-InstallationProgress
##
##*=============================================== ##* UNINSTALLATION ##*===============================================
[string]$installPhase = ‘Uninstallation’
# # Remove this version of Java # Uninstall Java 8 Update 60
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F86418060F0}’
##*=============================================== ##* POST-UNINSTALLATION ##*===============================================
[string]$installPhase = ‘Post-Uninstallation’
##
}
##*=============================================== ##* END SCRIPT BODY
##*===============================================
## Call the Exit-Script function to perform final cleanup operations Exit-Script -ExitCode $mainExitCode } Catch { [int32]$mainExitCode = 60001 [string]$mainErrorMessage = “$(Resolve-Error)” Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName Show-DialogBox -Text $mainErrorMessage -Icon ‘Stop’ Exit-Script -ExitCode $mainExitCode
}