What is Click-Once technology?

“Click-Once” is a deployment technology created by Microsoft.  It makes deploying Windows software drastically easier for both the writers of the software and for the consumers of the software that will run it on their machines.

Here’s how it works from the distributor’s end (I’ll explain how it works from the consumer’s end in a moment):

The distributor of the software deploys their project directly from Visual Studio to a web server (any web server… not just IIS).  Several files are created in the process, including a launch page with a run button (that doesn’t have to be used), a file ending in “.application”, a subfolder with the executable and associated DLLs.  All the files are digitally signed by the distributor for security and the whole thing is versioned and GUID’d.  The distributor has the option of letting the software be run straight from the URL or to let it be installed locally on the user’s machine.  They also have the option of letting it check for newer updates every time the user runs it and additionally can force a refusal to run unless it’s the latest version on the server.

From the user’s end:

They will either use the “run” button on the publish.htm file that gets generated during the deployment which then redirects to the “setup.exe” file on the server.  In that case, the setup.exe file is downloaded like any other file and the browser gives the user the option to save or run.

Or they’ll click a URL that reference the “.application” file on the server, or they’ll double-click an icon on their desktop which references a “.application” file on the server.

In the case of the .applicaton file, what happens next is the Click-Once technology activates from the browser and reads the .application file (which is a manifest XML file explaining where the content is as well as a hash to make sure it hasn’t been modified since it was deployed).  It then downloads another manifest XML file from the application’s content folder on the server and then downloads and attempts to run the EXE, but not without asking the user’s permission first, as well as displaying the signed certificate information to the user.  The user has the option of accepting or rejecting it.

From the user’s point of view:

The user clicks a link, is prompted if they want to run it, then it just runs.

Benefits of Click-Once for a software distributor:

  • Rapid deployment.
  • Control over whether users can:
    • install it locally to launch locally (with or without checking for newer versions)
    • only launch it from the URL.
    • have to run only the latest version.

Benefits of Click-Once for a user:

  • Easy launching (simply by clicking a URL).
  • Very strong security:
    • Always given the option to accept or deny a certificate.
    • Always given the option to allow it to run at each launch.
    • Zero footprint… There’s no “installation” as most software.  No system settings can be changed during the simulated “install”.
    • Can be sure they’re always running the latest version.
    • It’s .NET software, so they have the ability to control what resources the EXE can have access to on the machine (through a control panel applet).

An application can also be deployed as a Click-Once application for CD or DVD distribution.  In that case, the end user uses the CD or DVD in the same way as a web site.

For an article directed at why you would use this (if that wasn’t answered here), click here

For more information, directly from Microsoft, go here.

Leave a Reply