Installation Requirements. Agenda Installation requirements Installation options Installing to...

Preview:

Citation preview

Installation RequirementsInstallation Requirements

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Installation Requirements• Use Windows components for installation• Support User Account Control for

installation• Install to correct folders• Sign ClickOnce manifests• Keep ClickOnce installations isolated• Correctly configure package identity• Install Windows resources properly• Follow best practices for creating custom

actions• Avoid reboots during installation• Support command-line installation• Follow component rules

Lea Galanter
I was confused in the first sentence about why it says "Windows Installer (MSI), when the name of the product has previously been identified as Microsoft Software Installer? I just checked the Windows Server SG, and it indicates NOT to use MSI except as part of a named component, e.g., the MsiSetInternalUI function, and to use "Windows Installer" instead. Can you please change throughout this presentation to comply with these style guidelines?

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command line installation• Following component rules• Installation test cases

Installation Options

• Applications must use Windows Installer (MSI) or ClickOnce for installation– Follows good setup design– Are safer– Evolves with operating system– Preferred by enterprise customers

Windows Installer 4.0

• Efficient installation and configuration

• Mature and proven technology• Reduces TCO• Better corporate deployment• No need to create Windows Vista–

specific packages• Meets most installation requirements

Supporting UAC for Installation

• Installation requires privileges• Installer must have an embedded

manifest• User must provide approval• Installer detects setup programs• Windows Installer engine

automatically enables and follows UAC

Configuring Package Identity• Correct identification in Software

Explorer• Supply all required information by

using Windows Installer properties– ProductName– Manufacturer– ProductVersion

• Application upgrade properties– UpgradeCode– ProductCode– ProductVersion– ProductLanguage

Restart Manager

• Check if files that require updating are in use

• Shut down applications, apply the update, restart

• Applications listen to shutdown messages, and save state without prompting user

• Applications restart as if they were never shut down

• If system restart is unavoidable, schedule to minimize disruption

Using Restart Manager

• Windows Installer 4.0 automatically uses Restart Manager

• Files-in-use dialog boxes• ForceReboot action should not be

used• Custom actions call Restart Manager

APIs

Uninstalling Applications

• Windows Installer follows clean uninstall logic– All nonshared application files and folders– Shared application files with refcount=0– Unshared registry entries– Start menu shortcuts created on installation– Option to remove user data

• Reinstall without errors• Windows Installer supports rollback if

installation fails

ClickOnce

• Simplified installation• Visual Studio support • Low impact• Media choices• Install or run cached• Automatically check for updates

Signing ClickOnce Manifests

• Protect applications from tampering• Use Authenticode signature

– Makecert.exe • Also need a Software Publishing Certificate

– Certificate Authority• Sign the application

• Test the signature

cert2spc yourkey.cer yourkey.spc

signcode -v <path>yourkey.pvk -spc <path>yourkey.spc filename.exe

ckhtrust filename.exe

Isolating ClickOnce Installations

• Store data only in user folders• Document registry keys• Designed to have minimal impact

Windows Installer 4.0 Windows Installer 4.0 and ClickOnceand ClickOnce

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Installing to Correct Folder Locations

• Applications installed to Program Files or AppData

• User data written at first run• Users given location flexibility• Managing shared components• New folder hierarchy

User Profile NamespaceUser Profile Namespace

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Christina Palaia
A different font size is used for Agenda slide text throughout module...

Installing Windows Resources

• Applications must not install WRP files

• Update using Microsoft Service Pack• Never repackage system

components

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Creating Custom Actions

• Document behavior• No nested install• Do not add columns to standard tables• Cannot call gacutil• Record outcome in log• Do not prefix tables or properties with

“msi”• Actions changing system state written as a

deferred and rollback pair

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Supporting Command-Line Installation

• Enable deployment by SMS• Successfully install in quiet mode• Document command-line options

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Following Component Rules

• Installing or removing one application should not harm another

• Enable Windows Installer to remove application correctly

• At most one COM server per component

• At most one target for Start menu or desktop shortcut

• ComponentId field not null

Agenda• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command-line installation• Following component rules• Installation test cases

Installation Test Cases (1)

• Verify application installer uses Windows Installer

• Verify application’s MSI installer does not receive any errors from the Internal Consistency Evaluators

• Verify application’s installer contains an embedded manifest

• Verify application launches with installed user token

• Verify application installs to the correct folders by default

Installation Test Cases (2)• Verify ClickOnce application is signed with

a valid Authenticode certificate• Verify ClickOnce application stores data

only in installed user’s folders• Verify Windows Installer package contains

ProductName, Manufacturer, ProductVersion (major and minor), UpgradeCode, ProductCode, and ProductLanguage property tags and that they are not null

Installation Test Cases (3)

• Verify application does not try to write to or replace any WRP registry keys or files

• Verify the application does not use nested install custom actions

• Verify the application does not add custom columns to the Windows Installer standard tables and that any custom tables or properties are not prefixed with “msi”

Installation Test Cases (4)

• Verify the application rolls back the install and restores machine to previous state

• Verify the application does not force a restart during install

• Verify the application properly handles files in use during install

• Verify the application can be installed quietly from the command line

Installation Test Cases (5)

• Verify the application’s Windows Installer ComponentID table does not contain null values

• Verify the application’s Windows Installer package does not contain more than one COM server for each component

• Verify the application’s Windows Installer package does not contain more than one shortcut for each component

Summary• Installation requirements• Installation options• Installing to correct folder locations • Installing Windows resources• Creating custom actions• Supporting command line installation• Following component rules• Installation test cases

Recommended