15.5 Example FSD

When using the PowerShell script to automate installations, the package settings are read from the registry before installing the second package. So the second package doesn't have a chance to update the package settings. For example, if the application is to be using Just-In-Time Upgrade, the JIT settings need to be specified in the first package. If that is not done the 2nd installs settings are ignored and JIT will not be setup correctly.

Example files for a FSD are provided in the <sysdir>\x_apps\x_featuresets\ folder

fsdExample.ps1 is a powershell script provided that creates a GUI and runs the selected msi's. A few variables are defined at the top that can be used to customize the script's behavior.

The script is essentially controlled by the $installs array. In this sample, the first row needs to be a mandatory install as the following installs use the registry settings from this first install to pass to the subsequent installs.  The "/qb" parameter creates a basic user interface that will show progress but not prompt for input.

The $packageLang and $xplatform are used for finding/reading the registry entries.

The dialog created by this script looks like this:

If the script detects an install has been run before, the checkbox will look like

The install will run again in repair mode or, if input is enabled, will prompt to remove/repair if the install is not an upgrade.

There is a simple wrapper script runFSD.bat which is a windows batch file that calls the PowerShell script.

For this example, Quick Batch File Compiler, a third party tool* which has been used extensively internally by LANSA Inc, is to be used to package up all installation artefacts including the Feature Set selection dialog, scripting tools, application MSIs and MSPs, and third party installation images. Quick Batch File Compiler is easily understood by anyone who is familiar with Windows batch files. It takes a batch file and a set of files to embed and produces an executable which may be flagged as an administrative install and thus an elevated install may be run directly from Windows explorer.

Following is a screen grab of the main user interface in the tool - the editing of the batch file which calls the PowerShell script. If you edit this bat file in Notepad, you will notice a number of REM lines are added that instruct the compiler what to include in the executable. 

* There are many other tools also available to convert batch files into executables.

The script m.bat is a simple windows batch file used to 'compile' the batch file