app.config file does not update during modify - Advanced Installer Community
korr
Posts: 48
Joined: Tue Sep 09, 2014 3:13 pm

app.config file does not update during modify

I have a project that during installation gathers data to place into the programs app.config file. I can get it to add to the config file without issue, though I have ran into the problem of running the MSI under modify to update these settings.

When you run the MSI in maintenance and select the modify button, it leads to the configuration dialogs (that is also present in initial installation) to edit the properties that are used to edit the config file. The issue is that this does not actually modify the config file.


I have found that if I call "Reinstall one or more features" during the modify process it will update the file. I'm not fond of this solution because it will reinstall the entire project, and making a new feature just for the config file seems like overkill (and the config file is not a feature).

Am i missing something like an Ai_XmlConfig call/condition?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: app.config file does not update during modify

Hi,

Please note that this is the normal behavior, the custom action that performs the XML configuration will be executed only if the component related to the XML file will be installed/reinstalled/modified.

So, to update your XML file during modify, you can create a separate feature/sub-feature, place the component related to the XML file under it and call the "Reinstall one or more features" published event for it. If you want that feature not to be displayed in the feature selection tree, you can set the "Not Displayed" option for it in the "Organization" page.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”