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 Selection


1 reply to this topic

Soulbait

Soulbait
  • Members
  • 3 posts

Posted 04 March 2005 - 20:33

I am trying to have a feature enabled/disabled based off a findfile.

But so far no matter which file it finds it always sets feature3 to true.

I've tried the code 2 ways.

CODE

if (FindFile (szPath2, V2, svResult) < 0) then
       if (V2 = szFile1) then
               FeatureSetData( MEDIA, "Feature1", FEATURE_FIELD_SELECTED, TRUE, "Selected Feature1" );
               FeatureSetData( MEDIA, "Feature2", FEATURE_FIELD_SELECTED, FALSE, "Selected Feature2" );
               FeatureSetData( MEDIA, "Feature3", FEATURE_FIELD_SELECTED, FALSE, "Selected Feature3" );
       elseif (V2 = szFile2) then
               FeatureSetData( MEDIA, "Feature1", FEATURE_FIELD_SELECTED, FALSE, "Selected Feature1" );
               FeatureSetData( MEDIA, "Feature2", FEATURE_FIELD_SELECTED, FALSE, "Selected Feature2" );
               FeatureSetData( MEDIA, "Feature3", FEATURE_FIELD_SELECTED, TRUE, "Selected Feature3" );
       elseif (V2 = szFile3) then
              FeatureSetData( MEDIA, "Feature1", FEATURE_FIELD_SELECTED, FALSE, "Selected Feature1" );
              FeatureSetData( MEDIA, "Feature2", FEATURE_FIELD_SELECTED, TRUE, "Selected Feature2" );
              FeatureSetData( MEDIA, "Feature3", FEATURE_FIELD_SELECTED, FALSE, "Selected Feature3" );
       endif;
endif;


and

CODE

if (FindFile (szPath2, V2, svResult) < 0) then
      if (V2 = szFile1) then
              FeatureSelectItem( MEDIA, "Feature1", TRUE);
              FeatureSelectItem( MEDIA, "Feature2", FALSE);
              FeatureSelectItem( MEDIA, "Feature3", FALSE);
      elseif (V2 = szFile2) then
              FeatureSelectItem( MEDIA, "Feature1", FALSE);
              FeatureSelectItem( MEDIA, "Feature2", FALSE);
              FeatureSelectItem( MEDIA, "Feature3", TRUE);
      elseif (V2 = szFile3) then
              FeatureSelectItem( MEDIA, "Feature1", FALSE);
              FeatureSelectItem( MEDIA, "Feature2", TRUE);
              FeatureSelectItem( MEDIA, "Feature3", FALSE);
      endif;
endif;


So far I have not been able to get it to not use feature3....

Edited by Soulbait, 04 March 2005 - 20:36.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 March 2005 - 15:43

What's the value of V2 before calling this code? FindFile will not change the value of V2. So the result will mainly depend on the value you assign to V2, and the vakues of szFile1, szFile2, szFile3.
(Hint: step through your code in the debugger)