News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Deployment for DotNet applications

Started by ganeshbala, Jun 12, 2009, 04:04 PM

Previous topic - Next topic

ganeshbala

Deployment for DotNet applications

Create a windows application with the Name MyApplication and Build the application

Select Deployment project

1. On the File menu, point to Add Project, and choose New Project.

2. In the Add New Project dialog box, select Setup and Deployment Projects in the Project Types pane, and then choose Setup Project in the Templates pane. In the Name box, type MyApplication Installer.

3. Click OK to close the dialog box.

The project is added to Solution Explorer, and the File System Editor opens.

4. Select the MyApplication Installer project in Solution Explorer. In the Properties window, select the ProductName property and type MyApplication.

Note The ProductName property determines the name that will be displayed for the application in folder names and in the Add/Remove Programs dialog box.

Adding Windows application to the installer

1. Select the MyApplication Installer project in Solution Explorer. In the File System Editor, select the Application Folder node.

2. On the Action menu, choose Add, Project Output.

3. In the Add Project Output Group dialog box, choose MyApplication from the Project drop-down list. Click OK to close the dialog box.

4. Select the Primary Output group from the list, and then click OK.

5. On the Build menu, choose Build MyApplication Installer.
To deploy the application (basic installer)
this step can be skipped if you are following the complete walkthrough.

• Select the MyApplication Installer project in Solution Explorer. On the Project menu, choose Install.

This will run the installer and install MyApplication on your development computer.
Note you must have install permissions on the computer in order to run the installer.
Optional Deployment Capabilities

The remaining steps demonstrate optional deployment capabilities.

ganeshbala

Shortcut Creation

This step creates a shortcut to your application that will be placed on the desktop of a target computer during installation.

To create shortcuts for the Windows application

1. Select the MyApplication Installer project in Solution Explorer.

2. In the File System Editor, select the Primary output from MyApplication node.

3. On the Action menu, choose Create Shortcut to Primary Output from MyApplication.

This will add a Shortcut to Primary output from MyApplication node.

4. Rename the shortcut Shortcut to MYAPPLICATION.

5. Select Shortcut to MYAPPLICATION and drag it to the User's Desktop folder in the left pane.

Creating a File Association

This step adds a file association for MyApplication so that double-clicking .fcs files will launch the MyApplication application.

To create file associations for the Windows application

1. Select the MyApplication Installer project in Solution Explorer. On the View menu, point to Editor, and choose File Types.

2. Select the File Types on Target Machine node in the File Types Editor. On the Action menu, choose Add File Type.

A New Document Type #1 node is added and opened for renaming.

3. Rename New Document Type #1 as Readme.txt.

4. In the Properties window, set the Extension property of the file type to fcs.

5. Select the Command property and click the Ellipsis ( ) button. In the Select item in project dialog box, navigate to the Application Folder, and select Primary output from MyApplication.

6. Click OK to close the dialog box.

Adding a Registry Entry

This step adds a registry key and value to the registry. You could reference this registry key from your application's code to retrieve per-user information at run time.

To add a registry entry for the Windows application


1. Select the MyApplication Installer project in Solution Explorer. On the View menu, point to Editor, and choose Registry.

2. Select the HKEY_CURRENT_USER node and expand it, then expand the Software node and select the [Manufacturer] node.
Note The Manufacturer node is surrounded by brackets to denote that it is a property. It will be replaced by the value entered for the Manufacturer property for the deployment project.

3. On the Action menu, choose New, Key.

4. Rename the key UserChoice.

5. Select the UserChoice key.

6. On the Action menu, point to New, then click String Value.

7. Rename the value TextColor.

8. In the Properties window, select the Value property and enter Black.

ganeshbala

Custom Installation is one of the important area in Setup creation. Next Steps will explain the Custom Dialog Creation.

To add a custom installation dialog box

1. Select the MyApplication Installer project in Solution Explorer. On the View menu, point to Editor, and choose User Interface.

2. In the User Interface Editor, select the Start node under the Install node.

3. On the Action menu, choose Add Dialog.

4. In the Add Dialog box, choose Checkboxes (A).

5. Click OK to close the dialog box.

6. On the Action menu, choose Move Up twice to position the Checkboxes (A) dialog box above the Installation Folder dialog box.

7. In the Properties window, set the BannerText property to Samples.

8. Set the BodyText property to The Install Samples check box controls whether or not the sample files are installed. If left unselected, the samples will not be installed.

9. Set the CheckBox1Label property to install samples?

10. Set the properties Checkbox2Visible, Checkbox3Visible, and Checkbox4Visible to false. This will hide the additional check boxes.

Working with OptionFiles

This step creates a Samples subfolder that will be installed beneath the Application folder.
To add a OptionFiles folder

1. Select the MyApplication Installer project in Solution Explorer. On the View menu, point to Editor, and choose File System. The Application Folder should still be selected.

2. From the Action menu, point to Add, and choose Folder.

3. Rename "New Folder #1" as Samples.
This step creates two sample text files that will be installed if the user chooses the Install samples option in the custom dialog.

To create OptionFiles files for the application


Note To prevent MyApplication from automatically adding a .txt extension; choose All Files in the Files of type drop-down list.

1. Create text file containing the text this is Sample.fcs. Save it as sample.fcs.
This step adds the sample files to the OptionFiles folder, and sets a condition that determines whether to install the files.

To add the OptionFiles to the installer

1. Select the MyApplication Installer project in Solution Explorer. On the View menu, point to Editor, choose File System, and select the Samples folder.

2. From the Action menu, point to Add, and choose File. Add the Rules.vbn and sample.fcs files to the OptionFiles folder.

3. Select the file sample.fcs in the File System Editor.

4. In the Properties window, set the Condition property to CHECKBOXA1=1. When the installer is run, the file Memo.vbn will only be installed if the custom check box is selected.
Adding Launch Conditions

Checking IE 5.0 or later Version in Destination System

To add a launch condition to check the Internet Explorer version
Note this step is intended to demonstrate the concept of launch conditions; the MyApplication application has no actual dependency on Internet Explorer.

1. Select the MyApplication Installer project in Solution Explorer. On the View menu, point to Editor, and choose Launch Conditions.

2. In the Launch Conditions Editor, select the Requirements on Target Machine node.

3. On the Action menu, choose Add File Launch Condition.
A Search for File1 node is added beneath the Search Target Machine node, and a Condition1 node is added beneath the Launch Conditions node.

4. Rename Search for File1 to Search for Internet Explorer.

5. In the Properties window, set the FileName property to Iexplore.exe, the Folder property to [ProgramFilesFolder], the Depth property to 2, and the MinVersion property to 5.00.

6. Select the Condition1 node.

7. Set the Message property to this program requires Microsoft Internet Explorer 5.0 or higher. Please install Internet Explorer and rerun the MyApplication installer.

Additional Properties

This step sets a property to automatically install the Windows Installer bootstrapping application files if the correct version of Windows Installer is not present on the target computer.

To set optional properties for the deployment project

1. Select the MyApplication Installer project in Solution Explorer. On the View menu, choose Property Pages.

2. On the MyApplication Installer property page, select the Bootstrapper drop-down list, and choose Windows Installer Bootstrapper.

3. On the Build menu, choose Build MyApplication Installer.

Installing on Your Development Computer

This step will run the installer and install MyApplication on your development computer.

To install MyApplication on your development computer

• Select the MyApplication Installer project in Solution Explorer. On the Project menu, choose Install.