Skip to main content

ClickOnce

 

Click here for larger image

ClickOnce is a new application deployment technology that makes deploying a Windows Forms based application as easy as deploying a web application. With ClickOnce running a Windows Forms application is as simple as clicking a link in a web page. For administrators, deploying or updating an application is simply a matter of updating files on a server; no need to individually touch every client.

ClickOnce applications are fundamentally low-impact. Applications are completely self-contained and install per-user, meaning no admin rights are required. You don’t have to worry about a ClickOnce application breaking other applications. However, if your application does need to do something risky at install time, e.g., installing drivers, MSI is still your best choice.

ClickOnce applications can be deployed via web servers, file servers or CDs. A ClickOnce application can choose to be installed, meaning it gets start menu & add/remove program entries, or an app can simply be run and cached. ClickOnce can be configured in several ways to check automatically for application updates. Alternatively, applications can use the ClickOnce APIs (System.Deployment), to control when updates should happen.

Visual Studio has rich support for publishing applications via ClickOnce. At anytime, you can simply choose to publish your existing Windows Forms application project to a network server. Visual Studio will automatically generate the XML manifest files that drive ClickOnce and publish the app to the specified server.

ClickOnce applications run in a secure sandbox provided by the CLR Code Access Security model. Visual Studio helps the developer author for the sandbox with features like F5 debug in security zone and a code analysis tool that determines an application’s needed permissions. For applications that need a higher level of trust, ClickOnce supports both a user prompting model and an enhanced security policy pre-deployment mechanism for administrators.

When talking about deploying applications over the network, size of the application is important. To help with this, ClickOnce supports HTTP compression. ClickOnce applications can also choose to incrementally download themselves. Application files can be marked as optional and then the application itself can use the System.Deployment APIs to instruct ClickOnce to download the indicated files as needed.

Using ClickOnce requires that the target client already have the .NET Framework 2.0 installed. Visual Studio has made packaging and deploying the .NET Framework simpler than ever. Simply select what pre-requisites your application may have (e.g., the .NET Framework 2.0 and MDAC 9.0) and Visual Studio will generate a bootstrapper file that will automatically install all of the specified prerequisites when run. On the server side, ClickOnce needs only an HTTP 1.1 server or alternatively a file server.