RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


ClickOnce: Delivering .NET Applications Via the Net : Page 2

With ClickOnce, Microsoft delivers a client-side application deployment and updating solution that offers a glimpse into the future, where centrally-located and managed applications delivered via the Web don't have to run in interface-challenged browsers.

Some Simple Scenarios
From a developer's point of view, here's a very simple ClickOnce scenario. You begin with an application created in .NET 2.0, using the built-in publishing mechanism in Visual Studio (VS) 2005 to publish the application to the Internet or to a local server. The VS 2005 publishing process creates metadata files called manifests that control the future installation experience for end users. The publishing process also determines the address you provide to end users that they will use to install the software. Typically, that address would be a URL on a Web server, delivered as the target of a link or submit button in a Web page.

From an end-user's point of view, installing the application couldn't be simpler. Users reach the installation via a URL or network share address, both of which end in "publish.htm." You can provide users with the URL or address via a browser—a link in an HTML page—or simply deliver it as text that end-users can paste into their browser's address field. Clicking the link or browsing to the address triggers the installation of the application and its resource files.

Once installed, users launch the application using standard Windows styles (for example, via a desktop icon or Start Menu Shortcut). Or they can browse to a provided Web page ending in ".application" automatically generated by the ClickOnce publishing process on the server.

Updating applications is also straightforward. Whenever you, the developer, change your application or its associated resource files, you republish via ClickOnce. Your changed files are automatically re-versioned, and the publishing process creates a new hash for them in the signed manifest. The next time a client launches your application, the ClickOnce run-time built into the .NET Framework (depending on update settings the developer has specified) creates a new folder with the version number as part of the folder name on the client's machine, then downloads only the changed files into the new version folder.

Sameer Bhangar, a member of the ClickOnce team describes this model of preserving versions as a "side by side app" model, and states that it allows for "robust rollback" and avoids issues that may require a machine reboot. He also states:

"ClickOnce automatically ages out old copies of the app so at most you should have the current and one previous copy of the app in your store," I have been unable to find a clear statement in MS documentation to this effect. Note that files "marked as data" are handled with a different mechanism and will be re-downloaded, even if they have not changed."
Some people see the accumulation of multiple versions of the application and resource files on the client's machine as a problem (note that Visual Studio by default also constructs a similar system of folders on the server when publishing multiple versions of a revised application or its data files).

Deployed applications (depending on settings) behave just like regular Windows applications; they can have a Start Menu entry, a desktop shortcut, a system tray icon, etc.

Obviously, downloading binaries over the Web poses a security hazard; therefore ClickOnce requires a certificate that you use to digitally sign the manifest files in a standard Web-trusted format. Some complex issues surround security certificates, but fortunately Brian Noyes has an excellent blog entry to help you get up to speed on security certificate issues.

ClickOnce Adds Installation Power
If the model I've just described sounds similar to current widely used installation technologies such as Microsoft MSI, Wise, InstallShield, etc., you are right on track. But there is much more to ClickOnce than its suitability as an alternative to traditional installers!

For example, ClickOnce easily lets your application check for updates and automatically update every time any user connected to the install source (the Internet or a network server) launches the application. Yes, "update" means that you can use it to plug in changed DLLs or add new DLLs; that you can alter and deploy updated main application .exe code; that you can change resources and data files. And, yes, you can control whether the end users have the option—when updates are available—to cancel their installation or whether your application updates automatically with no end-user cancellation possible.

But there is more.... You can also deploy your application so that the end users can only use it when they are connected to the server or the Internet. In this mode, the application installs with no Start Menu shortcut and no desktop icon—it's available only via a link to a Web server. I'm planning to use this type of ClickOnce install myself with a real client.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date