Deployment Script: Adobe AIR

Topics: Archive - Deployment Scripts
Nov 20, 2013 at 9:01 PM
Hello All,
I just started working with PS App Deploy Toolkit and have very little Powershell experience. I do have a few years of application packaging and automating installations experience though. I really like this wrapper and am hoping this can become a good exchange of info for deploying packages so I am posting the packages i have recently worked on.

This first one is pretty simple AdobeAIR
  • Checks for and removes older version of Adobe AIR
  • Installs Adobe AIR silently and with the EULA being Accepted
  • uninstall section has the correct GUID
    This script performs the installation or uninstallation of an application(s).  
    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,
    Deploy-Application.ps1 -DeploymentType "Silent"
    Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
    Deploy-Application.ps1 -Uninstall 
.PARAMETER DeploymentType
    The type of deployment to perform. [Default is "Install"]
    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.
Param (
    [string] $DeploymentType = "Install",
    [string] $DeployMode = "Interactive",
    [switch] $AllowRebootPassThru = $false

Try {

# Variables: Application

$appVendor = "Adobe"
$appName = "AIR"
$appVersion = ""
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "11/18/2013"
$appScriptAuthor = "Joseph Noxon"

# 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


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
    # -CloseApps "iexplore" -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt

    # Show Progress Message (with the default message)

    # Perform pre-installation tasks here
    # Remove any previous versions of Adobe AIR
    Remove-MSIApplications "Adobe AIR"

$installPhase = "Installation"

    # Perform installation tasks here
    Execute-Process -FilePath "AdobeAIRInstaller.exe" -Arguments "-silent -eulaAccepted"

$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
} ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"

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

    # Show Progress Message (with the default message)

    # Perform uninstallation tasks here
    # Remove this version of Adobe AIR
    Execute-MSI -Action Uninstall -Path "{52E225FC-FCB4-41F7-837B-6E37FB05BD7B}"

} } 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
Additional information from Adobe on deploying AdobeAIR:

To run the Adobe AIR installer silently, start the Adobe AIR installer with the following command-line options:

-silent {-eulaAccepted -pingbackAllowed ( -location <loc> ) -desktopShortcut -programMenu} path

silent—The -silent option tells the AIR installer to run in silent mode.

eulaAccepted—With the optional -eulaAccepted option specified, if the AIR application installer installs Adobe AIR, it records acceptance of the Adobe AIR end-user license agreement (EULA). The Adobe AIR installer records this acceptance for all users of the target computer.
Important: Use the -eulaAccepted option only if your organization has agreed to the Adobe AIR end-user license agreement. You can only specify the -eulaAccepted option if the organization has agreed to the Adobe AIR end-user license for all users of the computer. You can only specify the -eulaAccepted option for deployment within an intranet.
If you do not include the -eulaAccepted option and Adobe AIR is installed during a silent installation, Adobe AIR will later present the Adobe AIR end-user license agreement to each user of the machine. Users see the end-user license agreement (with the option to accept it) upon first running an AIR application.
If used, specify the -eulaAccepted option immediately after the -silent option.

pingbackAllowed — Allows the installer to check for updates to the AIR runtime and report a successful install to Adobe over the Internet. No identifying information is transmitted.
location—The optional -location option provides the location (an absolute file system path) to install the AIR application. The default location is the standard application installation location.

desktopShortcut—The optional -desktopShortcut option causes the installer to install a desktop shortcut for the installed AIR application. If you do not specify this option, no desktop shortcut is installed.

programMenu—The optional -programMenu option causes the installer to install a program menu shortcut for the installed application (on Windows). If you do not specify this option, no program menu shortcut is installed.
path—The path option specifies the path to the AIR file to install.
The AIR application installer installs the correct version of Adobe AIR on the target computer, as required by the AIR application to be installed. For example, if the AIR application to be installed requires the AIR 1.1 runtime, and the end user’s computer has only AIR 1.0 installed (or no version of AIR installed), the installation process installs the AIR 1.1 runtime along with the AIR application. The version of the AIR application installer must be compatible with the version required by the AIR application.

You cannot use the silent installer option to update an installed AIR application. This is because the AIR installer cannot determine whether the version to be installed is newer than the installed version, and it would pose a security risk to downgrade the application.

To install or update the runtime only, use the -silent option without specifying a path or any other options.

Silent uninstallation

You can silently uninstall an AIR application using the ARH utility.