DotNetWebTutor.com                                                    Link to Us

Deploying An Application with ClickOnce
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
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”

  • Build the application

build

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

publish
This allows you to set the:

    • publish location
    • deployment method
      • install
      • run from network
    • version information
    • if it will increment the version automatically with each release
  • In the publish location it should read http://localhost/nameofypurproject
        • If not type it in

publishing location

      • Click Options

options

      • 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

publishername
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

publish wizard

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

publish wizard

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

clickonce example
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
install

  • Click Install
  • Look in your start menu:

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

publish version

  • Click Updates

updates
application updates
Here you can adjust updates

  • Click OK and Right-click the project
  • Select Build
  • Click Publish

publish menu
version
Now your application has been updated

in firefox
This is designed to work with Internet Explorer

If you have Firefox you will get this instead:
save file
It lets you save the installation file
firefox setup

  • Open it

open executable file
clickonce deployment