The Windows Installer - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

The Windows Installer

Description:

From Limerick, now working in Dublin as Software Engineer, specialising in C#, ... Can be an EXE, DLL, VB Script, or ECMA-Script ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 45
Provided by: derekn3
Category:

less

Transcript and Presenter's Notes

Title: The Windows Installer


1
The Windows Installer
  • Derek Noonan

2
Who 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

3
Agenda
  • 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

4
Overview- 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

5
OverviewFeatures 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

6
OverviewFeatures 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

7
OverviewFeatures 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

8
OverviewDifferences 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

9
OverviewInside 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

10
DemonstrationInside a Windows Installer package
11
Building 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

12
Building 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

13
Building 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

14
Building 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

15
Building 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

16
Building 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

17
Building the PackageExample project hierarchy
(Office)
18
DemonstrationBuilding a package using
InstallShield X
19
Merge 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

20
Merge 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

21
DemonstrationMerge Module consumption
22
Package 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

23
Package Enhancements Sequences Overview
  • Sequences contain
  • Standard Actions
  • Custom Actions
  • Dialogs
  • Conditions on Actions and Dialogs
  • Sequence number

24
Package 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

25
Package 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

26
Package 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

27
Package 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

28
Demonstration Adding a custom action
29
Application 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

30
Application 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)

31
Application 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

32
Application 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

33
Application 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

34
Windows 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

35
Windows 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

36
Windows 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

37
Advanced 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

38
Advanced 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

39
Windows 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

40
How 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

41
Windows 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.

42
Additional resourcesFurther investigation
  • Windows Installer SDK
  • http//msdn.microsoft.com/developer/sdk/wininst.as
    p
  • InstallShield
  • http//www.installshield.com/

43
Finish
  • QA

44
The Windows Installer
  • Derek Noonan
Write a Comment
User Comments (0)
About PowerShow.com