Home » C# Basics » 11 - Deploying our Applications
11

ClickOnce Deployment

Provides a step-by-step method of how the clickonce deployment is used.

The ClickOnce deployment method gives more control over the installation process than the XCOPY deployment. The installation can be done from a website or a CD/DVD. After successful installation, the application will appear in the start menu of user's computer and can be uninstalled using the Add/Remove Program option in control panel.

Let us look at a step-by-step example to see how ClickOnce deployment works:

  • In the Visual C# IDE, open the project that we want to deploy. In the solution explorer, right click on the project name and select the Properties option from the menu.
  • The properties page will open in a new tab of the IDE. Click for the Signing tab. Check the Sign the ClickOnce manifests checkbox. Then, Click on the Create Test Certificate button. A dialog box will appear, asking for a password. Provide the password and click on the OK button. This step is required so that the end user will know the developer/organization from where the application is issued.

  • Next, click the Security tab. Check the Enable ClickOnce Security Settings checkbox.

  • Click on the Publish tab. In the Publishing location textbox, specify the location where the setup file will be stored. This location can be a web site address, an FTP server or Folder/Subfolder on a disk. For our example, we will select a folder names `SampleDeploy' on the C drive of the computer. In the Install Mode and Settings section, select the radio button - The application is available offline as well (launchable from Start menu).

Click on the Publish Now button to finish the process.

Now, if we open the folder that we specified in step 4, we can see the Setup file for our application:

Double-clicking this setup file will start the installation of our application:

Once the installation finishes, the application will be available on the start menu. We can remove the application from the Add/Remove programs option in the control panel.