Meena
Posts: 36
Joined: Thu Dec 12, 2013 9:07 am

How to preserve only the feature information in a text file.

Wed Jun 29, 2016 2:25 pm

Hi Team,

We have a requirement in which it has so many features got displayed. User can select any of the features he wants. During installation, only parent features will be visible, Sub features are not visible & installed based on the parent features selection. Now, I have to write that selected parent feature information(not it's sub-features) into a text file. I tried using the text file update option by appending the ADDLOCAL property. But, it writes all installed parent & Sub-features information. I just want to write the parent features which are displayed during installation.

Could you please help me to achieve this.

Thanks,
Meena

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to preserve only the feature information in a text file.

Thu Jun 30, 2016 2:46 pm

Hello Meena,

Indeed, the "ADDLOCAL" property will contain all the features and sub-features that are installed. In order to be able to write only the displayed features in the text file you can go in the "Custom Actions" page and after the "Install Execution Stage -> Preparing" action group add a "Set installer property" custom action that will set a property to the name of each feature that will be installed.

For this, you need to set the appropriate condition for each custom action as follows: ((&MainFeature = 3) AND NOT (!MainFeature = 3)) (where "MainFeature" is the ID of the feature).

Then, you can use those properties in the "Text File Update" operation. So, if a feature was installed, its related property was set to its name and it will be written in the text file, otherwise its property will be empty and it will not be written in the text file.

Let me know if this helped, otherwise give me more details about your scenario.

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

Meena
Posts: 36
Joined: Thu Dec 12, 2013 9:07 am

Re: How to preserve only the feature information in a text file.

Tue Jul 05, 2016 11:13 am

Hi Eusebiu,

Thanks for your response.
I tried the way what you suggested. I got the result. But, When I run the setup in maintenance(Modify Mode), the non-installed (Not installed during First time installation) feature information is not updated in that file. I've checked Install as well as Maintenance Checkboxes in custom action page. And also whenever I uninstalled the certain feature which is already installed, now I want to remove that particular feature name from that file.

Setup consists of nearly 30 features. Do I need to use 30 set installer properties for this. Is there any another approach to achieve this?

Please help me.

Regards,
Meena

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to preserve only the feature information in a text file.

Tue Jul 05, 2016 2:25 pm

Hello Meena,
But, When I run the setup in maintenance(Modify Mode), the non-installed (Not installed during First time installation) feature information is not updated in that file. I've checked Install as well as Maintenance Checkboxes in custom action page. And also whenever I uninstalled the certain feature which is already installed, now I want to remove that particular feature name from that file.
To have the text file updated on "Modify" mode too, you need to place the "Text File Update" operation under a feature that will always be reinstalled during modify. To achieve this you can follow the steps bellow:
- copy the "Identifier" of the feature that contains the "Text File Update" operation
- go in the Dialog page and select the MaintenanceTypeDlg from the Maintenance folder
- click on the "Modify" button on the dialog
- add a published event by clicking the "New" button from the "Published Events" tab
- select "Reinstall one or more features" from the newly appeared dialog
- in the "Argument" edit box write the feature's identifier that you copied
- do not modify the "Condition" field, then click [OK]

Also, go to the "Append/Create" section of the "Text File Update" operation and check the "If the file exists -> Overwrite" option.
Setup consists of nearly 30 features. Do I need to use 30 set installer properties for this. Is there any another approach to achieve this?
Yes, I'm afraid that you need to create a different "Set installer property" custom action for each feature. Otherwise, you can create your own custom action that verifies all the features and set their related properties (i.e. C#, VBS, etc.).

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

Return to “Common Problems”