Deploying An Application with ClickOnce
Gives you an easy way to detect and install prerequisites
Lets the user choose between per-user or per-machine installation
Allows you to deploy to a web server for windows installer projects
You can easily deploy your application from a website, fileshare, network or FTP location
You can install the application locally or run from the website
Two deployment models:
- install
- supports online and offline usage
- Copies application files to user’s machine and installs
- Makes entry to Start Menu of current user
- Run from a network resource
- Online only usage
- Caches the application locally
Three ways to do application updates:
- check for updates on startup
- looks for updates before launching
- if update is available the user can download and install
- Makes the application take longer to load
- check for updates after startup
- launches application first
- then checks for update periodically in the background
- If upgrade available it downloads and installs the next time the user starts the application
- You can specify a time interval to check for updates
- custom logic
- You can include a menu item to check for updates
- Can install updates based on some business logic
ClickOnce allows you to roll back the last upgrade
If the application is run from online only it always runs the latest version
Upgrades can be required
Required upgrades can not be rolled back
Publish Wizard
Goes through deployment configuration choices
Builds the ClickOnce manifest
Copies it and the components to deployment location
Example:
Create a new project
Add a label and change the text to “Version 1”

- Double-click MyProject in the solution explorer
- Select Publish

This allows you to set the:
- publish location
- deployment method
- version information
- if it will increment the version automatically with each release
- In the publish location it should read http://localhost/nameofypurproject


- Add Publisher name and Product name
- Both are required
- Publisher name is name of the shortcut entry in Start menu
- Product name is the name of menu item in Start menu
- Click Ok

It can automatically generate a webpage with a default name of publish.html
You can change that if you want
- Click Publish Wizard to start Publishing

- Click next
- Choose if you want to install to the user’s computer or use online

- Click Finish to publish the application
- The website launches
- Click install

It makes sure you have the prerequisites (.net Framework 2.0)
If not it installs it
If you have internet Explorer you will get this screen

- Click Install
- Look in your start menu:

- Close the browser and program you installed
- On your form in Visual Studio change the label to Version 2
- Double click myproject and select publish
- Change the publish version Major to 2



Here you can adjust updates
- Click OK and Right-click the project
- Select Build
- Click Publish


Now your application has been updated
This is designed to work with Internet Explorer
If you have Firefox you will get this instead:

It lets you save the installation file

