To deploy java in the enterprise you must download it from http://java.com/en/download/manual.jsp install java on a test virtuel machine and get the MSI files from C:\Users\%username%\AppData\LocalLow\Sun\Java\jre1.8.0_66
I have in the passed deployed java as any other application in SCCM but have seen some problems with different programs opened and there for was Java not upgraded correctly.
The Preinstallation fase is goining to close Internet Explorer, Chrome, Firefox, javacpl, javaw
And uninstall all previous versions of Java
The Post installation fase is setting regkeys to ensure that auto update is disabled
Now I use Powershell App deployment toolkit : http://psappdeploytoolkit.com
Download my Java 1.8.66 packages
Download my Java 1.8.66 x64 packages
My app Deploy-Application.ps1 for Java 1.8.66 look like this:
<#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an “Install” deployment type or an “Uninstall” deployment type.
The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install.
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
.PARAMETER DeploymentType
The type of deployment to perform. Default is: Install.
.PARAMETER DeployMode
Specifies whether the installation should be run in Interactive, Silent, or NonInteractive mode. Default is: Interactive. Options: Interactive = Shows dialogs, Silent = No dialogs, NonInteractive = Very silent, i.e. no blocking apps. NonInteractive mode is automatically set if it is detected that the process is not user interactive.
.PARAMETER AllowRebootPassThru
Allows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation. If 3010 is passed back to SCCM, a reboot prompt will be triggered.
.PARAMETER TerminalServerMode
Changes to “user install mode” and back to “user execute mode” for installing/uninstalling applications for Remote Destkop Session Hosts/Citrix servers.
.EXAMPLE
Deploy-Application.ps1
.EXAMPLE
Deploy-Application.ps1 -DeployMode ‘Silent’
.EXAMPLE
Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
.EXAMPLE
Deploy-Application.ps1 -DeploymentType Uninstall
.NOTES
.LINK
http://psappdeploytoolkit.codeplex.com
#>
[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.66’
[string]$appArch = ”
[string]$appLang = ‘EN’
[string]$appRevision = ’01’
[string]$appScriptVersion = ‘1.0.0’
[string]$appScriptDate = ’11/02/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
## <Perform Pre-Installation tasks here>
# Remove any previous versions of Java
# Uninstall Java 8 Update 66
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F83218066F0}’
# Uninstall Java 8 Update 65
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F83218065F0}’
# 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’
## <Perform Installation tasks here>
Execute-MSI -Action Install -Path “jre1.8.0_66.msi” -Arguments “JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 IEXPLORER=1 MOZILLA=1 deployment.security.level=MEDIUM”
##*===============================================
##* POST-INSTALLATION
##*===============================================
[string]$installPhase = ‘Post-Installation’
## <Perform Post-Installation tasks here>
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
## <Perform Pre-Uninstallation tasks here>
##*===============================================
##* UNINSTALLATION
##*===============================================
[string]$installPhase = ‘Uninstallation’
# <Perform Uninstallation tasks here>
# Remove this version of Java
# Uninstall Java 8 Update 66
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F83218066F0}’
##*===============================================
##* POST-UNINSTALLATION
##*===============================================
[string]$installPhase = ‘Post-Uninstallation’
## <Perform Post-Uninstallation tasks here>
}
##*===============================================
##* 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
}
My app Deploy-Application.ps1 for Java 1.8.66_x64 look like this:
<#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an “Install” deployment type or an “Uninstall” deployment type.
The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install.
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
.PARAMETER DeploymentType
The type of deployment to perform. Default is: Install.
.PARAMETER DeployMode
Specifies whether the installation should be run in Interactive, Silent, or NonInteractive mode. Default is: Interactive. Options: Interactive = Shows dialogs, Silent = No dialogs, NonInteractive = Very silent, i.e. no blocking apps. NonInteractive mode is automatically set if it is detected that the process is not user interactive.
.PARAMETER AllowRebootPassThru
Allows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation. If 3010 is passed back to SCCM, a reboot prompt will be triggered.
.PARAMETER TerminalServerMode
Changes to “user install mode” and back to “user execute mode” for installing/uninstalling applications for Remote Destkop Session Hosts/Citrix servers.
.EXAMPLE
Deploy-Application.ps1
.EXAMPLE
Deploy-Application.ps1 -DeployMode ‘Silent’
.EXAMPLE
Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
.EXAMPLE
Deploy-Application.ps1 -DeploymentType Uninstall
.NOTES
.LINK
http://psappdeploytoolkit.codeplex.com
#>
[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.66 x64’
[string]$appArch = ”
[string]$appLang = ‘EN’
[string]$appRevision = ’01’
[string]$appScriptVersion = ‘1.0.0’
[string]$appScriptDate = ’08/27/2015′
[string]$appScriptAuthor = ‘Per Larsen – http://osddeployment.dk’
##*===============================================
##* 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
## <Perform Pre-Installation tasks here>
# Remove any previous versions of Java
# Uninstall Java 8 Update 65
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F86418066F0}’
# Uninstall Java 8 Update 65
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F86418065F0}’
# 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-2F83218051F0}’
# Uninstall Java 8 Update 45
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83218045F0}”
# Uninstall Java 8 Update 31
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83218031F0}”
# Uninstall Java 8 Update 25
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83218025F0}”
# Uninstall Java 7 Update 67
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F03217067FF}”
# Uninstall Java 7 Update 60
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F03217060FF}”
# Uninstall Java 7 Update 55
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217055FF}”
# Uninstall Java 7 Update 51
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217051FF}”
# Uninstall Java 7 Update 45
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217045FF}”
# Uninstall Java 7 Update 40
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217040FF}”
# Uninstall Java 7 Update 25
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217025FF}”
# Uninstall Java 7 Update 21
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217021FF}”
# Uninstall Java 7 Update 17
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217017FF}”
# Uninstall Java 7 Update 16
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217016FF}”
# Uninstall Java 7 Update 15
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217015FF}”
# Uninstall Java 7 Update 14
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217014FF}”
# Uninstall Java 7 Update 13
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217013FF}”
# Uninstall Java 7 Update 12
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217012FF}”
# Uninstall Java 7 Update 11
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217011FF}”
# Uninstall Java 7 Update 10
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217010FF}”
# Uninstall Java 7 Update 9
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217009FF}”
# Uninstall Java 7 Update 8
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217008FF}”
# Uninstall Java 7 Update 7
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217007FF}”
# Uninstall Java 7 Update 6
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217006FF}”
# Uninstall Java 7 Update 5
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217005FF}”
# Uninstall Java 7 Update 4
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217004FF}”
# Uninstall Java 7 Update 3
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217003FF}”
# Uninstall Java 7 Update 2
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217002FF}”
# Uninstall Java 7 Update 1
Execute-MSI -Action Uninstall -Path “{26A24AE4-039D-4CA4-87B4-2F83217001FF}”
##*===============================================
##* INSTALLATION
##*===============================================
[string]$installPhase = ‘Installation’
## <Perform Installation tasks here>
Execute-MSI -Action Install -Path “jre1.8.0_66.msi” -Arguments “JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 IEXPLORER=1 MOZILLA=1 deployment.security.level=MEDIUM”
##*===============================================
##* POST-INSTALLATION
##*===============================================
[string]$installPhase = ‘Post-Installation’
## <Perform Post-Installation tasks here>
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
## <Perform Pre-Uninstallation tasks here>
##*===============================================
##* UNINSTALLATION
##*===============================================
[string]$installPhase = ‘Uninstallation’
# <Perform Uninstallation tasks here>
# Remove this version of Java
# Uninstall Java 8 Update 65
Execute-MSI -Action Uninstall -Path ‘{26A24AE4-039D-4CA4-87B4-2F86418066F0}’
##*===============================================
##* POST-UNINSTALLATION
##*===============================================
[string]$installPhase = ‘Post-Uninstallation’
## <Perform Post-Uninstallation tasks here>
}
##*===============================================
##* 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
}
Thanks for the guide! The MSI location is actually here now – C:\Users\%username%\AppData\LocalLow\Oracle\Java (Oracle, not Sun anymore apparently!)
Just a few other things;
* Do you set “Deploy-Application.exe Install NonInteractive” in your in the SCCM package?
* Since Chrome no longer supports Java does that browser need to be closed, or will it stop installation from proceeding if left running?
* In the “UNINSTALLATION” phase of your x64 deployment you are still referencing Update 65 instead of Update 66 ;D
Keep up the great work – would love to see some more common apps deployed this way, I’m just starting out with PSADT so it’s been a bit of a learning curve!