Login to participate
Endpoint Management & Virtualization ArticlesRSS

About Transforms

Siddram's picture

What is a Transform

A transform is a special type of Windows Installer file (MST) that customizes a windows installer Installation Package.

What do Transforms do?

A transform is a collection of changes in the form of .mst files that you apply to a base installation package at installation. When you apply transforms to an .msi , Windows Installer can add or modify data in the installation database. This may involve modify information in tables or adding or removing tables completely. Transforms are applied at run-time (using a command line) along with the base MSI to apply changes to that MSI.

Why use a Transform?

By applying a transform to a base MSI (Installation Package), the installer can customize this installation by adding or replacing data in the MSI database.

Although optional you can use transform for a variety reasons including:

  1. Encapsulating numerous customizations of a base package required by different groups. In a large organization you may only need a single .msi file and a library of appropriate transforms for each group of users.
  2. Adding new features to an existing application package e.g. custom corporate-developed Microsoft Excel template.
  3. To replace manufacturers defaults with defaults appropriate to a specific organization. Allows the administrator to eliminate or reduce user intervention.

The installer registers a list of transforms required by the product during the installation. The installer must apply these transforms to the product's installation package when configuring or installing the product. If a listed transform is unavailable, and if the transform source resiliency cannot restore it, the installation fails.

EXAMPLE:

Suppose you are a systems administrator who is deploying a new version of workgroup software. You can use the transform to customize the installation for the needs of different departments. You can turn on multi-language support components for the International Marketing Department, and Install extra spreadsheet functions for the Accounting Department. To achieve this we need to create 2 different transforms based on the main installation of the workgroup software. In each transform you make the specific changes. Then during the installation, you make sure that the appropriate transform is applied for each department.

Transforms alter the installation database and can be used to encapsulate the various customizations of a base package required by different groups of users.

For Example:
In organizations where the Finance and Staff Support departments require different installations of a product, the product's base package can be made available to everyone at one administrative installation point with the appropriate customizations distributed to each group of users separately as transforms. Administrators can also apply multiple transforms on-the-fly during an installation to efficiently assign the most appropriate installation to different users.

Compared to command line modifications Transforms:

  1. Are persistent
  2. Can modify public and private properties
  3. Can modify the registry
  4. Specify the install state (advertised, run locally or run from source)
  5. Make a feature unavailable to users
  6. Add modify or remove shortcuts
  7. Modify the upgrade behavior

How do I apply a transform to an installation?

A transform must be applied to a base installation database during installation; it cannot be applied beforehand. It must be applied using a command line option.

EXAMPLE

To apply a transform while running an installation:

Where MyApp.msi is the name of your .MSI, and TransformName.mst is the name of your transform. Your command line would read as follows:

msiexec /i MyApp.msi TRANSFORMS=TransformName.mst 

Applying Multiple Transforms to an msi

Ensure that the .mst files and the .msi are located in the same location. Ensure command line is changed to display the location of the transform and msi. Use name of msi and transforms (not the full path).

Syntax

msiexec /I app.msi TRANSFORMS=transform1.mst;transform2.mst

EXAMPLE:

Both the msi and mst are located in D:\Data\Dramweaver

Correct command line to use:

D:\Data\Dreamweaver> msiexec /I dreamweaver.msi TRANSFORMS=trans1;trans2

Methods to Run a Transform

Because it is not practical to have your users type a line on the command line to run a transform, we suggest you use one the following three methods to run the transform:

  1. Write a batch file that runs the .MSI along with the appropriate transform.
  2. Use the shortcut that was created with the transform. If you used InstallTailor (available in the Professional version only) to create a transform, a shortcut with the same name as the transform is created along with the transform file. This shortcut's target is set to run the base .MSI and apply the transform.
  3. Output the installation as an executable that launches an .MSI, which gives you the ability to send command line options to the .MSI.

Transforms – Types of Methods

The following are two methods which can be used when applying a transform to an .msi

Dynamic method: Place .mst and msi in same folder and configure installation to reference transform. Original msi unchanged (nb for multiple sets of transform). Multiple sets can be used to for e.g. set an organizations/ department templates followed by another transform specifically adapted for a particular group of users. The transform(s) is applied to the msi at deployment and the customizations are persistent unless the app is uninstalled / installed.

Static method: Run against the administrative image of an application to permanently change the administrative msi. Less commonly used.

Types of Windows Installer Transforms

There are four types:

  • Embedded transforms
  • Unembedded transforms
  • Secured transforms
  • Unsecured transforms

