29 October 2005

My web host runs on Linux so I wanted to make sure that I would be able to use ClickOnce without having to find a new host. Well, it turns out that it was very easy to get this to work (though some steps become manual). Here are the steps I followed:

  • In the property publish settings you will need to set the Installation URL to the URL you will eventually put the ClickOnce application on. In my case, http://www.bunnyhug.net/ClickOnceTest/. The publishing location can be whatever you want to test with. I used my local IIS.
  • If you want your application to check for updates you will need to click the Updates button and set the Update Location to the URL you want to check for updates with. Once again in my case it was http://www.bunnyhug.net/ClickOnceTest/.
  • So now build and publish your application to your local IIS or whatever you selected for the Publishing Location. Upload the resulting files to your web server so they will be in the proper folder to match the Installation and Update URL.
  • One last thing to do, since I doubt your web host have the proper MIME types set you will need to add the following to a .htaccess file in the folder you uploaded your published files (or use this example.htaccess file):
AddType application/x-ms-application .application
AddType application/x-ms-application .manifest
AddType application/octet-stream .deploy

This allowed me to hit http://www.bunnyhug.net/ClickOnceTest/ and install my Click Once Test application. It should look something like this in IE:

image

When I tried in firefox I got a bit different result:

image

For firefox I had to click the Install button which downloaded the Setup.exe file. After running this file manually it installed the application just like clicking the Install button in IE did.

So that should be all to get ClickOnce applications deploying from a non-IIS server. The downside is you will have to upload your files manually after you publish locally each time. If you have FTP access to your host you can make this a bit easier by setting up the Publishing Location to the FTP location that matches your Installation and Update URL.