Anil C
Anil C

Reputation: 1065

Update App.config from the Values entered during running Installer

I am working on a desktop application installer where I need to get some inputs from the user during installation of application using custom actions. These values need to be updated into the app.config of the application.

I am referring to the following article: http://raquila.com/software/configure-app-config-application-settings-during-msi-install/

but the values are not updating. I have follow the steps exactly as mentioned in the above article but nothing happened. Even my application is not giving any errors/ exceptions. Also, I am not able to put a breakpoint in the installer file.

Can anyone suggest some pointers?

Thanks in advance.

Upvotes: 0

Views: 1129

Answers (2)

L.R.
L.R.

Reputation: 11

You could try to pass these values to a log file to see if you can actually read them out of the text boxes (or if you pass them correctly to the class). Also, you could try to write something in the app.config from within the installer class (without getting something passed from the form), by doing so you'll see if your class is able to write in the file (i.e. create a "Param4" and add the following to the class: config.AppSettings.Settings["Param4"].Value = "test";) Hope this helps.

Upvotes: 1

edocetirwi
edocetirwi

Reputation: 548

As a work around, write a temp file and read/save the values the first time the your application is initialized. Use a flag so that this process happens only the first time. Just a suggestion.

Upvotes: 1

Related Questions