Customizing Your Installer
In most cases, a standard installer with default options is not sufficient to meet the deployment requirements of an application. You may need to add dialog boxes, text, Help files, and more, to your setup program. In Visual Basic 6.0, this required you to either modify the setup script file or modify the Setup1.exe project template used by the wizard.
In Visual Basic .NET, you can use the project's properties and the editors provided in Visual Studio .NET to make these changes. The editors are the following:
• File System Editor. This allows you to specify installation directories and Start menu and desktop items.
• Registry Editor. This allows you to specify registry keys and values to be added to the target computer during installation.
• File Types Editor. This allows you to specify the file type associations for the application on the target computer, as well as the verbs used to identify possible actions for those file types.
• User Interface Editor. This allows you to add more dialog boxes to your installation process.
• Custom Actions Editor. This allows you to specify additional actions to be performed during installation.
• Launch Conditions Editor. This allows you to specify conditions necessary on the target computer before the installation can begin.
For more information about a particular editor, see "Editors Used in Deployment" on MSDN.
With the File System Editor, you can manage all reference to files that will reside on the target computer, set conditions for copying files, create shortcuts to the installed files, or add files to a specified directory. The paths you specify for these files are used on the target computer during installation.
The Registry Editor allows you to manipulate specified registry keys on the target computer during installation. You can also use the Registry Editor to customize your upgraded application's installation to match the previous version's behavior at installation. For example, if the previous installer adds the product version as a key in HKLM\Software\Manufac£urer\Version during the installation process, then by using the Registry Editor, you only need to expand the tree until you find the specified manufacturer. After you have located the manufacturer, you can add a new key with its name set to Version. You can add a new string value to this key in which you set the value for the product version. Figure 16.8 on the next page shows how to do this.
Figure 16.8
Using the Registry Editor to create a version number key in a deployment project
Figure 16.8
Using the Registry Editor to create a version number key in a deployment project
If you added dialogs to your original installer, you should use the User Interface
Editor to add similar dialogs to your new installer. The User Interface Editor provides a number of predefined user interface dialog boxes that can be displayed during installation to present or gather additional information.
The available dialog boxes that you can add are the following:
• Checkboxes. These dialog boxes present up to four choices to the user and returns the values of those choices during installation. For more information, see "Checkboxes User Interface Dialog Box" on MSDN.
• Confirm Installation. This dialog box gives the user a chance to cancel installation or to go back to earlier dialog boxes and make changes before installation begins. For more information, see "Confirm Installation User Interface Dialog Box" on MSDN.
• Customer Information. This dialog box prompts the user for information such as name, company or organization, and product serial number. For more information, see "Customer Information User Interface Dialog Box" on MSDN.
• Finished. This dialog box notifies the user when the installation is complete. For more information, see "Finished User Interface Dialog Box" on MSDN.
• Installation Address. This dialog box allows the user to choose a Web location where application files will be installed. For more information, see "Installation Address User Interface Dialog Box" on MSDN.
• Installation Folder. This dialog box allows the user to choose a folder where application files will be installed. For more information, see "Installation Folder User Interface Dialog Box" on MSDN.
• License Agreement. This dialog box presents a license agreement for the user to read and acknowledge. For more information, see "License Agreement User Interface Dialog Box" on MSDN.
• Progress. This dialog box updates the user about the progress of the installation. For more information, see "Progress User Interface Dialog Box" on MSDN.
• RadioButtons. This dialog box presents up to four mutually exclusive choices to a user and returns the value of the selected choice during installation. For more information, see "RadioButtons User Interface Dialog Box" on MSDN.
• Read Me. This dialog box presents additional user information, such as errata and late-addition notes that a user should be aware of before running the application. For more information, see "Read Me User Interface Dialog Box" on MSDN.
• Register User. This dialog box allows the user to submit registration information by using an executable file that you supply. For more information, see "Register User User Interface Dialog Box" on MSDN.
• Splash. This dialog box presents an image to the user, typically to display a logo or branding information. For more information, see "Splash User Interface Dialog Box" on MSDN.
• Textboxes. This dialog box presents up to four text entry fields to a user and returns the contents of those fields during installation. For more information, see "Textboxes User Interface Dialog Box" on MSDN.
• Welcome. This dialog box presents introductory text and copyright information to the user. For more information, see "Welcome User Interface Dialog Box" on MSDN.
For more information about these dialog boxes, see "Deployment Dialog Boxes" on MSDN.
For example, if your previous installer included a readme dialog box during the installation process, and you want to include this behavior in Visual Basic .NET, do the following:
1. Save the readme content in a file.
2. Use the User Interface Editor to add a readme user interface dialog box to your project.
3. Set the path of your readme file to the ReadmeFile property of the dialog box.
You can access any of the editors by using the panel at the top of the Solution Explorer pane, as shown in Figure 16.9 on the next page.
- Figure 16.9
Deployment dialog box editors on the Solution Explorer pane
You can further customize your installer by using the setup project's properties. You can use the properties to set information such as the author's name, product name, manufacturer name, product description, and the version number. An example of the setup project properties page is shown in Figure 16.10.
Properties 9 X
I Setup 1 Deployment Project Properties
SU"
|
AddRemoveProgramsIcon |
(None) ▼ | |
|
Author |
Artinsoft Zona Franca SA | |
|
Description | ||
|
DetectNewerlnstalledVersfo |
True | |
|
Keywords | ||
|
Localization |
English (United States) | |
|
Manufacturer |
Artinsoft Zona Franca 5A | |
|
ManufacturerUrl | ||
|
ProductCode |
{8A0723CD-5D34-4DEA-9690 | |
|
ProductName |
Setupl | |
|
RemovePreviousVersions |
False | |
|
SearchPath | ||
|
Subject | ||
|
SupportPhone | ||
|
SupportUrl | ||
|
Title |
Setupl | |
|
UpgradeCode |
{BC383E A6-914F-45B7-A686-F | |
|
Version |
1.0.0 | |
|
AddRemoveProgramsIcon Specifies an icon to be displayed in the Add/Remove Programs dialog box on the target computer | ||
Figure 16.10
A typical setup project Properties page
Post a comment