Title: The Windows Installer
1The Windows Installer
2Who am I?
- Derek Noonan
- From Limerick, now working in Dublin as Software
Engineer, specialising in C, BizTalk, SharePoint
with - Industria, ehf
- Industria designs, implements and operates true
broadband networks for utilities, municipalities
and property owners. - An Icelandic company partnering with Magnet
Networks here in Ireland in a fibre-to-the-home
(FTTH) initiative. - URL www.industria.com
3Agenda
- Windows Installer Overview
- Building the Basic Package
- Merge Modules
- Package Enhancements
- Installation and distribution
- The Windows Installer API and Advanced Topics
- .NET, XCOPY deployment and why you still need the
Windows Installer
4Overview- what is the Windows Installer?
- OS-Resident Installation Service
- Created by Microsoft
- Definition for Standard Setup Formats and
Operations - Part of the Zero Administration Windows
Initiative - API and COM Interface
5OverviewFeatures of the Windows Installer
- Consistent installation rules and architecture
- Avoids DLL Hell
- Makes for a more stable desktop
- Data-driven package format
- Self-repair functionality
- Transactional installations
- Feature advertisement
- On-Demand Installations
6OverviewFeatures of the Windows Installer
- Support for patching and updates
- Integrated with Windows 2000 Application
Management functions - Deployed packages run with elevated privileges
- Built-in support for NT Services, ODBC, COM,
Fonts, and more - Customisable installations via transforms
- Silent installations
7OverviewFeatures of the Windows Installer
- Ships as part of Windows 2000
- Available for Windows NT 4.0 and Windows 9x
Systems - Microsoft Web Site (instmsia/w.exe)
- Office
- Setup.exe wrapper
- Not available for Windows NT 3.51 or Windows 3.x
8OverviewDifferences from traditional setups
- Open file format
- No more black box SETUP.EXE files
- No script to maintain or debug
- Different installation hierarchy
- Features
- Components
- No more self-registering files
- Can be used but
9OverviewInside a Windows Installer package
- Custom database format
- Created by setup developer
- One per product
- Described in relational tables
- Products have
- Features
- Components
- Entry points
- Installable resources
- .MSI file extension
10DemonstrationInside a Windows Installer package
11Building the Package
- Obtain the Windows Installer SDK
- Obtain an authoring tool
- InstallShield X (ISX) is used in this
presentation - Aware of other products (Wise, ZeroG, MaSaI
Editor etc.) - Plan your setup process carefully
- Sort elements of your installation into
Components and Features - Identify where Merge Modules can be used
- Identify where Custom Actions are needed
12Building the PackageProducts
- A grouping of Features
- One Product per MSI file
- Identified by a GUID
- Also contains an Upgrade Code
- Entry in the Add/Remove Programs Control Panel
13Building the PackageFeatures
- Grouping of Components, Merge Modules, and/or
other Sub-Features - A single Component can be shared amongst multiple
Features - Functional portion of an application
- Exposed to end-user during a custom installation
- Various install states
- Local, source, advertised, absent
14Building the PackageComponents
- Atomic Unit of the Windows Installer
- Grouping of installable resources and entry
points - Added and removed as one unit
- Shared and refcounted as one unit
- Identified by a GUID
- Components dont share resources
- Not exposed to end-user
- Utilises a key file
15Building the PackageInstallable Resources
- Files
- Registry Entries
- Only those which are not associated with an Entry
Point - Installed on the machine during the installation
phase - During advertisement, these are left off of the
machine until an Entry Point is called or
explicit call for a Feature is made
16Building the PackageKey Files and Entry Points
- Key File
- Identifies the existence of a Component
- Can be a file, registry entry, directory, or ODBC
data source - An MSI shortcut points here
- No two components share the same Key File
- Entry Points
- COM information, CLSIDs, Shell and MIME,
Shortcuts, Command Verbs - Created during the advertisement as well as
installation process
17Building the PackageExample project hierarchy
(Office)
18DemonstrationBuilding a package using
InstallShield X
19Merge ModulesOverview
- Holds information required to install
redistributable component(s) - Installable Resources and Entry Points
- Can include Custom Actions, Dialogs, Sequence
information, etc. - No more calling someone elses setup.exe from
your installation - A standardised Merge Module will be provided
instead - .MSM file extension
20Merge ModulesCreation and Consumption
- Merge Modules can be created by an authoring tool
- You can build your own Merge Modules for internal
use or redistributable components - Onus on vendor for Merge Modules of their
redistributable components - Hook into a Feature upon consumption and can be
shared - MSMs dont contain features
- Can contain dependencies or exclusions of other
Merge Modules
21DemonstrationMerge Module consumption
22Package EnhancementsSequences Overview
- Controls the flow of the installation
- Advertisement, Installation, and Administrative
Sequences - UI Sequence runs on the client side and is not
run during a silent installation - Execute Sequence runs on the server side
- Top-down structure
23Package Enhancements Sequences Overview
- Sequences contain
- Standard Actions
- Custom Actions
- Dialogs
- Conditions on Actions and Dialogs
- Sequence number
24Package Enhancements Custom Action Overview
- Perform operations not available in the Windows
Installer - Can be an EXE, DLL, VB Script, or ECMA-Script
- Can interact with and add entries to the active
installation database via the API - Have access to machine and install state
information via the API
25Package Enhancements Custom Action Utilisation
- Must be written to support multiple scenarios,
such as Install, Remove, Rollback, etc. - Can be added to any UI or Execute Sequence or
attached to a dialog event - Can run synchronously, asynchronously, or be
deferred until the end of the sequence
26Package Enhancements Properties and Conditions
- Properties
- Stored in the PropertyTable
- Can be thought of as variables
- Holds information about the machine and
installation, as well as information that you
insert - Conditions
- Use properties when being evaluated
- Components, Actions, Events, etc. can be made
conditional
27Package Enhancements Customised User Interface
- Internal UI handler
- Does not use resource files
- Authored into package via Dialog, Control, and
ControlEvent tables - Contains standard controls
- Authored into sequences or launched from other
dialogs
28Demonstration Adding a custom action
29Application Installation Transactional
Installation
- All changes made to the system are backed-up
during an installation - System rolls back to the original state if an
error is encountered - Rollback can be disabled, if necessary
- Example Not enough disk space
30Application InstallationAdvertisement
- Packages can be advertised from the command line
or as part of the Windows application deployment
process - Only the Advertise UI and Execute sequences are
run - Entry Points are placed on the target machine
- Installable Resources are installed when an Entry
Point is called (On-Demand Install of required
Features)
31Application InstallationAdvertisement - OS
Support
- gt Windows 2000
- Full advertisement support
- Windows 98
- Full support except CLSID
- Windows 95 and NT 4.0 with IE 4.01 SP 1 and
Desktop Update - Full support except CLSID
- Standard Windows 95 and NT 4.0
- Advertisement is not supported
32Application InstallationOn-Demand Installation
- Individual features can be set during the
installation as install when needed - Usually done through the custom setup selection
dialog - Features marked to install when needed are
advertised to the machine or user
33Application InstallationSelf-Repair
- Windows Installer checks that a Component is
healthy - When an Entry Point is called or if an explicit
call to a component is made through the API - Checks the existence of the key file for all
components in the referenced feature - Performs an On-Demand installation, if necessary
34Windows Installer API Overview
- The Windows Installer API
- Provides functionality to make your application
Windows Installer-aware - Provides enhanced functionality for Custom
Actions - Provides information about the status of
products, features, and components and allows the
on-demand installation of the same
35Windows Installer API Usage in Custom Actions
- Use the Windows Installer API in your Custom
Action to - Send messages to the installation engine
- Add items to the current installation database
- Retrieve information about the machine or
installation state - Read or write Property values
36Windows Installer API Usage in Your Application
- Use the Windows Installer API in your application
to - Enable on-demand installation of features when
required - Enable your application to be self healing when
an error state is encountered - Tightly integrate your application with the
installation engine
37Advanced TopicsPatching and Upgrades
- Utilise a patch file to upgrade a currently
existing Windows Installer installation or
administrative image - Patches can be created via the Windows Installer
API - Patches have an .MSP extension
38Advanced TopicsUtilisation of Transforms
- A Transform is the difference between two MSI
packages - Transforms can be applied on the command-line or
during package deployment - Transforms are created via the API or with an
authoring tool - Administrators can use Transforms to easily
customise packages - Transforms have an .MST extension
39Windows Installer .NET
- If .NET applications are self-registering, why do
I need InstallShield Developer? - XCOPY deployment solves everything or does it?
- Answer is no fine for simple deployment but
40How will Visual Studio .NET impact installations?
- .NET applications are organised as assemblies
- Require the .NET Framework on the target system
- Recommended by Microsoft to use MSI
- Usage of traditional Win32 code
41Windows Installer .NET
- Developers looking to
- Customise directory hierarchies
- Create shortcuts
- Deliver upgrades and Internet-based installations
- Implement license key management
- Create simple uninstallation capabilities
- And many other "standard" features require the
additional authoring capabilities found in
Windows Installer and InstallShield Developer.
42Additional resourcesFurther investigation
- Windows Installer SDK
- http//msdn.microsoft.com/developer/sdk/wininst.as
p - InstallShield
- http//www.installshield.com/
43Finish
44The Windows Installer