Windows Installer
Encyclopedia
The Windows Installer (previously known as Microsoft Installer) is a software component used for the installation, maintenance, and removal of software on modern Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 systems. The installation information, and often the files themselves, are packaged in installation packages, loosely relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

s structured as OLE
Object Linking and Embedding
Object Linking and Embedding is a technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control eXtension , a way to develop and use custom user interface elements...

 COM Structured Storages and commonly known as "MSI files", from their default file extension. Windows Installer contains significant changes from its predecessor, Setup API. New features include a GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

 framework
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...

 and automatic generation of the uninstallation sequence. Windows Installer is positioned as an alternative to stand-alone executable installer frameworks such as older versions of InstallShield
InstallShield
InstallShield is a software tool for creating installers or software packages. InstallShield is primarily used for installing software for Microsoft Windows desktop and server platforms, but it can also be used to manage software applications and packages on a variety of handheld and mobile devices...

 and Wise
Wise Solutions, Inc.
Wise Solutions, Inc. is an American company that makes software tools for creating application installers. Their primary product, Wise was one of the most widely used installation packages for Windows. Their main competitor is InstallShield by Flexera Software. Wise Solutions was acquired and...

 (later versions of both products are based on Windows Installer) and NSIS
Nullsoft Scriptable Install System
Nullsoft Scriptable Install System is a script-driven Windows installation system with minimal overhead backed by Nullsoft, the creators of Winamp...

.

Microsoft encourages third parties to use Windows Installer as the basis for installation frameworks, so that they synchronize correctly with other installers and keep the internal database of installed products consistent. Important features such as rollback and versioning depend on a consistent internal database for reliable operation. Furthermore, Windows Installer facilitates the principle of least privilege
Principle of least privilege
In information security, computer science, and other fields, the principle of least privilege, also known as the principle of minimal privilege or just least privilege, requires that in a particular abstraction layer of a computing environment, every module must be able to access only the...

 by performing software installations by proxy for unprivileged users.

Logical structure of packages

A package describes the installation of one or
more full products (Windows Installer does not
handle dependencies between products) and is universally
identified by a GUID (the PackageCode property). A product is made up of components,
grouped into features.

Products

A single, installed, working program (or set of programs) is a product.
A product is identified by a unique GUID (the ProductCode property) provides an authoritative identity throughout the world. The GUID, in combination with the version number (ProductVersion property) allow for release management of the software's files and registry keys.
A product is not the same as a package: a package is identified by a unique GUID (stored in the Summary Information Stream) and provides identity and release management for all the contents of the .MSI file. Release management of a Product pertains only to changes in the files and registry keys that make up a software application. Release management of a package includes the package logic and other meta data that relates to how the package executes when running. For example, changing an EXE in the software application may require the ProductCode and/or ProductVersion to be changed for release management of the software application. Only adding a launch condition (with the software application remaining exactly the same as the previous version) would still require the PackageCode to change for release management of the .MSI file itself.

Features

A feature is a hierarchical group of components—a feature can contain any number of components and other features (a feature contained in another feature is called a "subfeature"). Many software packages only involve one feature. More complex installation programs usually display a "custom setup" dialog box at run time, from which the end user can select which features to install or remove.

The package author defines the product features. A word-processing program, for example, might provide features for the main program executable, the program's help files, and optional spelling checker and stationery modules.

Components

A component is the atomic part of a product—each component is treated by Windows Installer as a unit: the install developer cannot, for example, use a condition to specify to install just part of a component. Components can contain file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

s, directories
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

, COM
Component Object Model
Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...

 components, registry
Windows registry
The Windows Registry is a hierarchical database that stores configuration settings and options on Microsoft Windows operating systems. It contains settings for low-level operating system components as well as the applications running on the platform: the kernel, device drivers, services, SAM, user...

 keys, shortcuts, and other data. The end user does not directly interact with components.

Components are identified globally by GUIDs, thus the same component can be shared among several features of the same package or multiple packages, ideally through the use of Merge Module
Merge Module
A merge module is a special kind of Windows Installer database that contains the components needed to install a discrete software bundle. A merge module cannot be installed alone, but must be merged into a standard Windows Installer installation during the creation of the installation...

