Click to edit Master title style
Date
01/02/2012 Windows Installer Basics
Content Owner
Dinshaw Shitoot
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Session Objectives
Summary:
This session will enable the engineers to understand the concept and features of
windows Installers and its advantages during application repackaging.
Day Wise Duration:
Day 1 - Windows Installer Basics
Day 2 - Windows Installer Basics Contd.
Target Audience:
IT Engineers with Operating System Knowledge.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Agenda
– Windows Installer
– Windows Installer Architecture
– Windows Installer Service
– Windows Installer Features
– Maintenance Mode
– Windows Installer Extensions
– Command Line Options
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer
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 systems.
Transactional operations. 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. If a failure occurs during
the middle of an installation, Windows Installer can roll back the machine to its
original state.
Windows Installer contains significant changes from its predecessor( Setup API).
Legacy Setups had following drawbacks
– High Support Costs
– Fragile Installs & un-installs
– Difficult & labour Intensive to deploy
Windows Installer comes with an extension .MSI
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer Architecture
Windows Installer works on Client Server Architecture.
Command to Install an MSI
Msiexec /i <Path of MSI>
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer Logging
Windows Installer supports detailed logging as a powerful diagnostic tool. Logging
can be enabled in the following ways:
Command-line: If installing an MSI package from the command-line, the /L switch
can be used to enable logging.
Syntax: msiexec /i <Path of msi> /l*v c:\<Path of Log file>
Windows Registry: The following registry value can be used to enable verbose
logging:
Key: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
Value Name: Logging
Type: REG_SZ
Data: voicewarmup
The resulting log is named MSI###.log (where “###” is a unique random identifier)
and is placed in the system’s Temp directory.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Return Values in Log File
Values returned by
Values that appear
Error Code function calls Description
in the Log.
MsiExec.exe
ERROR_FUNCTION_NOT_CALLED 1626 0 A function could not be executed.
ERROR_SUCCESS 0 1 An action completed successfully.
ERROR_INSTALL_USEREXIT 1602 2 A user canceled installation.
ERROR_INSTALL_FAILURE 1603 3 A fatal error.
The installation suspended,
ERROR_INSTALL_SUSPEND 1604 4
incomplete.
ERROR_SUCCESS 0 5 The action completed successfully.
ERROR_INVALID_HANDLE_STATE 1609 6 The handle is in an invalid state.
ERROR_INVALID_DATA 1626 7 The data is invalid.
Another installation is in progress. Only
one installation at a time can run
ERROR_INSTALL_ALREADY_RUNNING 1618 8 actions in the InstallExecuteSequence,
AdminExecuteSequence, or
AdvtExecuteSequence tables.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer Version
Following are the ways to check the Windows Installer Version:
– Version of "C:\Windows\System32\msi.dll“
– Version of "C:\Windows\System32\msiexec.exe“
– Msiexec.exe /? on command line
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer Service
• The Windows Installer service uses information in a Windows Installer package
file to manage all phases of installing a program like -- add, change, upgrade,
and remove.
• The Windows Installer Service performs all installation tasks like copy files, make
registry changes, create shortcuts etc.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer Service Versions
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Questions and Answers
1. What is Windows Installer ?
2. Explain benefits of Windows Installer over Legacy Setups?
3. Explain Architecture of Windows Installer?
4. What are the various ways to create log file for MSI?
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Exercise on Sand Box
1. Install an Test.MSI
2. Open Task Manager and show client-server instances of msiexec.exe
3. Open a Test.log and show client-server instances of msiexec.exe
4. Explain Return Values of Log File
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
GUID
A globally unique identifier (GUID) is a unique reference number used as an
identifier in computer software. The term GUID also is used for Microsoft's
implementation of the Universally unique identifier (UUID) standard.
The value of a GUID is represented as a 32-character hexadecimal string, such as
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}, and is usually stored as a 128-bit
integer. The total number of unique keys is 2128. This number is so large that the
probability of the same number being generated randomly twice is negligible.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Logical Structure of Package
Products - A single, installed, working program (or set of programs) is a product. A
product is identified by a unique GUID
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 "sub-feature").
Components - A component is the smallest unit of a product installed by an
application —each component is treated by Windows Installer as a unit
Key paths - A key path is a specific file, registry key, or ODBC data source that the
package author specifies as critical for a given component.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer File Extensions
Extension Description
.msi Windows Installer Database.
.msm Windows Installer Merge Module.
.msp Windows Installer Patch.
.mst Windows Installer Transform.
Exported Windows Installer Database
.idt
Table.
.cub Validation module.
.pcp Windows Installer Patch Creation File
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Command Line Options
Windows Installer Command line Options can viewed by typing msiexec /? Or
msiexec /help on command prompt
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Command Line Options
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Questions and Answers
1. What is Windows Installer ?
2. Explain benefits of Windows Installer over Legacy Setups?
3. Explain Architecture of Windows Installer?
4. What are the various ways to create log file for MSI
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Package, Features and Components
Package
Microsoft Office
Features
Excel
Word
PowerPoint
Components
.EXE
.DLL
.TXT
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Windows Installer Features
Windows Installer has following features:
– Installation-On-Demand
– Resiliency
– Customization
– Self Healing
– Rollback
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Installation-On-Demand (Advertisement)
The Windows Installer can advertise the availability of an application to users or
other applications without actually installing the application. If an application is
advertised, only the interfaces required for loading and launching the application
are presented to the user or other applications. If a user or application activates an
advertised interface the installer then proceeds to install the necessary
components.
There are two types of advertising: Assigning and Publishing
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Assigning and Publishing
Assigning applications to users When you assign applications to users, the
application always appears on the user's Start menu regardless of which computer
the user logs on to. When a user starts an assigned application that is not installed
on the local computer, the application will first install and then run
Assigning applications to computers Unlike applications that are assigned to
users, applications that are assigned to computers install the next time the
computer is started
Publishing applications When you publish applications, they do not appear on the
Start menu. Instead, they must be installed manually using Add/Remove Programs
in Control Panel. Add/Remove Programs retrieves the list of published applications
from Active Directory
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Resiliency
Resiliency is the ability of an application to recover gracefully from situations in
which a vital component is missing, or has been replaced by an incompatible
version.
Applications that rely on network resources for installation-on-demand are
susceptible to source failures if the source location should change for any reason or
become damaged. The Windows® Installer provides source resiliency for features
that are installed on-demand by using a source list.
The source list contains the locations searched by the installer for installation
packages. The entries in this list can be network locations, Uniform Resource
Locators (URLs), or compact discs. If one of these sources fails, the installer can
quickly and seamlessly try the next.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Exercise on Source Resiliency
– Install an application from Desktop of Admin
– Create a new user
– Delete some key path
– Change User and Launch the shortcut
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Customization
• The installation of an application or product can be customized for a particular
user or a group
• Add, delete, modify shortcuts and files according to requirement
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Exercise on Customization
– Install an application in Full UI and change Install Directory
– Delete Shortcut
– Change shortcut location
– Select or de-select features/sub feature
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Self Healing
• MSI can detect common installation problems at launch, like missing Files and
Registries and automatically repairs them
• How Self Healing works
– Entry Point is invoked.
– Windows installer checks all key paths in components under the entry point
feature as well as components in the feature's parents, all the way to the top
feature.
– Are any keypaths in the entry point feature or its parents missing or
corrupted?
– If any keypaths is missing or corrupted Windows Installer checks all keypaths
in the entire application.
– The entry point feature gets a feature level repair.
– If any other component is broken in the application, the component is
repaired.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Self Healing
• Causes for self healing
– There are some specific, common events that can cause an application to
begin a self-repair every time a user opens the application.
a. HKEY_Current_User Registry Keys
b. Missing Files/Registry Keys
c. Temporary Files
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Exercise on Self Healing
– Install an application in Admin
– Delete resources having keypath
– Launch shortcut
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Rollback
Restoring the pre-installation state of a computer - Windows Installer keeps track
of all the changes it makes to a computer. Therefore, if you attempt to add, modify,
or remove an application and the action fails, Windows Installer restores the
computer to its previous state. The restoration procedure is known as a rollback.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Exercise on Rollback
– Start installation of an Application
– Cancel Installation in between and demonstrate Rollback
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Questions and Answers
Explain the following:
– Installation-On-Demand
– Resiliency
– Customization
– Self Healing
– Rollback
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Maintenance Mode
After an application has been successfully installed, users may want to return to the
installation to add or remove features. This is known as a maintenance installation.
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Exercise on Maintenance Mode
– Install an Application
– Again install the same application on same build
– Demonstrate Maintenance Mode
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
Questions and Answers
What is Maintenance mode and what are the various options available in
maintenance mode?
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited
COMMERCIAL IN CONFIDENCE © Copyright 2011 ECS Europe Limited