Microsoft Windows Installer Architecture


Before the Windows Installer existed, programmers had to create custom installation programs. Not only was it more work to build such installation programs, but many of them didn't follow the Windows rules. Often system DLLs were overwritten with older versions because the installation program didn't check the version. In addition, the directory where the application files were copied was often wrong. If, for example, a hard-coded directory string such as C:\Program Files was used and the system administrator changed the default drive letter or an international version of the operating system was used where this directory is named differently, the installation failed.

The first version of the Windows Installer was released as part of Microsoft Office 2000 and as a distributable package that could be included with other application packages. Version 1.1 was first released with Windows 2000 and added support to register COM+ components. Version 1.2 added support for the file protection mechanism of Windows ME. Version 2.0 was the first version that included support to install .NET assemblies, and it has support for the 64-bit release of Windows as well. With Visual Studio 2005, version 2.0 is used.

Windows Installer Terms

Working with the Windows Installer requires you to be familiar with some terms that are used with the Windows Installer technology: packages, features, and components.

Important

Be aware of this about the term component. In the context of the Windows Installer, a component is not the same as a component in the .NET Framework. A Windows Installer component is just a single file (or multiple files that logically belong together). Such a file can be an executable, a DLL, or even a simple text file.

As you can see in Figure 17-15, a package consists of one or more features. A package is a single Microsoft Installer (MSI) database. A feature is the user's view of the capabilities of a product and can consist of features and components. A component is the developer's view of the installation; it is the smallest unit of installation and consists of one or more files. The differentiation between features and components exists because a single component can be included in multiple features (as shown in Component 2 in the figure). A single feature cannot be included within multiple features.

image from book
Figure 17-15

Let's look at the features of a real-world example that you should already have: Visual Studio 2005. Using the Add/Remove Programs option in the Control Panel, you can change the installed features of Visual Studio after installation by pressing the Change/Remove button, as shown in Figure 17-16.

image from book
Figure 17-16

By pressing the Change/Remove button, you can visit the Visual Studio 2005 Maintenance Wizard. This is a good way to see features in action. Select Add or Remove Features to see the features of the Visual Studio 2005 package (see Figure 17-17).

image from book
Figure 17-17

As you can see in Figure 17-17, the Visual Studio 2005 package includes the features Language Tools, .NET Framework SDK, Crystal Reports for Visual Studio 2005, Tools for Redistributing Applications, and Server Components. The Language Tools feature has the subfeatures Visual Basic, Visual C++, and Visual C#.

Advantages of the Windows Installer

The advantages of the Windows installer are:

  • Features can be installed, not installed, or advertised. With advertisement, a feature of the package will be installed at first use. Maybe you have already seen the Windows Installer starting during your work with Microsoft Word. If you use an advertised feature of Word that was not installed, it will be installed automatically as soon as you use it.

  • If an application becomes corrupt, it can self-repair through the repair feature of Windows Installer packages.

  • An automatic rollback will be done if the installation fails. After the installation fails everything is left as before: no additional Registry keys, no files, and so on, are left on the system.

  • With an uninstall, all the relevant files, Registry keys, and so on are removed — the application can be completely uninstalled. No temporary files are left out, and the Registry is also reinstated.

You can read the tables of the MSI database file to find information about such things as what files are copied and what Registry keys are written.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net