views:

130

answers:

1

Hey guys,

There's a lot of post saying how to change info in the app.config and there are posts that say you shouldn't edit info in the app.config but store info in user folders. I understand these topics. But what i want is a combination of both. I have a wcf setup for my client in an app.config, which contains the endpoint address to which it should connect. When The server changes ip, or when a client is installed on a computer in another company, the user should be able to insert another ip-address which should be stored in the app.config. This cannot be stored in a file in appdata or something like that, as the client reads the info in the app.config on startup.

How can i write (so remember the new ip-address) in the app.config when the client is installed in program files, the UAC is enabled and the program isn't run as an admin?

Thanks in advance.

A: 

Could you simply change the IP in the App.config as part of your MSI/installation procedure?

Alex
what do you mean, that i preset the correct ip-address and make a setup for each company?
djerry
either make setup for each company or if that happens too often write your own installer that installs the client/server, detects IPs and updates config files.
Vitalik
You can add custom actions to an MSI that detect the IP dynamically, or pass a parameter to your MSI, or call a config utility as part of the installation, or show a little custom UI as part of your MSI wizard and user can enter a URL interactivly. A lot of possibilties.
Alex
Ok, i have never added a custom actions to my setup or tried coding it. What's my best option to enter the ip-address (read easiest for user)?
djerry
I personally prefer http://wix.sourceforge.net/.
Alex