PowerShell App Deployment Toolkit

1. PowerShell App Deployment Toolkit

1.1 Introduction

The PowerShell App Deployment Toolkit provides a set of functions to perform common application deployment tasks and to interact with the user during a deployment.

It simplifies the complex scripting challenges of deploying applications in the enterprise, provides a consistent deployment experience and improves installation success rates.

The engine can be downloaded here: http://psappdeploytoolkit.com/

 

1.2 Sample

For example, let’s create an installation package for Adobe Flash Player.

Here is the installation process of the Flash Player package:

  • Installation of the ActiveX component (MSI + MST)
  • Installation of the Plugin component (MSI + MST)
  • Check of the OS architecture
    • If 64-bit: Copy mms.cfg file in both C:\System32 and C:\SysWOW64
    • If 32-bit: Copy mms.cfg file in C:\System32 only
  • Creation of the inventory registry entries

 

2. Package Structure

An installation package is composed of the following elements:

padt-01

Deploy-Application.exe is the main launcher. It allows to run the ps1 file.

Deploy-Application.ps1 is the script which lists all actions to perform to install the package.

 

2.1 “AppDeployToolkit” Folder

The “AppDeployToolkit” folder contains the engine of the framework.

  • AppDeployToolkitBanner.png is the banner displayed on the GUI and must be sized 450×50 px.
  • AppDeployToolkitConfig.xml is the configuration file of the engine. It can be modified to change general settings of the engine (standard texts in the prompts, standard delay before timeout…)
  • Ps1 files are the engine itself.

 

2.2 “Files” Folder

The “Files” folder contains the setup files of the package (MSI, MST, EXE, config files…)

padt-02

 

3. Deploy-Application.ps1

3.1 Variable Declaration

Variables used by the engine have to be defined.

 

3.2 Pre-Installation Phase

The “Pre-Installation phase” is used to perform all actions to execute before the installation of the package (kill processes, uninstall previous version…).

It can also be used to display prompts to the logged user before starting the installation.

 

3.2.1 Welcome Message

padt-03

 

3.2.2 Close Application Message

padt-04

 

In this example, iexplore, firefox and chrome processes must be closed before installation.

The “BlockExecution” argument prevents the user to launch them during installation.

The “ForceCloseAppsCountdown” argument allows closing those processes at the end of the specified countdown.

 

3.2.3 Progress Message

padt-05

 

It’s the prompt displayed during the installation of the package.

The following tray balloon is also displayed:

padt-06

 

3.3 Installation Phase

The “Installation phase” is used to install the package silently.

 

3.4 Post-Installation Phase

The “Post-Installation phase” is used for all post-actions to perform and display the end message.

 

3.4.1 Post-Actions

For example, implement the inventory in the registry:

 

3.4.2 End Install Message

padt-07