Install and uninstall issues are some of the most common sources of application interoperability problems. These requirements help to ensure that the user has successful installation and uninstallation experiences, and that the application co-exists in a friendly way with other applications.
The Windows Installer service is an operating system component that centrally manages application installation configuration, as well as application uninstall. Using the Windows Installer service allows the operating system to manage application setup and configuration, which enables the following:
The Windows Installer service enables all of this functionality using packages that describe application configurations. The Windows Installer ships in Windows 2000 and is also available for redistribution on Windows NT 4, Windows 98, and Windows 95.
End users gain these benefits when your application uses the Windows Installer service:
System administrators in corporate environments also gain these benefits when your application uses the Windows Installer service:
2.1 Install using a Windows Installer-based package that passes validation testing
2.2 Observe rules in componentization
2.3 Identify shared components
2.4 Install to Program Files by Default
2.5 Support Add/Remove Program Files properly
2.6 Ensure that your application supports advertising
2.7 Ensure correct uninstall support
Your application must install itself using the Windows Installer service. To do this, your install must be in the form of a Windows Installer-based package. You must validate that the package is properly constructed by running an Internal Consistency Evaluation tool (such as msival2.exe, available in the Windows Installer SDK) in conjunction with the suite of ICEs contained in the file named logo.cub. These are available from the Windows Installer SDK at: http://www.microsoft.com/msdownload/platformsdk/WinInst.htm. You can also use the logo.cub file in conjunction with ICE tools provided by leading install tool vendors.
Leading vendors of install tools have new versions of their tools to enable easy authoring of Windows Installer-based packages. Contact your tools vendor for more details. You can also create your own Windows Installer-based package. The Microsoft Platform SDK provides a detailed example for implementing a Windows Installer-based package.
The Windows Installer service always installs and removes an application as monolithic pieces of information referred to as components. A component can consist of a collection of files, registry keys, shortcuts, or any other information that must be written to the user's computer during the installation. The installer identifies a component by its unique component code GUID. The installer locates the component using a keypath file that belongs to the component. Because components are commonly shared by more than one application or product, developers must correctly organize their applications into a set of components to ensure their application can be managed by the installer. For more details, see "Organizing Applications into Components" in the Windows Installer documentation in the Platform SDK.
To ensure that the removal of one program does not harm any other programs on the system and that the Windows Installer service correctly removes all resources connected with that program, your application must adhere to the following rules:
This means files in different directories must be in different components
This means there can only be one advertised file per component, although many different shortcuts can point to that single file
This means there can only be one COM server per component. A single file, which can only be in one component, may serve multiple CLSIDs. However, two files serving different CLSIDs must be in separate component. Extension servers must be the KeyPath of the component. This means there can only be one Extension server per component.
Note Applications are not allowed to update files that are protected by Windows File Protection on Windows 2000. See: Requirement 3.3 for more details.
By default, your application must install into an appropriate subdirectory where the current user's program files are stored. This folder is represented by the ProgramFilesFolder property in the Windows Installer-based package. (The ProgramFilesFolder property is a variable that exposes the path to the Program Files folder, and the Windows Installer sets that variable appropriately on all Windows platforms.) On English systems, this folder is often "C:\Program Files". However, do NOT hardcode that path, as it is not universal.
Exception If you are upgrading a previously installed version of your application, it is acceptable to default to the directory where that version exists.
Note Considerations for shared components: In some cases shared component must be placed in locations other than the application directory. See "Chapter 3: Component Sharing" for full details.
Your application must supply all the information in the following table so that Add/Remove Programs in the Control Panel can obtain information about the application as needed. You can set these values using properties in the Windows Installer-based package. Setting these properties will automatically write the corresponding values in the registry under:
HKEY_LOCAL_MACHINE
\Software
\Microsoft
\Windows
\CurrentVersion
\Uninstall
\{ProductCode}
Property (property names are case sensitive) |
Corresponding registry value |
Contains |
ProductName | DisplayName | Display name of application |
ARPINSTALLLOCATION | InstallLocation | Full path where application is located (folder or .exe) |
Manufacturer | Publisher | Publisher/Developer of application |
ProductVersion | VersionMajor | Major version number of application |
ProductVersion | VersionMinor | Minor version of application |
You can also provide additional properties to present in Add/Remove Programs if you like, such as product ID, online support information, etc. See the platform SDK for full details.
"Advertisement" is the notion of application availability in the absence of the application's files being installed. Advertising allows the application to be deployed using software management tools.
All Windows Installer-based packages of your core application must be advertisable in a manner that operating system entry points, such as shortcut activation and file activation, can trigger install on demand. In order to support advertisement at the operating system level, the following tables in the Windows Installer-based package must be populated with advertising data: shortcut, extension, icon, and Verb. It is recommended that you also populate class, MIME, ProgID, and TypeLib.
Note This does not mean your application must support feature-level advertising, (e.g. enabling the spell-checker to install on demand). The intent of this requirement is to ensure that your overall application can be installed on demand using the IntelliMirror features of Windows 2000.
Your application's Windows Installer-based package must correctly and fully uninstall the application. In a package that follows component rules and uses only native Windows Installer actions to modify the computer, this capability is provided automatically.
However, if your Windows Installer-based package includes custom actions, you will need to proactively ensure that your application properly uninstalls. Except as noted below, your application must remove the following:
The following should remain on the hard disk:
IMPORTANT You must explain in the Vendor Questionnaire everything you leave behind.
Tip If your application creates temporary files that should be removed during uninstallation, create a zero-length (0) file with the same name at installation time. Examples of such files would be .gid files created by Help.
You can activate different UI modes by launching your package with the /q switch. (Default is mode full. Specify b=basic, n=none)
To ensure that your application interoperates well with other applications (that do not use the Windows Installer) that share some of the same components that your application uses, you should test and verify each of the following scenarios:
Scenario 1 | Scenario 2 | Scenario 3 | Scenario 4 | |
Step 1 | Install your app | Install your app | Install "other" app | Install "other" app |
Step 2 | Install "other" app | Install "other" app | Install your app | Install your app |
Step 3 | Uninstall your app | Uninstall "other" app | Uninstall "other" app | Uninstall your app |
Step 4 | Verify "other" app still works | Verify your app still works | Verify your app still works | Verify "other" app still works |