How to set up .exe.config during installation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

So I've been really good. I've written my nice shiny new app to use a
..config file.

I have code that is nicely reading (and updating as required) the settings
in the .config file, and the app is passing testing, fine.

All goes well, right up to the point where I want to make the install script
set up the initial values in the config file, based on part of the
installation script values and text box values from a form in the install
script.

And can I find out how to do it?

Nope. Not at all.
 
hi....

for reading the values from the install program, i guess u must have added
custom forms to ur install app from the setup project, in this case u have to
create a custom installer class to read the values from the installer
application and do the required job, once u have created ur installer class u
need to add this dll file as a custom action to the installer,
so when the installer runs, the code in the installer class also gets
executed.

you need to pass the parameters thro the custom action data property in the
setup app.
Ex. - /INSTALLDIR="[INSTALLDIR]"
and inside the installer class you can read the parameters as shown below.
Console.WriteLine(Context.Parameters["INSTALLDIR"].ToString());

check out these links for further reading.
http://www.c-sharpcorner.com/Code/2002/July/UseInstClasses.asp

http://msdn.microsoft.com/library/d...emconfigurationinstallinstallerclasstopic.asp

hope this helps,
Bye

Kannan.V
http://kannanv.blogspot.com
 
Gotcha. Many thanks.

DesignedForDOTNET said:
hi....

for reading the values from the install program, i guess u must have added
custom forms to ur install app from the setup project, in this case u have to
create a custom installer class to read the values from the installer
application and do the required job, once u have created ur installer class u
need to add this dll file as a custom action to the installer,
so when the installer runs, the code in the installer class also gets
executed.

you need to pass the parameters thro the custom action data property in the
setup app.
Ex. - /INSTALLDIR="[INSTALLDIR]"
and inside the installer class you can read the parameters as shown below.
Console.WriteLine(Context.Parameters["INSTALLDIR"].ToString());

check out these links for further reading.
http://www.c-sharpcorner.com/Code/2002/July/UseInstClasses.asp

http://msdn.microsoft.com/library/d...emconfigurationinstallinstallerclasstopic.asp

hope this helps,
Bye

Kannan.V
http://kannanv.blogspot.com


policywatcher said:
So I've been really good. I've written my nice shiny new app to use a
.config file.

I have code that is nicely reading (and updating as required) the settings
in the .config file, and the app is passing testing, fine.

All goes well, right up to the point where I want to make the install script
set up the initial values in the config file, based on part of the
installation script values and text box values from a form in the install
script.

And can I find out how to do it?

Nope. Not at all.
 
Back
Top