PDA

View Full Version : InstallScript FeatureGetData & FeatureValidate



LisDani21
07-18-2005, 07:41 AM
Hi,

I am trying to add a password to one of our newly added Features. I have set the password in the SetupDesign Feature. I then added the Dialog in my script. How do I validate my feature correctly? It seems to just ignore what I am typing in! :eek:

This is the code I have, please if someone could help me out ASAP I would greatly appreciate it. Thanks!

FeatureDialog (szTitle, szMsg, svDir, "");
szFeaturePassword = 'tipsplease';
FeatureGetData (MEDIA, FEATURE_TIPS_DISPLAYNAME,FEATURE_FIELD_PASSWORD, nvData, svData);
if (nResult && nvData) then
bPwdValid = FALSE;
while (!bPwdValid)
AskText (PASSWORD_PROMPT, "", svResult);
nResult = FeatureValidate (MEDIA, FEATURE_TIPS_DISPLAYNAME,svResult);
if (nResult = 0) then
bPwdValid = TRUE;
else
MessageBox (PASSWORD_ERRMSG, SEVERE);
endif;
endwhile;

nResult = FALSE;
nvData = FALSE;
nResult = FeatureIsItemSelected (MEDIA, FEATURE_TIPS_DISPLAYNAME);

Enable (BACKBUTTON); // Restore Back button's default status.
endif;


end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowEnterPassword //
// //
// Purpose: This function handles the Feature Password. //
// //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowEnterPassword()
NUMBER nResult;
STRING szDefault, svResult, szMsg, szMediaLibrary, szFeature,szFeaturePassword;
begin

szMsg = "Please enter a password for the Library";
szDefault = "";
nResult = EnterPassword ( szMsg, szDefault, svResult );
FeatureValidate (MEDIA, "Library", szFeaturePassword);
return nResult;
end;