s (although, for this to work correctly, different components should not share any sub-components).

Key paths

A key path is a specific file, registry key, or ODBC
Open Database Connectivity
In computing, ODBC is a standard C interface for accessing database management systems . The designers of ODBC aimed to make it independent of database systems and operating systems...

 data source that the package author specifies as critical for a given component. Because a file is the most common type of key path, the term key file is commonly used. A component can contain at most one key path; if a component has no explicit key path, the component's destination directory is taken to be the key path. When an MSI-based application is launched, Windows Installer checks the existence of these critical files or registry keys (that is, the key paths). If there is a mismatch between the current system state and the value specified in the MSI package (e.g., a key file is missing), then the related feature is re-installed. This process is also known as self-healing or self-repair. No two components should use the same key path.

User interface

The user interface
User interface
The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

 phase typically queries the target system and displays an installation wizard and enables the user to change various options that will affect the installation.

However, the user interface sequence should not make any changes to the system. Three reasons for this are as follows.
  1. A user can install an MSI package in quiet mode, bypassing this phase entirely, by running the msiexec.exe command-line utility with the /qn (or /qb or /qr) option and specifying on the command line all the information that the wizard would normally gather. Therefore, any actions that occur in the user interface sequence will not be performed during a silent installation.
  2. Similarly, clicking the Remove button in the Add or Remove Programs panel runs a product's uninstaller with a basic user interface, again with the result that any actions that occur in the user interface sequence will not be performed.
  3. Actions that make system changes should not be scheduled in the user interface sequence as the user interface sequence runs with user privileges, and not with elevated privileges, as described in the following section.


Actions in the user interface sequence of a normal installation are defined in the InstallUISequence table. Similarly, there is an AdminUISequence in which can be placed dialog boxes and actions to display and perform from within an administrative installation wizard.

Execute

When the user clicks the Finish or Install button in a typical MSI installation wizard, installation proceeds to the Execute phase, in which software components are actually installed. The Execute phase makes system changes, but does not display any user-interface elements.

Execute phase happens in two steps:

Immediate mode. In this phase, Windows Installer receives instructions, either from a user or an application, to install or uninstall features of a product. The requests cause the execution of sequences of actions, which query the installation database to build an internal script describing the execution phase in detail.

Deferred mode. In this phase, the script built in immediate mode is executed in the context of the privileged Windows Installer service
Windows Service
On Microsoft Windows operating systems, a Windows service is a long-running executable that performs specific functions and which is designed not to require user intervention. Windows services can be configured to start when the operating system is booted and run in the background as long as...

 (specifically, the LocalSystem account). The script must be executed by a privileged account because of the heterogeneity of the scenarios in which a setup operation is initiated—for example, elevated privileges are necessary to serve on-demand installation requests from non-privileged users. (In order to run with elevated privileges, however, the package must be deployed by a local administrator or advertised by a system administrator using Group Policy
Group Policy
Group Policy is a feature of the Microsoft Windows NT family of operating systems. Group Policy is a set of rules that control the working environment of user accounts and computer accounts. Group Policy provides the centralized management and configuration of operating systems, applications, and...

.)

Execute sequence actions for a normal installation are stored in the InstallExecuteSequence table. An MSI database can also contain AdminExecuteSequence and AdvtExecuteSequence tables to define actions to perform for administrative and advertised installations.

Rollback

All installation operations are transactional. For each operation that Windows Installer performs, it generates an equivalent undo operation that would undo the change made to the system. In case any script action fails during deferred execution, or the operation is cancelled by the user, all the actions performed until that point are rolled back, restoring the system to its original state. Standard Windows Installer actions automatically write information into a rollback script; package authors who create custom actions that change the target system should also create corresponding rollback actions (as well as uninstallation actions and uninstallation-rollback actions). As a design feature, if applied correctly this mechanism will also rollback a failed uninstall of an application to a good working state.

Advertisement

