tags:

views:

247

answers:

4

Hi

We are thinking using ClickOnce for deployment. I am not sure if this can be easily achieved while using ClickOnce. We create the ClickOnce and distribute to clients, and each client will put the clickOnce on their own network, each user of the client will run it from their local network. The application has some settings in the config file. Each client will have their own setting values (all users under the client will use the same seeting). My understanding is once the ClickOnce package created, clients can not change the config file to set their own settings, or the ClickOnce has to be re-signed. My questions are: Is my understanding correct? Is there a workaround? Can the application access the update location for files not included in the ClickOnce manifest?

Thanks,

Q

+1  A: 

If you are targeting the 3.5 Framework you don't have to sign your ClickOnce deployments. Make sure "Sign the ClickOnce manifests" is unchecked on the "Sign" tab of your project properties. This will allow you to edit the .application file after the deployment is created. Change the codebase attribute of the deploymentProvider tag...
<deploymentProvider codebase="http://theirserver/.../Foo.application" />

This won't solve the application setting issue though. If you edit a file you are deploying, the hash for the file must be regenerated.

Do you know what the client setting needs to be? If so, maybe you could have separate config files for each client and do something with a pre-build event to copy config files around?

Does the setting have to be in the client config file? Could you store the setting on the server and pass it through a url parameter or get it with a web service call after the application starts?

If these things won't work, you could provide your clients with a simple script (probably using Mage) so they could regenerate and resign the manifests (with their own certificate) after they edit the deployment.

whatknott
thanks. What will happen if a file (like the config file or a custom file) is not included in hash?
Qstonr
Each file being deployed is hashed. The hashes are all stored in the .manifest file. You don't have a choice about hashing files, it's how click once works. It's a security measure that safeguards against deployments being tampered with
whatknott
A: 

We are using ClickOnce in our company, and I had to publish a package per url. However, in your case you could always publish with a dns name, and tell your clients to use the same dns name on their network and it should always work.

alpha
So clients to use the same dns name, and the settings to be passed through URL parameter?
Qstonr
A: 

One more not very good solution: You can place config-files to different "optional groups" and download specific configuration by manually using ApplicationDeployment.DownloadFileGroup. But, as for me, this is not perfect solution.

Andrey Shvydky
A: 

You may find my recent blog posting on MsBuild and Multiple environments useful. Consider that each of your clients could have it's own 'environment', allowing you to specify their various configurations individually.

If you used this approach you could still 'sign' the deployment.

Good luck!

wallismark