PDA

View Full Version : FeatureSetData/FeatureSelectItem failing -105



StickyC
06-21-2004, 06:14 PM
I've got an international InstallScript project in DevStudio 9 that I'm trying to do some conditional Feature installs. I'm trying to use the FeatureSetData or FeatureSelectItem calls to choose the files to be installed, but the calls are failing.

The Feature table looks like this:
Desktop\Files1
Desktop\Files2
Under each of the FilesX Features, there are several language-specific Components. There are also language-specific Components under the root Desktop Feature as well. There are additional root level Features that aren't relevant to this issue.

In my script, I read a registry setting, and based on the result, install Files1 or Files2 by setting the Feature Field true for Files1 and False for Files2 or vice versa. I also need to install the Components under the Desktop feature itself.

The calls look something like this:
nResult=FeatureSetData(MEDIA, FILE1_FEATURE_NAME, FEATURE_FIELD_SELECTED, FALSE, szTemp);
nResult=FeatureSetData(MEDIA, FILE2_FEATURE_NAME, FEATURE_FIELD_SELECTED, TRUE, szTemp);

I have FILE1_FEATURE_NAME #defined in a header file as "Desktop\\Files1" and FILE2_FEATURE_NAME #defined as "Desktop\\Files2".

In the debugger, I can see both of the FeatureSetData calls fail with nResult = -105, which is an invalid feature name. I've triple checked the feature names, they match my layout. I've also tried using the FeatureSelectItem call and get the same error.
I tried putting a call to FeatureError after (using the code sample in the Help), but it just returns blank entries.

I've tried the call as the last entry in OnFirstUIBefore and I've tried positioning it immediately before Dlg_SdFeatureTree with the same results.

The installer is set to not allow the user to "selectively install only certain parts of the application".

The Components that lie directly under the Desktop Feature are being installed just fine.

What the heck am I missing here?

StickyC
06-22-2004, 12:28 PM
Aha! Found the problem. I'd created the File1 and File2 Features well into the project. New features apparently are not automatically added to Release targets so the File1 and File2 Features weren't being included in the builds. I went back through with the Release Wizard, added the Features and now all works well.

Turning on the SdFeatureTree gave me the tipoff as the features werent even listed in the tree.