I've been using ClickOnce for about a year now. Probably published the app a 100+ times (in the beginning I'd have to do it about 5 times for each publish because I kept making mistakes). My app allows for 4 distinct versions (build, beta, training and production) to be installed on the users machine at once. I have also used ClickOnce to publish obfuscated apps as well. It works pretty well (especially considering I don't have the time to roll my own). The only way I can get to the server were the production installation is by remoting into a terminal server, then remoting to the web server from it...sigh. The only time I have ever published directly to the install site was when I was first learning about it and did to my local IIS. Here are some things I've learned:
1. I always publish to a local folder. I almost always have to do some post procesing of the .application file (and sometimes the .manifest file as well, like when obfuscating). Also, since I remote into to all of my installation servers, I can then zip the installation files to speed deployment. This is especially important when I'm remoting twice, hence have to copy twice (they swear they're going to setup a VPN concentrator soon!).
2. I have found that it is a good idea increment the ClickOnce version every time I publish, even if there are no code changes. Just too likely to have problems. I also control the version manually, rather than allow the auto increment feature. I.e. if I'm testing version 1.0.0.0 in beta, and all is good, when I publish to production, the version will be 1.0.0.1, even though it is the same application. Don't do this and you are asking for trouble....
3. I use MageUI.exe to change the name and description in the .application file (this allows for multiple instances of same app to be deployed via ClickOnce...build, beta, production). When changing anything in this file, I also always just reselect the .manifest file also...makes sure all the hashes are correct.
4. ClickOnce has a mechanism to ensure that the .application, .manifest and all the .deploy files aren't tampered with. It stores a hash for each file. Any changes to any file means that the .manifest and .application files need to be updated with the new hash. MageUI does this.
5. At some point your certificate will expire. This will invalidate all of your installations.
It's like Christmas in July. At this point, after some head banging as you figure out what is occurring, you will have the obvious, but painful choice of having all of your users uninstall, then reinstall the application (that is using the new certificate) or you can use a tool like this to update your certificate so it isn't expired
http://www.may.be/renewcert/.
6. ClickOnce doesn't do secured sites. Period. You cannot access a clickonce installation site unless you allow anonymous access. This of course refers to the installation, not the application, which can be as secure as needed.
7. There is a command line equivalent for mageui.exe, mage.exe. This can be used in msbuild tasks to automate the process, but I haven't figure that out yet...
I might suggest the following process for you Bill:
1. Setup a publish folder to hold your published apps. Some thing like:
c:\myapp\publish\primaryserver
c:\myapp\publish\remoteserver
2. publish in VS. Set a local folder (c:\myapp\publish\primaryserver) and your primary install site.
3. copy this into the remoteserver folder
4. open the remote server's version specific .application file (see notes below) using mageui and update the installation url to the remote site, select the manifest in the remote folder, save the file (this updates the hashes).
5. update .application file by copying the version specific .application file over it (see notes below).
6. zip the appropriate files for primary and remote servers.
7. copy to primary and remote servers and unzip.
8. Update publish.htm to indicate new version.
I'd be glad to offer more help as needed...
Notes (just in case...):
- in VS 2005, when you publish a clickonce, it would add a version folder that contained all the .deploy files and the .manifest file and it would add a version specific .application file in the root folder, then overwrite the .application file. (If this sounds confusing...it is
You have to do a few times to get it). So the folders look like this:
c:\myapp\publish\
myapp.application
myapp_1_0_0_.application
publish.htm
c:\myapp\publish\myapp_1_0_0_0\
myapp.manifest.exe.manifest
myapp.exe.deploy
mylib.dll.deploy
Microfour StratarFrame Base.dll.deploy
...etc....
So when I update the version specific .application file I'm updating (in this example) myapp_1_0_0_.application, then copying it over myapp.application.
- VS 2008 does it differently. It creates an "Application Files" folder and puts the version specific folders there. It also puts the .application file for the specific version within this version specific folder:
c:\myapp\publish\
myapp.application
publish.htm
c:\myapp\publish\Application Files\myapp_1_0_0_0\
myapp.application
myapp.manifest.exe.manifest
myapp.exe.deploy
mylib.dll.deploy
Microfour StratarFrame Base.dll.deploy
...etc....
In this case, I update the myapp.application file in the c:\myapp\publish\Application Files\myapp_1_0_0_0\ folder, then copy that over the myapp.application file up in the root.