Tutorials
VB.NET 2005.
.
.
To add a custom action
1. Select a folder in the Custom Actions Editor.
2. On the Action menu, choose Add Custom Action.
3. In the Select item in Project dialog box, select a folder and select the .dll file, .exe file, or project output that contains the custom action.
4. If the item hasn't previously been added to the deployment project, click the Add File, Add Output, or Component button to add the item as a custom action. This also adds the item to your project.
5. Caution If you use the Add File, Add Output, or Component button to add an item to the Select item in project dialog box and subsequently cancel the dialog box, the items are still added to the deployment project. If you don't want the items in the deployment project, you can remove them via Solution Explorer.
6. Tip To add a custom action to all four folders, select the Custom Actions node in the editor, and choose Add Custom Action.
To change the order of execution
1. Select a custom action in the Custom Actions Editor.
2. On the Action menu, click Move Up or Move Down.
3. Note Custom actions can be reordered by dragging with the mouse or by Cut and Paste commands on the Edit menu.
4. To remove a custom action
5. Select the custom action in the Custom Actions Editor, and choose Delete from the Edit menu.
Properties for the Custom Actions Editor
The following properties are available when working in the Custom Actions Editor. The actual properties available at any given time are dependent on the deployment project type and the current selection in the editor.
A number of searches can be defined to help create launch conditions:
Predefined launch conditions allow developers add both search and launch condition in a single step. The Property ‘property’ for the search is automatically referenced in the Condition property of the launch condition.
Searches and conditional evaluations are performed at the beginning of an installation and are performed in the order that they are shown in the Launch Conditions Editor.
Adding a File Search in the Launch Conditions Editor
The Launch Conditions Editor can be used to specify a search for a file on a target computer during installation. If the file is not found, the Property ‘property’ can be evaluated for conditional installation. File search properties can also be set to specify the location of the file, or attributes such as version, size, and date.
To add a file search
1. Select the Search Target Machine node in the Launch Conditions Editor.
2. On the Action menu, choose Add File Search.
3. In the Properties window, set the FileName property to the name of the file you wish to find.
4. Set the Property property to a valid Windows Installer property.
Optionally, set additional properties to specify where to search or what attributes to search for.
Adding a Registry Search in the Launch Conditions Editor
The Launch Conditions Editor can be used to specify a search for a registry key on a target computer during installation. The result of the search is returned in the Property property and can be evaluated in a launch condition. The Root property can be set for a registry search to specify a registry root. The Value property can be set to specify a registry value.
To add a registry search
1. Select the Search Target Machine node in the Launch Conditions Editor.
2. On the Action menu, choose Add Registry Search.
3. In the Properties window, set the Root and RegKey properties for the Registry key you wish to find.
4. Optionally, set the Value property to search for a specific value.
To remove a registry search
1. Select the registry search in the Launch Conditions Editor, and choose Delete from the Edit menu.
2. Adding a Windows Installer Search in the Launch Conditions Editor
3. The Launch Conditions Editor can be used to specify a search for a Microsoft Windows Installer component on a target computer during installation. The result of the search is returned in the Property property and can be evaluated in a launch condition.
To add a Windows Installer search
1. Select the Search Target Machine node in the Launch Conditions Editor.
2. On the Action menu, choose Add Component Search.
3. In the Properties window, set the ComponentID property to the GUID of the component you wish to find.
Note The Component ID is a GUID assigned by a package during installation; it does not match any of the deployment project properties. To determine the Component ID, the application must be installed and a tool such as the MSI Spy tool must be used and included in the Windows Installer Software Development Kit.
Building
The final step is concerned with how to build the deployment or setup project has created . There is basically no differences between how a Visual Basic .NET application is built and deployment /Setup project. If the project is the only project contained within the solution then the Build item can be used from the Build menu, which will cause the project to be built. As with the other projects, the developer will be informed of what is happening during the build through the Output Windows.
The Deployment/Setup project can also be built as part of a multiproject solution. If the Build Solution item is chosen from the Build Menu, all the projects in the solution will be built. Any deployment or setup projects will be built last. This is to ensure that if they contain the output from another project the system will pick up the latest build of that project.
Property
Description (Name)
This is the name given to the selected custom action.
Arguments Specifies command-line arguments for the selected custom action. Condition Specifies a Windows Installer condition that must be satisfied (evaluate to true) in order for the selected custom action to be run at installation time. CustomActionData Specifies custom data to be passed to an installer.
EntryPoint Specifies an entry point within a .dll custom action. InstallerClass Specifies whether a custom action is a .NET ProjectInstaller class. Name Specifies the name used in the Custom Actions Editor to identify a selected custom action. Defaults to the file name. SourcePath Indicates the path to the custom action source file on the development computer. Read-only.
The Launch Conditions Editor
The Launch Conditions Editor allows developers specify conditions. These conditions must be met in order to successfully run an installation. For example, the user might want to check for a specific version of an operating system - if a user attempts to install on a system that does not meet the condition, the installation will not go through.
First Page: The File Types Editor