Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Feature Condition do not work


4 replies to this topic

trshyam01

trshyam01
  • Full Members
  • 8 posts

Posted 03 April 2007 - 07:10

I have two Features,
FEature 1 and Feature 2.
and each feature has a condition;
i.e. Feature 1-> ISFEATURE1=1 and Level =0
Feature 2-> ISFEATURE2=1 and Level =0

In the First InstallScript Custom action - ;
In Which I set the properties;

function MyFunction1(hMSI)
// To Do: Declare local variables.
begin

// To Do: Write script that will be executed when MyFunction is called.
MsiSetProperty (hMSI, "ISFEATURE1","0");
MessageBox("ISFEATURE1 0", INFORMATION);
MsiSetProperty (hMSI, "ISFEATURE2","1");
MessageBox("ISFEATURE2 1", INFORMATION);

end;

The first Custom action is called in the DoAction of the Next button of Licesnse Dialog;


The Second InstallScript Custom action is as follows:

function MyFunction2(hMSI)
// To Do: Declare local variables.
INT nSize;
STRING szGet;
begin

// To Do: Write script that will be executed when MyFunction is called.
MsiGetProperty(hMSI,"ISFEATURE1",szGet,nSize);
MessageBox(szGet, INFORMATION);
MsiGetProperty(hMSI,"ISFEATURE2",szGet,nSize);
MessageBox(szGet, INFORMATION);
end;

This is called in the DoAction of Next Button of the Destination Folder Dialog. The Custom Action is getting called for sure as I see the Message Boxes. THe properties get set as set in MyFunction1.

But, The Condition for the features,
i.e. Feature 1-> ISFEATURE1=1 and Level =0
Feature 2-> ISFEATURE2=1 and Level =0

Does not work,

I see both the Features, on the contary only Feature 1 should be displayed in the Custom Setup dialog as the property ISFEATURE2 is set to 1 in the InstallScript Custom action.

To throw more light only if the Custom Action (MyFunction1) is set to execute in INSTALL UI SEQUENCE to does the condition for the feature work. Does that Mean that the Condition are evaluated only during FIRST ACTION?

Edited by trshyam01, 03 April 2007 - 07:13.


trshyam01

trshyam01
  • Full Members
  • 8 posts

Posted 03 April 2007 - 10:13

Also I assume that the feature dialog cannot reflect the property change. Is it true. Is there a dynamic way in which I can Hide and show depending on the property change, since setting the level to 0 on condition is not working.





Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 April 2007 - 18:03

Feature conditions are evaluated during the CostFinalize action, before your dialogs are displayed.

trshyam01

trshyam01
  • Full Members
  • 8 posts

Posted 05 April 2007 - 13:51

Thanks, Stefen. I though of a workaround i.e. to make my own dialog.

Can I show check boxes in the Selection Tree control. If it is possible can you let me know the way to do it.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 April 2007 - 14:26

No, but you could make a dialog with checkbox controls instead.