This one suppresses autoupdate, hide tray icons, silent install and other cool stuff. Java Update 765
<#
.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 in to 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.
To access the help section,
.EXAMPLE
Deploy-Application.ps1
.EXAMPLE
Deploy-Application.ps1 -DeploymentType "Silent"
.EXAMPLE
Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
.EXAMPLE
Deploy-Application.ps1 -Uninstall
.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.
Interactive = Default mode
Silent = No dialogs
NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
.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.
.NOTES
.LINK
Http://psappdeploytoolkit.codeplex.com
"#>
Param (
[ValidateSet("Install","Uninstall")]
[string] $DeploymentType = "Install",
[ValidateSet("Interactive","Silent","NonInteractive")]
[string] $DeployMode = "Interactive",
[switch] $AllowRebootPassThru = $false
)
*===============================================
* VARIABLE DECLARATION
Try {
*===============================================
*===============================================
Variables: Application
$appVendor = "Oracle"
$appName = "Java Runtime Environment"
$appVersion = "1.7.0_65"
$appArch = "x86"
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "07/28/2014"
$appScriptAuthor = "Whatever"
*===============================================
Variables: Script - Do not modify this section
$deployAppScriptFriendlyName = "Java Update 7u65"
$deployAppScriptVersion = "1/0"
$deployAppScriptDate = "07/28/2014"
$deployAppScriptParameters = $psBoundParameters
Variables: Environment
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition
Dot source the App Deploy Toolkit Functions
."$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
*===============================================
* END VARIABLE DECLARATION
*===============================================
*===============================================
* PRE-INSTALLATION
If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"
*===============================================
# Show Welcome Message, close web browsers if required, and verify there is enough disk space to complete the install
Show-InstallationWelcome -CloseApps "iexplore,chrome,firefox" -CheckDiskSpace -PersistPrompt
# Show Progress Message (with the default message)
Show-InstallationProgress "Do not open any browsers doing so will probably make this installation fail. Call Jose @ x4524 if you have any problems with the java installation."
Show-BalloonTip "Please do not open any browsers during the installation!" -BalloonTipTitle "Updating Java"
# Uninstall any previous JRE version
Remove-MSIApplications "Java(TM) 6 Update"
Remove-MSIApplications "Java 7 Update"
*===============================================
* INSTALLATION
$installPhase = "Installation"
*===============================================
Show-InstallationProgress "We appreciate your time. Remember do not open any browsers. "
# Perform installation tasks here
Execute-MSI -Action Install -Path "jre1.7.0_65.msi" -Parameters "SPONSORS=0 ALLUSERS=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 REBOOT=REALLYSUPPRESS WEBSTARTICON=0 SYSTRAY=0 /qn"
*===============================================
* POST-INSTALLATION
$installPhase = "Post-Installation"
*===============================================
# Disable Java Expiration warning (JRE 7u30+)
Add-Content "$envUserProfile\AppData\LocalLow\Sun\Java\Deployment\deployment.properties" "deployment.expiration.check.enabled=false" -ErrorAction SilentlyContinue
*===============================================
* UNINSTALLATION
} ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"
*===============================================
# Show Welcome Message, close web browsers if required with a 60 second countdown before automatically closing
Show-InstallationWelcome -CloseApps "iexplore,chrome,firefox" -CloseAppsCountdown "60"
# Show Progress Message (with the default message)
Show-InstallationProgress
Show-BalloonTip "Thank you for your patience" -BalloonTipTitle "Installation Completed"
# Perform uninstallation tasks here
Execute-MSI -Action Uninstall -Path "jre1.7.0_65.msi"
*===============================================
* END SCRIPT BODY
} } Catch {$exceptionMessage = "$($_.Exception.Message)
($($_.ScriptStackTrace)
)"; Write-Log "$exceptionMessage"; Show-DialogBox -Text $exceptionMessage -Icon "Stop"; Exit-Script -ExitCode 1} # Catch any errors in this script
Exit-Script -ExitCode 0 # Otherwise call the Exit-Script function to perform final clean-up operations
*===============================================