Windows Installer can advertise a product rather than actually installing it. The product will appear installed to the user, but it will not actually be installed until it is run for the first time by triggering an entry point (by means of a Start menu shortcut, by opening a document that the product is configured to handle, or by invoking an advertised COM class). A package can be advertised by an administrator using Group Policy or other deployment mechanism, or by running the msiexec executable with the /jm (for per-machine advertisement) or /ju (for per-user advertisement) switch. It should also be noted that some MSI packages authored in Installshield may prevent the use of these and other Native MSI features.

The user must have administrator privileges to complete the advertised installation; in most workplaces, end users are not administrators and this method of distribution will fail. Microsoft created a workaround via Group Policies to "Elevate user privileges" during MSI installations. This is often seen by system administrators as compromising security since any MSI would automatically gain administrator privileges.

Installation on demand

Similar to advertisement, it consists in the installation of features as soon as the user tries to use them.

Administrative installation

An administrative installation creates an uncompressed source image for a product, typically to be used for installing or running an application from a network location. An administrative installation is not a typical installation, in that it does not create any shortcuts, register COM servers, create an Add or Remove Programs entry, and so on. Often an administrative installation enables a user to install the product in such a way that its features run from the uncompressed installation source.

Administrative installations are also useful when creating a Windows Installer patch, which requires uncompressed images of the earlier and current versions of a product in order to compute binary file differences. An administrative installation is performed by running the msiexec executable with the /a switch.

Custom actions

The developer of an installer package may write code to serve their own purpose, delivered in a DLL. This can be executed during the installation sequences, including when the user clicks a button in the user interface, or during the InstallExecuteSequence. Custom Actions typically validate product license keys, or initialise more complex services. Developers should normally provide inverse custom actions for use during uninstallation.

Msiexec provides a way to break after loading a specified custom action DLL but before invoking the action.http://msdn.microsoft.com/en-us/library/aa368264%28VS.85%29.aspx

Merge modules and nested executables

A Windows Installer package may contain another package to be installed at the same time. These are ideally provided as a .msm file component, but may also be a separate executable program which will be unpacked from the installer package during the InstallExecuteSequence and can be run immediately. The file can then optionally be deleted before the end of the InstallExecuteSequence, and so is ideal for using with older installers.

Miscellaneous

Windows Installer allows applications to run directly from a network share, without the need for a local copy (run from source); it can repair broken installations by restoring damaged or deleted files, registry
Windows registry
The Windows Registry is a hierarchical database that stores configuration settings and options on Microsoft Windows operating systems. It contains settings for low-level operating system components as well as the applications running on the platform: the kernel, device drivers, services, SAM, user...

 entries and application shortcuts; it supports per-user installation of applications; it can resolve component identifiers into paths, allowing applications to avoid hard-coded file paths; and it natively supports patches (.msp files made out of patch creation properties) and other customizations of packages through manipulations (transforms or .mst files) of a package's relational database. Version 2.0 onwards, it supports digital signature
Digital signature
A digital signature or digital signature scheme is a mathematical scheme for demonstrating the authenticity of a digital message or document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender, and that it was not altered in transit...

s and version 3.0 onwards, delta compression
Binary delta compression
Binary delta compression is a technology used in software deployment for distributing patches.- Explanation :Downloading large amounts of data over the internet for software updates can induce high network traffic problems, especially when a network of computers is involved...

 for patches.

It is also unique among installation software frameworks for Windows in that it is highly transparent. The full API and all command-line options are documented; packages are freely viewable and editable, both with free tools and programmatically (as opposed to the proprietary and even weakly encrypted packages of InstallShield
InstallShield
InstallShield is a software tool for creating installers or software packages. InstallShield is primarily used for installing software for Microsoft Windows desktop and server platforms, but it can also be used to manage software applications and packages on a variety of handheld and mobile devices...

); and the format for file archives is the well documented cabinet
Cabinet (file format)
In computing, CAB is the Microsoft Windows native compressed archive format. It supports compression and digital signing, and is used in a variety of Microsoft installation engines: Setup API, Device Installer, AdvPack and Windows Installer.Though Cabinet was originally called Diamond, its .CAB...

 file format.

File extraction only

Individual files can be extracted from an .MSI file without carrying out a full installation, either by using the Installer with an appropriate command line  or by certain third-party software such as 7-zip.
NOTE: Not all files can be extracted using these methods such as different version of a file getting installed based on option will fail to be properly extracted