Embedded transforms are stored inside the .msi file of the package. This guarantees to users that the transform is always available when the installation package is available. Alternatively for example if the installation source is read only such as a CD or network share, transforms may be provided to users as stand-alone .mst files. To add an embedded transform to the transforms list, add a colon (:) prefix to the filename. Because the installer can always obtain the transform from storage in the .msi file, embedded transforms are not cached on the user's computer. Embedded transforms may be used in combination with secured or unsecured transforms.

Unembedded transforms are stored separate from the .msi file of the original package and these transforms are cached separately on the user's computer. They may be used in combination with secured or unsecured transforms.

Secured transforms are sometimes necessary for security reasons to prevent users with low rights from modifying an unsecured transform. Secured transforms are stored locally on the user's computer in a location where, on a secure file system, such users don’t have write access. These transforms are cached in this location during the installation or advertisement of the package. During subsequent install-on-demand or administration installation of the package, the installer uses the cached transforms. The removal of the product by any user removes all secured transforms for that product from the user's computer. If the installer finds that a secured transform is not locally available, it then attempts to restore the transform cache from a source. Secure transforms can be secure-at-source (restored from the root of the source of the .msi file) or secure-full-path (restored from the original full path specified by the transforms list): To specify secured transform storage, set the Transform Security policy, set the TRANSFORMSECURE property, or pass the @ or | symbol in the transforms list.

Unsecured Transforms are those that have not been secured as described. When a package is installed or advertised as a per-user installation, and has unsecured transforms, the installer saves the unsecured transforms in the Application Data folder in the user' profile. This enables a user to maintain their customization of a product while moving between computers. When the package is installed or advertised as a per-machine installation, and uses unsecured transforms, the installer saves the unsecured transforms in the %windir%\Installer folder. If the cached copy of the transform becomes unavailable, the installer can restore the transform cache using a source listed in the SOURCELIST property. You cannot include secured and unsecured transforms in the same transforms list.

How to create a Transform based on an Existing .MSI?

  1. From the File menu, select New.
  2. In the New Installation File dialog box, click Other templates, and select Transform and click OK. An Open File dialog box appears.
  3. Find and select the standard installation (.MSI file) on which this transform should be based, and click the Open button. The transform opens with the exact settings of the installation on which it is based. Any changes you make to the base installation settings are stored in the transform.
  4. Make changes to the installation, such as turning features on or off, or
  5. changing any other settings.
  6. When finished making changes, select Save from the File menu. A Save As dialog box appears. Type a name for the transform and click Save.
  7. The Transform Details dialog box appears. Fill out this dialog and click OK.
  8. The transform appears in the location you specified, with an .MST extension.

Information about Transform Details dialog box

The Transform Settings dialog box, which you see when saving a transform file, contains options that flag error conditions of a transform. You set the error conditions that you want to ignore. It also contains validation options. Normally, if the error conditions exist, errors are generated when the transform is applied to the standard installation. In most cases, if you create the transform using Wise for Windows Installer, you can leave the defaults in this dialog box.

Base database

If this transform is applied to a database other than the one specified in this field, an error will be generated during installation.

Suppress Transform Application Errors

The following items let you suppress certain errors if the transform attempts to perform certain operations on the base database. In most cases, you can leave the default settings in this section.

  • Add existing row
    Mark this to suppress errors from occurring if the transform attempts to add a row to the base installation database that already exists.
  • Delete missing row
    Mark this to suppress errors from occurring if the transform attempts to remove a row from the base installation database that doesn’t exist.
  • Add existing table
    Mark this to suppress errors from occurring if the transform attempts to add a table to the base installation database that already exists.
  • Delete missing table
    Mark this to suppress errors from occurring if the transform attempts to delete a table from the base installation database that does not exist.
  • Update missing row
    Mark this to suppress errors from occurring if the transform attempts to update a row in the base installation database that does not exist.
  • Code page mismatch
    Mark this to suppress errors from occurring if the code page (language) setting of the transform does not match that of the base installation database.

Validation

The following items let you require certain conditions to be true for the transform to be applied to the base database.

  • Match Language
    Mark this if the language of the transform must match the language of the base installation database.
  • Match Product
    Mark this if the product code of the transform must match the product code of the base installation database.
  • Match Upgrade Code
    Mark this if the upgrade code of the transform must match the upgrade code of the base installation database.
  • Version Matching
    The version of the installation (set on the Project page in Installation Expert) is in the form AA.BB.CCCC.DDDD, where AA represents the major version, BB represents the minor version, CCCC represents the update version, and DDDD represents the build version. Select an item in the list if you want the version of the transform to be checked against the version of the base installation database. If the versions do not match, an error is generated during installation.
  • Version Relationship
    If you chose to check versions, this list lets you specify what version relationship must be true in order not to generate an error.