VB.NET 2005 Tutorials
Tutorials
VB.NET 2005The File Types Editor
The File Types Editor
The File Types Editor
The File Types Editor can be used to create the required registry to establish a file association for the application being installed. A file association is simply a link between a particular file extension and a particular application. For example, the file extension .xls is normally associated with Microsoft Excel.
- Add and Delete Document Types and Associated File Extensions in the File Types Editor.
- The File Types Editor can be used to specify document types and file extensions that will be associated with your application when it is installed on a target computer.
- Once installed, the extension and file type description will appear in the file types list in Windows.
There are three steps involved in associating a file type with your application:
1. adding a document type
2. associating a file extension
3. and associating an executable file
To add a document type
1. Select the File Types on Target Machine node in the File Types Editor.
2. On the Action menu, click Add File Type.
3. A new document type node is added and the default name is highlighted.
4. Type a descriptive name for the new document type.
To associate a file extension
1. Select a Document Type node in the File Types Editor.
2. In the Properties window, select the Extensions property and type an extension.
Note : Valid file extensions cannot be preceded by a period — enter the extension using the form xxx rather than .xxx. You can enter multiple extensions by separating them with a semicolon (xxx;yyy).
To associate an executable file
1. Select a Document Type node in the File Types Editor.
2. In the Properties window, click the ellipsis button () next to the Command property.
3. In the Select item in project dialog box, click the Add File button.
4. Select an executable file to associate with the file type.
Note A file type can only be associated with one installed executable file. To associate more than one executable file with a file type, you must first specify conditions for each executable file to ensure that only one will be installed for a given installation.
The User Interface Editor
The Interface Editor is used to manage the application installation interface. The editor allows us to define the dialog boxes that are displayed to the user and in what order they are shown.
The editor uses a treeview with two root nodes: Install and Admin. Below each of these nodes there are three nodes that represent the stages of the installation: Start, Progress, and End. Each of the three stages can contain a number of dialog boxes that will be displayed to the user when the resulting Windows Installer package is run. A default set of dialog box is predefined when we create the deployment project. The default dialog boxes that are present depend on the type of deployment project; Setup Project or Web Setup Project. However, if you are creating a Web Setup Project the Installation Folder dialog box will be replaced by an Installation Address dialog box.
Installation Mode
We’ll start by taking a look at the two modes that the installation runs: Install and Admin. These basically distinguish between an end user installing and a system administrator performing a network setup.
To use the Admin mode of the resulting Windows Installer Package msiexec.exe can be used with the /a command line parameter.
msiexec.exe /a
The Start Stage
The Start stage is the first stage of the installation and contains the dialog boxes that need to be displayed to user before the actual installation of the files begins. This stage is commonly used to ask the user to select the base installation folder for the application and to ask the user what parts of the system he would like to install. Another very commonly task of this stage is to ask the user what their name is and what organization they work for. At the end of this stage the Windows installer service will determine how much disk space is required on the target machine and check that this amount of space is available. If the space is not available, the user will receive an error and the installation will not continue.
The Progress stage
The progress stage is the second stage of the installer and is where the actual installation of the file occurs. There isn’t usually interaction in this stage of installation. There is normally one dialog box that indicated the current progress of the installation. The current progress of the installation is calculated automatically
The End Stage
One the actual installation of the files has finished, the installer moves into the End stage. The most common use of this stage is to inform the user that the installation has completed successfully. It is often used to provide the option of running the application straight away or to view any release notes.
The Custom Actions Editor
The Custom Actions Editor allows the developer specify additional actions to be performed on the target computer at the end of an installation. For example, he might want to run a program that associates a server component with a particular message queue.
Custom actions must be compiled as a .dll or .exe file, or added to a project as a script or assembly before they can be added to a deployment project. Actions can only be run at the end of an installation.
The editor contains four folders, each corresponding with a phase of installation: Install, Commit, Rollback, and Uninstall.
Custom actions are run in the same order that they are displayed in the editor. Custom actions can be reordered via dragging with the mouse or via the Cut and Paste commands on the Edit menu.
Adding and Removing Custom Actions in the Custom Actions Editor
The Custom Actions Editor is used to specify custom actions to be run during installation on a target computer. Cstom actions that are contained in the outputs of a project can be added in the solution, including .dll files, .exe files, or Microsoft .NET Framework installation components, or compiled custom actions can be added as files or components.
The order of execution can also be controlled for custom actions.
The four actions that are defined in the editor are defined in the following table.
|
Events |
Description
Install
The actions defined for this event will be run when the installation of the files has finished, but before the installation has commited
Commit
The actions defined for this event will be run when the installation has been committed and has therefore been successful.
Rollback
The actions defined for this event will be run when the installation fails and rolls back the machine to the same state as before the install was started.
Uninstall |
The actions for this event will be run when the application is being uninstalled from the machine. |
