Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Deploying custom client configuration files with click once deployment.
 

Deploying custom client configuration files with click once deployment.

I have a client server application that I would like to deploy using click once.

Besides the .exe and .dll files that are used to create the client, I also need to ship out a configuration file that tells the client application the IP address of the machine acting as the server. This configuration file will be different for each customer.

I'm hoping that after creating a new version of the client, I can roll that version out to multiple customers and merge the client with the custom configuration file at each site. I would also like to be able to make changes to the custom configuration file on the file share, and have that file pushed out with the client (without having to go through the trouble of publishing a new "version" of the client).

mburns  Wednesday, March 19, 2008 4:23 AM
Well you can always include custom files in the deployment using mage.exe or mageui.exe. However if you push an updated version out, you have to have a new "version" of the client. To do what you want, you are going to have to build your own mechinism into the clients to check some folder out on the network for a newer version of teh xml file when its available.

I would put the config file in teh clickonce deployemnt, program the appplication on startup to compare teh file version of the local file to one on another shared drive. If the version out there is newer, download the new file. Its not too hard to set this up.
Dan Rigsby  Wednesday, March 19, 2008 12:28 PM
Well you can always include custom files in the deployment using mage.exe or mageui.exe. However if you push an updated version out, you have to have a new "version" of the client. To do what you want, you are going to have to build your own mechinism into the clients to check some folder out on the network for a newer version of teh xml file when its available.

I would put the config file in teh clickonce deployemnt, program the appplication on startup to compare teh file version of the local file to one on another shared drive. If the version out there is newer, download the new file. Its not too hard to set this up.
Dan Rigsby  Wednesday, March 19, 2008 12:28 PM

Thanks for the input Dan.

With the solution you offered, what mechanism would you use so the client software knows the location of the shared drive?

I've found a lot of people asking similar questions on the forum, but still haven't found a complete solution.

Onepost recommended parsing

ApplicationDeployment.CurrentDeployment.UpdateLocation.ToString();

to figure out where the application was loaded from. (maybe the location of the shared drive you mentioned?)

The problem is this only works if you know the deployment location at the time the manifest file is created. UpdateLocation doesn't report the location that the application was deployed from. It just returns the value of the <deploymentProvider> tag from the manifest file (which can't be changed without generating a new signature).

When we give the client software to the customer, they install it on a network share/web siteof their choosing. And that the network share might change.

Is there any method to determine the location the client was actually deployed from?

mburns  Thursday, March 20, 2008 4:19 AM
If you are going to be giving this to customers to deploy, then you are best off writing a wrapper around the apis that mage.exe uses and give it to the customers as a configuraiton tool. They put in their deployment path and it updates teh manifests. Alternatively you could just give them instructions on how to use mage.exe to set the deployment path. You really dont have any other options.

Microsoft.Build.Tasks.Deployment.ManifestUtilities is the namespace for all the stuff you need to write your own manifest manipulation program. Its probably easier to give instructions on how to use mage.exe though.
Dan Rigsby  Thursday, March 20, 2008 12:17 PM

You can use google to search for other answers

Custom Search

More Threads

• Clickonce Prerequisite Library
• uninstall will not remove registry entries
• Rebuild project does not clean project
• Calling the console exe from setup Project in .NET
• clickonce Application cannot be started
• ClickOnce update dll
• Facing problem in creation of shortcut for application
• Launch on startup? How to edit appref-ms files?
• Windows XP Service Pack 2 or later is required to install SQL Server 2005 Express Edition.
• Adding a new row to a table (vb.net)