Configuration Manager

Published on March 27th, 2014 | by Christian Fosund

PADT: Deploy Adobe Flash Player 12.0.0.70

Hello!
This is the script I have been using to deploy Adobe Flash Player.
Its based on the awsome toolkit PowerShell App Deployment Toolkit by Sean Lillis
It will uninstall all previous versions of Flash and also prompt the user to close any running browsers.

You can get the offical toolkit from CodePlex:
https://psappdeploytoolkit.codeplex.com/

<#
.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 = "Adobe"
$appName = "Flash Player"
$appVersion = "12.0.0.70"
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.1"
$appScriptDate = "03/04/2014"
$appScriptAuthor = "Christian Fosund"

#*===============================================
# Variables: Script - Do not modify this section

$deployAppScriptFriendlyName = "Deploy Application"
$deployAppScriptVersion = "3.0.7"
$deployAppScriptDate = "10/24/2013"
$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 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,firefox"
# -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt

# Show Progress Message (with the default message)
Show-InstallationProgress

# Perform pre-installation tasks here
# Uninstall Previous versions of Adobe Flash Player
Remove-MSIApplications "Adobe Flash Player"
#*===============================================
#* INSTALLATION
$installPhase = "Installation"
#*===============================================

# Get the OS version
$osVersion = [version]$($envOS.version)

# Install Flash Player ActiveX Control for IE (for OSes prior to Windows 8)
If ($osVersion -lt 6.2) {
Execute-MSI -Action Install -Path "install_flash_player_12_active_x.msi"
}
# Install Flash Player Plugin (Firefox / Adobe Reader)
#Execute-MSI -Action Install -Path "install_flash_player_11_plugin.msi"

# Set Adobe Flash Config file to stop Auto-Updates (32-bit)
Copy-File -Path "$dirSupportFiles\mms.cfg" -Destination "$envWindir\system32\Macromed\Flash\mms.cfg"
# Set Adobe Flash Config file to stop Auto-Updates (64-bit)
Copy-File -Path "$dirSupportFiles\mms.cfg" -Destination "$envWindir\SysWOW64\Macromed\Flash\mms.cfg"

#*===============================================
#* POST-INSTALLATION
$installPhase = "Post-Installation"
#*===============================================

# Perform post-installation tasks here

# Display a message at the end of the install
# Show-InstallationPrompt -Message "You can customise text to appear at the end of an install, or remove it completely for unattended installations." -ButtonRightText "Ok" -Icon Information -NoWait

#*===============================================
#* UNINSTALLATION
} ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"
#*===============================================

# Show Welcome Message, close Internet Explorer if required with a 60 second countdown before automatically closing
Show-InstallationWelcome -CloseApps "iexplore,firefox"
# -CloseAppsCountdown "60"

# Show Progress Message (with the default message)
Show-InstallationProgress

# Perform uninstallation tasks here
# Uninstall Flash Player Plug-in for Active-X (IE) Browsers
Remove-MSIApplications "Adobe Flash Player"
#*===============================================
#* 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 cleanup operations
#*===============================================

Tags: , , , , ,


About the Author

Christian is a senior consultant and MCT, specialized in the products System Center Configuration Manager and Microsoft Deployment Toolkit, and has been responsible for design and implementation of complex environments, spread geographically throughout the world. He’s also experienced in third party solutions like 1E Nomad that can make implementations more valuable and profitable in an efficient manner.



Back to Top ↑