cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
enGenius
Level 4

Pass multiple features to SdFeature() using szFeatures

I would like to pass more than one feature to SdFeature() using the szFeature string parameter. What is the syntax to accomplish this?

Project Type: InstallScript Project

Failed Code:

//Used comma seperated feature names
szFeatures = "Data\\Deploy Data Pkgs, Application";

SdFeatureTree("TCMS v3.2 Repair", "Please select the features to repaire.","C:\\", szFeatures, 3);

Labels (1)
0 Kudos
(3) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The szFeatures parameter to SdFeatureTree is designed to except an empty string ("") or the name of a top-level feature to be displayed (including its subfeatures). Multiple features cannot be passed to this parameter.

Was there something specific you were trying to accomplish by passing multiple features in this parameter?
0 Kudos
enGenius
Level 4

Yes, I have the following feature and sub-feature structure in my Installscript Project:
-------------------------------------
Feature1
Feature1a

Feature1ab (has SQL Scripts)

Feature1ac (has SQL Scripts)

Feature1b

Feature2 (has msm package)
Feature3
Feature3a (no files, just event scripting)

...

Feature3e (no files, just event scripting)

Feature4
Feature4a

...

Feature4g


-------------------------------------------

I would like to select only feature 3 and feature 4 during a repair install. However features 1 and 2 also run when i attempt this. My code is below.
:confused:


case REPAIR:

// Changed for DevStudio 9, Disk1 files are now always updated when installed
// so when running from ADDREMOVE we need to prevent these files from being
// updated since this will result in files being updated that are locked by the setup.
// Updating these files when running from ADDREMOVE should not be needed since updates
// are not run directly from Add/Remove.
Log_WriteLine("Repair has begin");
if( ADDREMOVE ) then
// Reinstall all previously installed features, except
// disk1 features.
FeatureUpdate( "" );
else
// Install selected features.
//FeatureSelectItem(MEDIA, szFeature,
Log_WriteLine("Repair is not Add Remove. Finding the TCMS Instal Folder...");
if Reg_GetTCMInstallFolders(svAppDir, svDataDir) = 0 then
Log_WriteLine("Calling SDFeatureTree ");

//Remove Additional
FeatureSetData (MEDIA, "Networthiness", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "ProjectConversion", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "SQLSMO", FEATURE_FIELD_VISIBLE, FALSE, szTemp);

//Remove Applications
FeatureSetData (MEDIA, "Application\\DevExperience", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "Application\\StrataFrame", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "Application\\AddIns", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "Application\\SpellChecker", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "Application\\DynaZip", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "Application\\Documents", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "Application\\TCMSCore", FEATURE_FIELD_VISIBLE, FALSE, szTemp);

SdFeatureTree("TCMS v3.2 Repair", "Please select the features to repaire.","C:\\", "", 3);
FeatureMoveData(MEDIA, nvDisk, 0 );
else
Log_WriteLine("Repair Install Aborted: Could not find the install locations for the application and data.");
abort;
endif;

endif;

// Added in 11.0 - Set appropriate StatusEx static text.
SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REPAIR ) );
0 Kudos
enGenius
Level 4

I figured it out. I had to unselect the feature as well as remove the feature using featuresetdata().


//Remove Features
FeatureSetData (MEDIA, "ProjectConversion", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "SQLSMO", FEATURE_FIELD_VISIBLE, FALSE, szTemp);
FeatureSetData (MEDIA, "SQLSMO\\SQLSMO Install", FEATURE_FIELD_VISIBLE, FALSE, szTemp);

//Un-Select Features
FeatureSetData (MEDIA, "ProjectConversion", FEATURE_FIELD_SELECTED, FALSE, szTemp);
FeatureSetData (MEDIA, "SQLSMO", FEATURE_FIELD_SELECTED, FALSE, szTemp);
FeatureSetData (MEDIA, "SQLSMO\\SQLSMO Install", FEATURE_FIELD_SELECTED, FALSE, szTemp);
0 Kudos