Deploying client applications is becoming more complex Larger applications Multiple packages Complex dependencies Difficult to patch
All of this makes for a bad user experience…
Application Deployment Today
Multiple UAC promptsLong installation times
Files left over after a failed install or uninstall
Unnecessary add/remove programs control panel entries
Application Deployment Today
Windows Installer Transaction Terminology
Foo.msi
Install
Disk
Acquisition: Determine the
state of the system and create an install script to run at a later time.
Ex: What version of foo.dll is installed?
Execution: Run the install
script created to update the state of the system. While updating the system, create a rollback script for usage when needed.
Ex: Copy foo.dll to the disk.
Commit: Finalize the
transaction. There is no way to undo a commit.
Ex: Commit assemblies to GAC.
Acquisition Phase
Execution Phase
Commit Phase
Rollback
Multi-Package Transaction
Foo.msi
Chainer Transaction
RollbackUninstall
Foo.msi
Install
Bar.msiFailure
Rollback
Install
Bar.msiFailure
Install
Multi-Package Transaction
UAC credential prompt: Per-transaction versus Per-package
Reboot Handling
Transaction boundary
Multi-package PFR handling
Files in use handling
Transaction owner semantics
Transaction can be embedded in MSI package
Multi-Package Transaction Semantics –Windows Installer
Foo.msi
Install
Acquire the state of the machine.Ex: Check the version of Foo.exe and decide if you want to copy Foo.exe.
Acquisition Early Execution
Fool.msi
Acquisition Early Execution
Update the state of the machine using the install script created in acquisition phase.Sample operations: 1. Backup Foo.exe if one exists.2. Create an undo op-code for this operation.3. Copy Foo.exe.
Acquire the state of the machine.Update the system.1. Backup the old version of Fool. 2. Note down an undo op-code in rollback script.3. Copy Fool.exe.
Late Commit
FailureRollback
Run the rollback scripts for Fool and Foo in LIFO order to rollback the transaction
WordWord
Outlook
Installs Spell Checker v12.0
Installs Spell Checker v12.5
Updates Spell Checker to v12.6
Install Word Install Outlook Apply a patch to Word Uninstall the patch to Word
WordOutlook
Word Patch
Word
Outlook
Updates Spell Checker to v12.0
Design Change: Windows Installer patch uninstall behavior should consider the global machine state instead of just the product state
Requirement: Ability to keep the highest version of a shared component when a patch to it is uninstalled
Windows Installer Patching Improvements
Installs Spell Checker v12.0
Installs Spell Checker v12.5
Updates Spell Checker to v12.6
Install Word Install Outlook Apply a patch to Word Uninstall the patch to Word
Updates Spell Checker to v12.5
WordWord
Outlook
WordOutlook
Word Patch
Word
Outlook
Spell Checker
12.0
MSI Datastore
Spell Checker 12.0
Word’s cache Spell Checker
12.5
Spell Checker
12.6Spell Checker 12.5
Outlook’s cache Spell Checker
12.5
Windows Installer Patching Improvements
Introduction to .NET 3.5 SP1 Client Profile Need for Smaller Framework, typically for Client Apps.
Subset of assemblies already contained within .NET Framework 3.5 Service Pack 1
Contains the Following, Smaller framework deployment - ~28 MB client deployment
package Smaller, faster client deployment boot strapper Client Application focused feature set: Common Language Runtime (CLR) ClickOnce and Windows Forms
Windows Presentation Foundation (WPF) Windows Communication Foundation (WCF) Visual Studio 2008 SP1 Integration – Applications can be targeted
specifically for the Client Framework subset.
Client Profile Preview Redistributable Packages
Designer Tool that will allow developers to customize the deployment experience of their applications
Uses the Client Profile general purpose bootstrapper to deploy your application and all its prerequisites.
Can be used to deploy applications requiring the Client Profile or full .NET Framework 3.5 SP1
Client Profile Configuration Designer
Client Profile Configuration Designer
Walk-through !!!
No major breaking changes If your installation works on Vista it should
work on Windows 7
Windows Installer 4.5 and .NET Framework SP1 features are in the box Faster and easier deployment with
fewer dependencies
Performance improvements Expect to see 10 – 20% reduction in install operation
times for larger applications
Greater application deployment flexibility Windows Installer 5.0 with per-user
application support
Application Deployment In Win 7
The Value Of Per-User Deployment
Personal Empowerment
• User is in control
• Standard user installs applications on users’ schedule (in accordance with policy)
Safer install and removal of Per-User applications
• Applications are installed to the user’s profile
• Removes risk of corrupted OS state
• One user installing an application doesn’t impact another user
• No elevation necessary for installation
Per-User applications do not support some important OS extension points Set Program Access & Computer Defaults (SPAD) Default Programs
Additionally… Any machine-wide prerequisites must
be installed separately Your package can not install services or drivers Your application can not have a core purpose to serve
all users of the computer, such as anti-virus Patching can only be done when the user is logged-on Per-User deployment is only available on Windows 7
Considering Per-User deployment
Target Standard User
UAC is training wheels for Standard User UAC heuristics detect installers, elevate
your installer even if you did not manifest it
UAC “virtualizes” (fakes) system resources so your application can still think it is bopping HKLM
Do not rely on this stuff It is here for legacy, not for new code
It is disabled for 64-bit Processes
Your code is future-safe if you target the true Standard User
Virtualized Fake
Demo
For the Requesting User
Install for the requesting user, not the current user If user is a Standard User (OTS) then
when they elevate, they become a completely different user
If an application then installs into the current user’s home folder, it will be the Administrator
Best: Don’t configure user during install Instead, do user configuration on first run
Include a manifest in your package Mark “asInvoker”
Visual Studio 2008 adds manifests by default
Don’t have anything with “setup” or “install” in the file name
Further Reading
Client Profile Configuration Designer
http://tinyurl.com/6etrxn
Win Install Builder
http://tinyurl.com/d5ywny
.NET Framework Client Profile Deployment Guide
http://tinyurl.com/qx6a33
Multi Package Transaction – Basics
http://tinyurl.com/cxtlwo
UAC Virtualization Basics and Demo
http://tinyurl.com/rdtvee
Read more @ w w w . m s i g e e k .c o m
Thank You…