Windows Vista

Windows Installer 4.0, which was shipped with Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

, incorporates new capabilities to take advantage of Vista's User Account Control
User Account Control
User Account Control is a technology and security infrastructure introduced with Microsoft's Windows Vista and Windows Server 2008 operating systems, with a more relaxed version also present in Windows 7 and Windows Server 2008 R2...

 architecture. MSI packages can be marked as not requiring elevated privileges to install, thus allowing a package to install without prompting the user for Administrator credentials (provided that the installation does not write to any areas that a regular user does not have access to, including Program Files). Windows Installer also works in conjunction with the Restart Manager; when installing or updating an application or system component with "full" user interface mode, the user will be displayed a list of affected applications that can be shut down, and then restarted after files have been updated. Installer actions running in silent mode perform these application restarts automatically. System services and tray applications can also be restarted in this manner.

Developing installer packages

Creating an installer package for a new application is non-trivial. It is necessary to specify which files must be installed, to where, with what registry keys. Any non-standard operations can be done using Custom Actions, which are typically developed in DLLs. There are a number of commercial and freeware products to assist in creating MSI packages, including Visual Studio, InstallShield
InstallShield
InstallShield is a software tool for creating installers or software packages. InstallShield is primarily used for installing software for Microsoft Windows desktop and server platforms, but it can also be used to manage software applications and packages on a variety of handheld and mobile devices...

, Installaware, Wise Installer, Advanced Installer and WiX
WiX
The Windows Installer XML , is a free software toolset that builds Windows Installer packages from an XML document. It supports a command-line environment that developers may integrate into their build processes to build MSI and MSM setup packages...

. To varying degrees, the user interface and behaviour in less common situations such as unattended installation, may be configured. Once prepared, an installer package is "compiled" by reading the instructions and files from the developer's local machine, and creating the .msi file.

The user interface (dialog boxes) presented at the start of installation can be changed or configured by the setup engineer developing a new installer. There is a limited language of buttons, textfields and labels which can be arranged in a sequence of dialogue boxes. An installer package should be capable of running without any UI, for what is called "unattended installation".

ICE validation

Microsoft provides a set of Internal Consistency Evaluators, or ICEs, that can be used to detect potential problems with an MSI database. The ICE rules are combined into CUB files, which are stripped-down MSI files containing custom actions that test the target MSI database's contents for validation warnings and errors. ICE validation can be performed with the Platform SDK tools Orca and msival2, or with validation tools that ship with the various authoring environments.

For example, some of the ICE rules are:
  • ICE09: Validates that any component destined for the System folder is marked as being permanent.
  • ICE24: Validates that the product code, product version, and product language have appropriate formats.
  • ICE33: Validates that the Registry table is not used for data better suited for another table (Class, Extension, Verb, and so on).


Addressing ICE validation warnings and errors is an important step in the release process.

Versions

Version Included with Also available for
1.0 Office 2000
1.1 Windows 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...

 RTM, SP1, SP2
Windows 95
Windows 95
Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...

/98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...


Windows NT 4.0
Windows NT 4.0
Windows NT 4.0 is a preemptive, graphical and business-oriented operating system designed to work with either uniprocessor or symmetric multi-processor computers. It was the next release of Microsoft's Windows NT line of operating systems and was released to manufacturing on 31 July 1996...

 SP6
1.2 Windows Me
Windows Me
Windows Millennium Edition, or Windows Me , is a graphical operating system released on September 14, 2000 by Microsoft, and was the last operating system released in the Windows 9x series. Support for Windows Me ended on July 11, 2006....

2.0 Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

 RTM, SP1
Windows 2000 SP3, SP4
Windows Server 2003
Windows Server 2003
Windows Server 2003 is a server operating system produced by Microsoft, introduced on 24 April 2003. An updated version, Windows Server 2003 R2, was released to manufacturing on 6 December 2005...

 RTM
