jjones
Posts: 68
Joined: Wed Jun 29, 2011 3:30 pm

Modifying XML Configuration Files During Modify Phase

I have an installer where I would like the user to be able to use the "Modify" option to change some settings via custom dialog boxes and then have the XML files rewritten at the end of the Modify stage. This would be done from the maintenance screen of the installer which is only shown if the installer is run on a machine that already has the application on it. This does not seem to be happening after the user navigates through the UI, makes the changes they want to make, and then clicks install.

Where is the "Update ini / XML" file action taking place? Is it possible to force it or call it explicitly?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Modifying XML Configuration Files During Modify Phase

Hello,

Please keep in mind that the related XML file will be updated on maintenance only if its associated component will be reinstalled. If the component containing the XML file will not be reinstalled during maintenance mode the XML will not be updated.

A component is reinstalled only when its containing feature is reinstalled. A feature will be reinstalled during maintenance only when at least a key file (of one of the components contained by the feature) is missing.

So, in order to achieve what you want you can always force a reinstall of the feature containing you XML file. All you have to do is to add a "Reinstall one or more features" published event (on one of your maintenance dialog) which will reinstall your XML feature.

If you want you can add the XML file in a dummy component (e.g. containing a dummy registry value as key resource) and afterwards create a feature which will contain only the dummy component.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”