This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- InstallScript Project: Determine Selected Features
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2014
03:28 PM
InstallScript Project: Determine Selected Features
Hello, I am an InstallShield newbie. I've searched for hours for a satisfactory answer to no avail.
I created an "InstallScript" type project (not "InstallScript MSI") and am attempting to determine features that were selected by the user in the SdFeatureTree dialog for a new installation. I discovered that FeatureIsItemSelected only determines which features are currently installed - which is not what I want. I am not sure if FeatureGetData( MEDIA, "FeatureName", FEATURE_FIELD_SELECTED, ...) is supposed to determine if a feature is currently installed or is selected in the SdFeatureTree dialog. If it is the latter, it does not seem to work. Here is my InstallScript code:
I always receive the "NOT selected" message box, regardless of whether or not "FeatureName" is selected in the SdFeatureTree dialog. Am using the feature names specified at each node by the Feature Tree View, not the display names.
Thank you!
- Roger
I created an "InstallScript" type project (not "InstallScript MSI") and am attempting to determine features that were selected by the user in the SdFeatureTree dialog for a new installation. I discovered that FeatureIsItemSelected only determines which features are currently installed - which is not what I want. I am not sure if FeatureGetData( MEDIA, "FeatureName", FEATURE_FIELD_SELECTED, ...) is supposed to determine if a feature is currently installed or is selected in the SdFeatureTree dialog. If it is the latter, it does not seem to work. Here is my InstallScript code:
szTitle = "";
szMsg = "";
nLevel = 2;
nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, szFeatures, nLevel );
if ( nResult = BACK )
then
goto Dlg_SetupType2;
else
FeatureGetData( MEDIA, "FeatureName", FEATURE_FIELD_SELECTED, nResult, szResult );
if ( nResult = TRUE )
then
MessageBox( "FeatureName selected", MB_OK );
else
MessageBox( "FeatureName NOT selected", MB_OK );
endif;
endif;
I always receive the "NOT selected" message box, regardless of whether or not "FeatureName" is selected in the SdFeatureTree dialog. Am using the feature names specified at each node by the Feature Tree View, not the display names.
Thank you!
- Roger
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2014
08:08 AM
Roger,
I do use FeatureIsItemSelected in my InstallScript Only project to determine if a user has checked a feature for installation. Here's an example. I store the results in boolean variables since I reference it several times later on.
http://helpnet.flexerasoftware.com/installshield18helplib/mergedProjects/installshield18langref/LangrefFeatureIsItemSelected.htm
HTH
I do use FeatureIsItemSelected in my InstallScript Only project to determine if a user has checked a feature for installation. Here's an example. I store the results in boolean variables since I reference it several times later on.
Dlg_SdFeatureTree:
szTitle = "";
szMsg = "";
if (nSetupType = CUSTOM) then
nResult = SdFeatureTree(szTitle, szMsg, TARGETDIR, "", 2);
if (nResult = BACK) goto Dlg_SetupType;
// internal names of features that can be installed; must correspond with
// those listed in Organization\Features
bInstallDATABASE = ( FeatureIsItemSelected( MEDIA, "Database" ) = 1 );
bInstallWEBSITE = ( FeatureIsItemSelected( MEDIA, "WebSite" ) = 1 );
svInstallFailMsg = "";
if ( bInstallWEBSITE ) then
// user has chosen a feature that requires .NET Framework 4.0
if bvHasDotNet4 then
// user does not have .NET 4.0 Framework installed
svInstallFailMsg = szFrameworkMissing;
endif;
endif;
if svInstallFailMsg != "" then
MessageBox( svInstallFailMsg, SEVERE );
abort;
endif;
endif;
http://helpnet.flexerasoftware.com/installshield18helplib/mergedProjects/installshield18langref/LangrefFeatureIsItemSelected.htm
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 11, 2014
11:53 AM
Thank you. It turns out I was specifying the feature name incorrectly. The FeatureIsItemSelected does correctly indicate whether or not a feature is "checked" or "unchecked" in the SdFeatureTree dialog.
Regards,
- Roger
Regards,
- Roger