Windows 95/98/Me
Windows NT 4.0 SP6
Windows 2000 RTM, SP1, SP2
3.0 Windows XP SP2 Windows 2000 SP3, SP4
Windows XP RTM, SP1
Windows Server 2003 RTM
3.1 Windows XP SP3
Windows Server 2003 SP1, SP2
Windows XP Professional x64 Edition RTM, SP2
Windows 2000 SP3, SP4
Windows XP RTM, SP1, SP2
Windows Server 2003 RTM
4.0 Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

 RTM, SP1
Windows Server 2008 RTM
4.5 Windows Vista SP2
Windows Server 2008 SP2
Windows XP SP2, SP3
Windows Server 2003 SP1, SP2
Windows XP Professional x64 Edition RTM, SP2
Windows Vista RTM, SP1
Windows Server 2008 RTM
5.0 Windows 7 RTM
Windows Server 2008 R2
Windows Server 2008 R2
Windows Server 2008 R2 is a server operating system produced by Microsoft. It was released to manufacturing on July 22, 2009 and launched on October 22, 2009. According to the Windows Server Team blog, the retail availability was September 14, 2009. It is built on Windows NT 6.1, the same core...

 RTM


To check which version is currently installed, type msiexec /? into the Windows Run box or command prompt.

Tools

Name Description License
Microsoft Visual Studio
Microsoft Visual Studio
Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

Microsoft Visual Studio is capable of building Windows Installer Deployment projects that can create installer packages. Proprietary software
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

InstallShield
InstallShield
InstallShield is a software tool for creating installers or software packages. InstallShield is primarily used for installing software for Microsoft Windows desktop and server platforms, but it can also be used to manage software applications and packages on a variety of handheld and mobile devices...

Proprietary software
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

InstEdit "InstEd is a Free msi editor built for professionals." Paid version with more features available also. Freeware
Freeware
Freeware is computer software that is available for use at no cost or for an optional fee, but usually with one or more restricted usage rights. Freeware is in contrast to commercial software, which is typically sold for profit, but might be distributed for a business or commercial purpose in the...

Wise Installer
Wise Solutions, Inc.
Wise Solutions, Inc. is an American company that makes software tools for creating application installers. Their primary product, Wise was one of the most widely used installation packages for Windows. Their main competitor is InstallShield by Flexera Software. Wise Solutions was acquired and...

Proprietary software
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

WiX
WiX
The Windows Installer XML , is a free software toolset that builds Windows Installer packages from an XML document. It supports a command-line environment that developers may integrate into their build processes to build MSI and MSM setup packages...

WiX (Windows Installer XML) is a free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

 set of tools that helps build a Windows Installer packages from an XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 document. It can be either used from command-line or integrated into Microsoft Visual Studio. SharpDevelop has a nice implementation for creating MSI packages using WIX
Common Public License
Common Public License
In computing, the CPL is a free software / open-source software license published by IBM. The Free Software Foundation and Open Source Initiative have approved the license terms of the CPL....

IsWiX Industrial Strength Windows Installer XML ( IsWiX ) is a document editor based on the Fireworks Application Framework. IsWiX enables non-setup developers to collaborate with setup developers using WiX projects. Microsoft Public License (Ms-PL)
7-Zip
7-Zip
7-Zip is an open source file archiver. 7-Zip operates with the 7z archive format, but can read and write several other archive formats. The program can be used from a command line interface, graphical user interface, or with Microsoft Windows shell integration. 7-Zip began in 1999 and is actively...

7-Zip is a multipotent open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 file archiver
File archiver
A file archiver is a computer program that combines a number of files together into one archive file, or a series of archive files, for easier transportation or storage...

 utility, and can extract the contents of MSI files.
GNU Lesser General Public License
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT License...


See also

  • List of installation software
  • Windows Installer CleanUp Utility
    Windows Installer CleanUp Utility
    The Windows Installer CleanUp Utility was a software utility for the Microsoft Windows operating system designed to solve uninstallation problems of programs that use the Windows Installer technology. It looks up registry references and files related to Windows Installer that were installed by...

  • Installation
    Installation (computer programs)
    Installation of a program is the act of putting the program onto a computer system so that it can be executed....

  • ZAP File
    ZAP File
    A .ZAP File is a text file, which allows the publishing of an application to a user on a Microsoft Windows system , for applications for which a .MSI file does not exist...

    - a way to perform an Application Installation when no MSI File exists.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK