Application packaging is a process of binding the relevant files and components to build a customized application for a customer. Using tools like Wise Package Studio and Install Shield we carry out the whole process of packaging.
In this article we depict the phenomenon of Application Packaging and suggest certain tips for efficient packaging.
Overview of Installer Engine
On Windows, the installer consists of two executable components: a Client Install Engine that runs with user privileges and an Install Service that can run with elevated administrative privileges because it is implemented as a Windows Service. All changes to the system configuration are done as a single installation transaction by the Install Service.
The transaction provides for rollback of a failed or aborted installation. The rollback includes restoring the original contents of files replaced or deleted during the installation and restoring overwritten or deleted registry settings (such as COM class registration). Since this rollback information can take up a significant amount of space, an administrator or user can disable it during installation.
In addition to the install package for the product being installed, the installer can apply a "transform." This is a method of customizing the package for a specific group of users. Transforms can be used to disable or enable certain installation features, or even add additional items to the installation (for example, to add customer-specific content to the rollout of a product).
Introduction to Windows Installer Technology
Windows Installer Technology offers many advantages to developers and systems admins. Standardization of installs and uninstalls will simplify an administrator's job by creating one set of rules for file overwrites, instead of leaving rule selection up to individual developers. Windows Installer also includes many other features for easier development that the installation author can automatically include in the install.
The Windows Installer service was designed to support every phase of the application management life cycle, providing a service to support each step involved in managing a desktop application from deployment through retirement. To support these functions, the Windows Installer needs to receive instructions from an installation package.
Previously, installation packages took the form of a setup.exe file. Unfortunately, inconsistencies in the way independent software vendors and internal software development groups created these installation files sometimes led to complications when administrators attempted to manage automated installations.
The emerging standard is for Windows Installer to use the msiexec.exe program to process the installation packages at an end user's PC. The packages follow a standardized database structure containing the information that Windows Installer requires to install or uninstall an application and to run the user interface for the setup. Each installation package includes an .msi file containing the installation database, a summary information stream, and data streams for various parts of the installation. The .msi file can also contain one or more transforms, internal source files, and external source files or cabinet files required by the installation. This approach enables Windows Installer to determine components that belong to an application, and to safely remove application components and restore a system to a working state. Furthermore, because Windows Installer is a service, it is designed to support software installations as the local Administrator role in locked environments, enhancing the application process.
Windows Installer can support applications installed from a network share -- referred to as an administrative installation -- or locally on an end user's PC. The downside to using a network share can be that systems receive patches or repairs only when they are connected to the network, which may be a consideration for organizations supporting many notebook users.
Why use Windows Installer?
Windows Installer has many built-in functions that save time and effort. One beneficial built-in function is automatic add/remove, uninstall, reinstall, and repair support. If an application is already installed, Windows Installer will detect it and display a maintenance user interface instead of an application install interface. In maintenance mode, Windows Installer detects which parts of an application are installed and can allow a user to add or remove features or reinstall the application. The repair functionality also appears in maintenance mode, but is also automatically run every time a shortcut for the application is activated in Windows 2000. The repair functionality is particularly useful for administrators whose users like to recklessly clean up disk space. The next time the "broken" application runs, Windows Installer checks a key list of files and registry keys, and repairs the application if needed. The install author also gets built-in network install functionality.
Administrators will also benefit from the Installer's advertising feature. Advertising allows an application to appear to be installed, but files are not actually installed on the system until the application is activated through a shortcut, extension, or COM server. Advertising makes an application available on the desktop, but since it's not installed until it is activated, companies save on licensing fees and disk space. Once a user clicks on a shortcut or double-clicks on a file associated with that application, the application installs automatically.
The same functionality can be written into the application itself. For example, an application may have a particular feature that is rarely used, so it is not installed by default. A developer could put Windows Installer API calls in the code that activates that feature to make it install on demand. Using installation on demand saves disk space and avoids requiring the user to exit the program and rerun the setup to install features that aren't installed by default. Using Windows 2000, an administrator can control this process by remotely assigning an application to desktops which simply advertises the product on the destination computer and provides the user with application entry points, such as shortcuts and file extensions. The administrator can also publish the application. Publishing does not provide entry points to the user, but only to other applications through COM.
What does an MSI Consist of??
A Windows Installer installation package can contain everything required to perform an install or uninstall with a user interface. The package file itself is a COM-structured storage file containing the installation database and a summary stream. Optionally, the package file can contain additional streams with the actual file bits compressed in cabinet files. Package files have the extension .msi and are associated with msiexec.exe, which kicks off the installation process.
The Technology Consists of Installer Client, Installer Server and Database (MSI). The installer organizes installations around the concept of components and features, and stores all information about the installation in a relational database (MSI); the process of authoring an installation package broadly entails the following steps:
- Identify the features to be presented to users.
- Organize the application into components.
- Populate the installation database with information.
- Validate the installation package.
The installation database contains tables and relationships like typical relational databases. Each table has one or more columns specified as keys that must be unique for that table. Windows Installer also supports foreign keys. Foreign key columns are usually denoted by the name of the column they reference, followed by an underscore.
Windows Installer file extensions
.msi : Windows Installer Database
.msm : Windows Installer Merge Module
.msp : Windows Installer Patch
.mst : Windows Installer Transforms
.idt : Exported Windows Installer Database Table
.pcp : Windows Installer Patch creation File
.cub : Validation modules.
Installation of a MSI package
There are three ways in which a managed application is installed or removed from the machine. They are:
- Roll back
The MSI Packaged Installation usually takes place in two phases:
The acquisition is further divided into two phases, in which the first phase collects the information from the user and the second phase acquires the information from the MSI database. Over here, the Windows installer will generate the installation and the un-installation scripts.
Once when the required information is collected from the user and the database, the MSI executes the Installation script and kicks off the installation of components.
The Windows installer also has the ability to detect and restore the resources of an application, which are required to make its successful execution.
This process occurs only when it finds an application that is already installed. Over here, an un-installation script is executed and it takes the validating entries from the MSI database and removes the application clearly.
This major feature of MSI Technology is used to obtain clean installation and un-installation of an application. This process is used only during installation or un-installation phase. When an application is terminated or stopped while installing or uninstalling, the roll back restores the system to its previous stable state. This explains that, the files that were added during the intial process of installation will also be removed.
Introduction to Packaging
Application packaging bundles applications and operating systems into a single file called a distribution unit (.msi), which makes it easier to deploy and install them on user's computers. Packaging reduces the total cost of ownership (TCO) for the customers by enabling them to efficiently install and configure the applications. This results in an application package, which provides the product with new capabilities like advertise features without installing them, installs products on demand, add user customizations etc.
These are the stages of the application packaging life-cycle:
- Package request
- Technical Evaluation of the Source
- Quality Assurance (QA)
- User Acceptance Testing (UAT)
Advantages of Packaging(creating MSI packages)
- Customize Applications to suit the user needs.
- Simplify the Installation and Un-installation Procedures.
- Saves Time in both Installation and Un-installation.
- Once packaged, applications can be quickly installed on a range of desktops in multiple locations, saving administrative costs, simplifying the manage of licensing fees and minimizing support and repair expenditures.
- Saves Space of the product by doing apt modifications to applications.
- Has a great flexibility of obtaining the lost files through a phenomenon called Self Heal, this reduces the down time of application. If a critical file (a .DLL or .EXE file, for example) that is part of the distribution is corrupt or is deleted, the user can be prompted to repair the installation by presenting the original .MSI distribution. Additionally, if the installation media is available (for example, on a network share), the repair simply happens automatically.
- Can be advertised. So that on demand installation could take place.
- Upgrading of the application can be done with ease.
- Clean installation and Un-Installation is achieved by a process called Roll-Back.
- Simplifies management of new user set-up along with the revision and distribution of software repairs and new applications to existing users. Application recovery can also be improved.
- Helps eliminate uncontrolled software downloads and installation, enables applications to be safely removed and reduces non-business traffic on a corporate network.
- Using .MSI format, can automate software distribution process and ensure that the installation doesn't break other applications that have already been installed.
- Application is installed via an OS service.
- State management is maintained. In the past, it's been difficult to know whether an application is installed on a machine. You would have to query for a .DLL with a specific version number or determine whether an .EXE file with a specific name was present. Windows Installer provides an application programming interface (API) that lets programmers and administrators see whether a specific application is installed on a machine.
- Scriptable API. This whips together a VBScript to help us with the MSI file manipulations. The API to manipulate MSI files is so powerful that it can create, validate and update packages, trigger installs and uninstalls, examine the MSI repository data on computers, and perform some custom actions.
- Served installs. Because MSI files can be housed in a share point and delivered via a server, we can keep our installation files all in one place or move them around -- closer to the users if necessary.
Hope this article helps the people who keep their first steps in packaging... :)