What is ClickOnce?
ClickOnce is a .NET deployment technology that enables a user to install and run a Windows application by simply clicking a link from a web page. ClickOnce applications are also inherently self-updating, as they check for newer versions as they become available.
ClickOnce applications are also “low-impact”, in other words, they do not need administrative rights to install, only install for the current user, and are isolated from other ClickOnce applications.
Since there is no direct way of publishing your ClickOnce application to CodePlex from within Visual Studio, we have attempted to make the process as simple as possible. The next few sections will walk you through the preparation and publishing, and ultimately
creating a ClickOnce release on CodePlex.
Publishing a ClickOnce Application
This first step assumes that you have an existing .NET Windows application (Console/Windows Forms/ WPF) that you wish to publish using ClickOnce. When you open the Publish dialog (Build -> Publish
) from Visual Studio, the
first step will ask for a location to place the published ClickOnce application files. Feel free to change this value to an easy-to-remember path on your computer.
The next step asks where users will be installing this application from. Select “From a Web Site” and type the following in the textbox, replacing “ProjectName” with your project name.
This is a very important step, and the CodePlex software ensures that your ClickOnce application has a valid URL that matches your project.
At this point, you can either click “Next” to walk through a few other steps or you can click on “Finish” to complete the publish operation.
Preparing the ClickOnce Application
If you open up the location where your application is published, you’ll see a folder structure similar to the following:
As you can see, there isn’t just a single executable that can be uploaded. Each version of your ClickOnce application has a folder with the necessary files in it that is contained in the “Application Files” folder. To prepare the ClickOnce Application for CodePlex,
zip the entire directory, making sure the *.application file is at the root of the zip file.
Note: This is a mandatory zip file structure that is required. Validation of your ClickOnce application will fail if this is not followed.
Creating a ClickOnce Release
When you create a new release for your project, you’ll notice a new checkbox underneath the release name. When that is checked, a file upload control is displayed. Select the zip file you created in the last step and fill out the rest of the create release
A few notes about ClickOnce releases:
- The ClickOnce application becomes your “default file”. There is no way of making another file for that release the default.
- ClickOnce releases are always public. There is no way of “hiding” them.
- You can only have 1 active ClickOnce release at a time. All older ClickOnce releases will be “archived”, which means they are still accessible you just cannot make them recommended releases, or update the release’s ClickOnce application.
When the ClickOnce release has been created, you’ll be redirected to view the release.
If you click on the “ClickOnce Installer” link, it will start the download and ClickOnce installer.
Note: The ClickOnce installer will launch only for Internet Explorer and FireFox (should you have the plugin installed). If you are prompted to download the application file, save this file locally and execute it to launch the ClickOnce
Clicking on “Install” will install and launch the application.
Updating a ClickOnce Release
When you have a new version of your project to release, you should follow the same steps for publishing and preparing your ClickOnce application.
Note: Visual Studio should retain the URL that you previously specified during publishing.
When you are ready to upload the ClickOnce zip file, you have the choice of updating the current ClickOnce release or creating an entirely new ClickOnce release. The latter of the two will archive your current ClickOnce release automatically. Both choices will
prompt your users to update the currently installed application on the next launch.