O
Onno
Hi,
I've got a WinForm application (used within our company only) with a
list of constants, paths etc in app.config. A few of these constants
point to paths on our central server which is used as update server
(used to check for updates of the app itself and for several of the
things it used). For this app I've made an installer with Visual
Studio 2005.
Now the paths are fine for 95% of the users, but there is a single
department that want to use their own update server. So a few of the
constants need to be changeable. I do not want to make then really
configurable in the GUI of my app (other users will start to mess with
them) and I do not want build 2 versions of the app or create 2
installers. But I do need some way to let the department specify their
server.
What I thought of is this:
- Prior to running the Installer.msi, that one department double-
clicks a registry file they made themselves (I provide the template).
This registry file enters a path to a custom xml file with values to a
key.
- I move the settings to some 'OverridableSettings' class. Instead of
using AppSettings("ServerPath"), I will use properties from this class
for all fields that need to be overridable. Initially the properties
are set to the values from the App.Config file.
- But if the registry key is present, and the path is valid, the class
loads the values that are in the file.
Now, this will work but I don't have a good feeling about it. Anyone a
better idea? Is it possible to pass parameters to the msi created with
VS2005 and then let the installer pick another app.config or
something? Anything possible with the extended System.Configuration
namespace? (I didn't find anything suitable, but it's quite
overwhelming compared to .NET 1.1 in which I started with the
app.config file)
Many thanks,
Onno
I've got a WinForm application (used within our company only) with a
list of constants, paths etc in app.config. A few of these constants
point to paths on our central server which is used as update server
(used to check for updates of the app itself and for several of the
things it used). For this app I've made an installer with Visual
Studio 2005.
Now the paths are fine for 95% of the users, but there is a single
department that want to use their own update server. So a few of the
constants need to be changeable. I do not want to make then really
configurable in the GUI of my app (other users will start to mess with
them) and I do not want build 2 versions of the app or create 2
installers. But I do need some way to let the department specify their
server.
What I thought of is this:
- Prior to running the Installer.msi, that one department double-
clicks a registry file they made themselves (I provide the template).
This registry file enters a path to a custom xml file with values to a
key.
- I move the settings to some 'OverridableSettings' class. Instead of
using AppSettings("ServerPath"), I will use properties from this class
for all fields that need to be overridable. Initially the properties
are set to the values from the App.Config file.
- But if the registry key is present, and the path is valid, the class
loads the values that are in the file.
Now, this will work but I don't have a good feeling about it. Anyone a
better idea? Is it possible to pass parameters to the msi created with
VS2005 and then let the installer pick another app.config or
something? Anything possible with the extended System.Configuration
namespace? (I didn't find anything suitable, but it's quite
overwhelming compared to .NET 1.1 in which I started with the
app.config file)
Many thanks,
Onno