How to update a new data to config file when new feature selected in a single instance. - Advanced Installer Community
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

How to update a new data to config file when new feature selected in a single instance.

Hi Team,

how to update a new data to config file when new feature selected in a single instance installation.
ex: web.config file having data it's link with Feature A, when New feature B is selected, new data to be added or appended to the same web.config in a single installation instance.

Providing a sample project file (Sample)for reference, if you need any clarification please revert.

Please give up your comments & provide appropriate solution.

Am attaching the expected web.config result in a name "Web_expected.config"

With Regards,
Pradeep.
Attachments
Sample.zip
(328.86 KiB) Downloaded 363 times
Web_expected.zip
(5.91 KiB) Downloaded 373 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to update a new data to config file when new feature selected in a single instance.

Hi Pradeep,

In order to achieve this, you can create the elements that you want in your "XML Edit" file from the "Files and Folders" page and set an appropriate condition for them in the "Element Settings" tab.

For example, if you set the "((&B = 3) AND NOT (!B = 3))" condition for an element, it will be created only if the feature with the ID "B", will be installed.

Another solution is to create a "Text File Update" operation that will update the XML file only if the desired feature will be installed.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: How to update a new data to config file when new feature selected in a single instance.

HI Eusebiu,

In this case both features are selected in a single instance at time. explain your scenario based on this inputs ?

With Regards,
Pradeep.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to update a new data to config file when new feature selected in a single instance.

Hi Pradeep,

I'm afraid that I do not fully understand your request. Can you please give me more details?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: How to update a new data to config file when new feature selected in a single instance.

HI ,

My question is both features are selected in the first time installation, how we can append the new data from selected feature to common file web.config assigned to the another feature both are installed on the same time.

1 > As per ur suggestion am not able to set the feature based condition on the new element for web.config file (Am using 11.7.1 version of advanced installer)

2> Text file updation lets consider we are installing file to c:\test\web.config, this config added under "Feature A". by adding a text file with same name web.config to the same location c:\test\web.config its not able to update when i select both features during first time installation.

Note: Config is updated with some property values a based on user selection on wizards.

With Regards,
pradeep.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to update a new data to config file when new feature selected in a single instance.

Hi Pradeep,

Unfortunately, the version of Advanced Installer that you use does not have the option to add condition for XML elements.

In this case you can follow the steps below:
- create a new subfolder under the "Application Folder", go to its properties and check the "Install folder content into the parent folder" option for it
- create a "Text File Update" operation that will update the XML file only when the second feature is installed
- place the "Text File Update" operation in the subfolder you created
- set the same name for the "Text File Update" operation as for the XML operation
- go in the "Organization" page and add the "Text File Update" operation in the second feature
- go in the "Table Editor" page, "InstallExecuteSequence" and modify the sequence of the "AI_TxtUpdaterInstall" action from "5101" to "5104"
- build and run the project

I attached your project with these modification applied to it, so you can test it.

Best regards,
Eusebiu
Attachments
Sample1.aip
(83.41 KiB) Downloaded 345 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”