InstallAware for Windows Installer
 

Transform Instance

This command allows new installations of an already installed product on the same system. Normally Windows Installer allows only a single instance of a product to be installed on a computer. Starting setup again with an existing instance allows to modify, repair, or uninstall that instance only. Beginning with Windows Installer 3.0, it is possible to install multiple copies of a product on the same system using instance transforms. However Windows Installer 3.0 or later is required (and this version of Windows Installer is unavailable on Windows 9X operating systems), along with certain restrictions in package authoring which must be observed.

The Transform Instance command allows multiple instances of a product to be installed on all Windows versions, including Windows 9X operating systems, and without any restrictions in package authoring. This command updates internal installer settings and variables to allow reinstallation of an already installed product, as if it had not been installed before. No manual instance transforms are required.

The following table summarizes the variables that are affected by this command:

Variable Change
PRODUCTCODE A new product code identifies the installation as a new product to Windows Installer.
REVISIONCODE A new revision code identifies the setup database as a new product to Windows Installer.
TARGETDIR The destination directory is re-initialized with the default value (instead of the first chosen value).
STARTMENU The start menu folder is re-initialized with the default value (instead of the first chosen value).
ALLUSERS The install for all users/install for just me option is re-initialized with the default value.
MAINTENANCE Reset if another instance of the same version of the product was already installed.
NEEDSUPGRADE Reset if another version of the same product was already installed.
UNINSTALLLINK Set to the new location of the product uninstallation program.

Transform Instance has no effect when used if the NEWINSTANCE variable is FALSE. The NEWINSTANCE pre-defined variable indicates whether the setup may spawn new instances at runtime. New instances may only be spawned when at least one instance of setup has already been installed, and when setup has not been launched from the Control Panel Add-Remove Programs applet for one of the existing instances (which is the only place to repair, modify, or uninstall existing instances in multi-instance setups).

 Warnings

  • After using Transform Instance, the TITLE pre-defined variable must be updated with a unique description of this latest new instance of setup. Because setup instances are identified in the Control Panel Add-Remove Programs applet by their names (as stored in the TITLE variable), each new instance must have a unique name.
  • If the TITLE pre-defined variable is not uniquely updated for each product instance, an existing installation listing in the Control Panel Add-Remove Programs applet may be overwritten when the transformed setup finishes execution. This will orphan the former instance carrying the same name on the system and should be avoided.

 Notes

  • Manually updating the variables updated by Transform Instance does not create a new instance - this command updates certain internal installation properties and must be called when a new instance is required.
  • The Multiple Instances sample installation available in the New Project dialog contains example code which illustrates the correct usage of the Transform Instance command. This code may also be reused in your existing setups to add multiple instance behavior.