Qstonr
Qstonr

Reputation: 815

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?

Upvotes: 7

Views: 6037

Answers (4)

wallismark
wallismark

Reputation: 1856

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

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

Good luck!

Upvotes: 1

Andrii Shvydkyi
Andrii Shvydkyi

Reputation: 2286

One more not very good solution:

You can place configuration files to different "optional groups" and download a specific configuration by manually using ApplicationDeployment.DownloadFileGroup. But, as for me, this is not a perfect solution.

Upvotes: 0

alpha
alpha

Reputation: 497

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.

Upvotes: 1

codeConcussion
codeConcussion

Reputation: 12938

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.

Upvotes: 3

Related Questions