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

Correct steps for use "SdFeatureDialog"


5 replies to this topic

mkuggsrock

mkuggsrock
  • Full Members
  • 7 posts

Posted 02 December 2009 - 19:01

Hi,
i have many problems to use object "SdFeatureDialog" because i'm not able to know the exacts steps for use it.

I want that user could select 3 option in dialog and install different feature for every option.

An example:
- Option 1
- Option 2
- Option 3

If i select "Option 1" i want install feature called "FeatureOpt1", elseif i select "Option 2" i want install feature called "FeatureOpt2", elseif i select "Option 3" i want install feature called "FeatureOpt3".


This is my wrong code:


CODE
function ShowProgramsOptions(szTitle, szMsg, svResultPrograms, nStyle)
LIST listPrograms;
BOOL bSelected;
STRING svSelected, svSelectedSel, szMedia, szComponent;
STRING svFeatureName;
NUMBER nDataSize, nResult;
STRING szData;
NUMBER nInfo, nData;
STRING svResult();
NUMBER count;
begin
szMedia = "myMedia";
nDataSize = 0;
bSelected = FALSE;
listPrograms = ListCreate(STRINGLIST);

MEDIA = szMedia;

// Set options
 FeatureAddItem(szMedia, "Option1", nDataSize, 1);
 FeatureAddItem(szMedia, "Option2", nDataSize, 1);
 FeatureAddItem(szMedia, "Option3", nDataSize, 1);

// Show dialog
SdFeatureDialog (szTitle, szMsg, INSTALLDIR, "");

// Set selected option
FeatureListItems(MEDIA, "", listPrograms);

nResult = ListGetFirstString(listPrograms, svSelected);
// For every selected item i install relative feature
while (nResult != END_OF_LIST)
 if (FeatureIsItemSelected(MEDIA, "FeatureOpt1")) then
  FeatureGetData(MEDIA, svSelected, FEATURE_FIELD_MISC, nResult, svFeatureName);
       endif;
  endif;

  nResult = ListGetNextString(listPrograms, svSelected);
endwhile;

ListDestroy(listPrograms);
MEDIA = "DATA"; // Ripristino il media originale.

return 0;
end;


Please could you help me?

What are the sequential steps for a corret use of these objects?
In example:
FeatureAddItem -> SdFeatureDialog -> FeatureListItems -> FeatureIsItemSelected -> FeatureGetData -> etc......

Many thanks for every answer and help.
Mark

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 December 2009 - 08:20

The easiest way might be to use the real features in the dialog, instead of a script created fewature set. However if you need to use the script created features you need to get their selection state (FeatureIsItemSelected) and then select the real features based on that (FeatureSelectItem)

mkuggsrock

mkuggsrock
  • Full Members
  • 7 posts

Posted 03 December 2009 - 08:46

Sorry for my ignorance, but...how can i use the real feature in the dialog??
Thanks for help, but it's the first time that i use this dialog...


mkuggsrock

mkuggsrock
  • Full Members
  • 7 posts

Posted 03 December 2009 - 11:51

Probably it functions now, it's difficult for me...but interesting smile.gif
Many thanks Stefan

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 December 2009 - 17:57

QUOTE
how can i use the real feature in the dialog??

You simply don't change the value of MEDIA, and remove all the other stuff:

CODE

function ShowProgramsOptions(szTitle, szMsg, svResultPrograms, nStyle)
begin

 SdFeatureDialog (szTitle, szMsg, INSTALLDIR, "");

 return 0;
end;


mkuggsrock

mkuggsrock
  • Full Members
  • 7 posts

Posted 04 December 2009 - 07:48

Hi Stefan,
yes, it function very well, it's more simply than script smile.gif
It's interesting learn new features of this software.
Thanks for help, have a good week-end!
Mark