ClickOnce deployment and changing the configuration file after installation


We are thinking about using ClickOnce for deployment. I am not sure if this can be easily achieved while using ClickOnce. We create the ClickOnce installer and distribute to clients, and each client will put the ClickOnce installer on their own network. Each user of the client will run it from their local network.

The application has some settings in the configuration file. Each client will have their own setting (all users under the client will use the same settings). My understanding is once the ClickOnce package is created, clients can not change the configuration file to set their own settings, or the ClickOnce has to be re-signed.

Is my understanding correct? Is there a workaround? Can the application access the update location for files not included in the ClickOnce manifest?

Best Solution

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.