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

Uninstall when all features are unchecked

Hello everyone! I am having some trouble using IS2008 and thought maybe you guys could help me. In maintenance mode/modify, I want to uninstall my software if all the boxes are unchecked (in the SdFeatureTree). How can i do this? I was giving it a swing in the OnMaintUIBefore function and didnt know got stuck 'cause i really don't know how to get the number of features unchecked in the tree. Thanks for your support!

Alberto
Labels (1)
0 Kudos
(3) Replies
polloymedio
Level 4

hmm checking a little bit more into my problem, i can see that installing my program if i dont check any features, it still says that 3.87MB are required for my installation. Could this be because the setup.exe decompressed and the msi file in the temp folder is 3.87MB? if not what is it?? plz help! Im concerned about this because maybe it isnt letting me uninstall the program because of this hidden files.

thanks a lot.
0 Kudos
polloymedio
Level 4

Please anyone, any reply is welcome!
0 Kudos
polloymedio
Level 4

ok i figured out how to make it work :3

I made a function something like this:

function BOOL NoFeaturesSelected()  
NUMBER nvResultA, nvResultB, nvResultC;
STRING svResult;
begin
FeatureGetData(MEDIA, "FeatureName\\SubFeature A",FEATURE_FIELD_SELECTED, nvResultA, svResult);
FeatureGetData(MEDIA, "FeatureName\\SubFeature B",FEATURE_FIELD_SELECTED, nvResultB, svResult);
FeatureGetData(MEDIA, "FeatureName\\SubFeature C",FEATURE_FIELD_SELECTED, nvResultC, svResult);

if ((nvResultA = 0) && (nvResultB = 0) && (nvResultC = 0)) then
// features NOT selected
return TRUE;
else
// At least 1 feature is selected
return FALSE;
endif;
end;


and in the case Modify of the OnMaintUIBefore section, something like this:

case MODIFY:   



if (NoFeaturesSelected()) then
// Ensure that all previously installed features are removed
// for media that supports updating.
MediaGetData( MEDIA, MEDIA_FIELD_MEDIA_FLAGS, nMediaFlags, szIgnore );

if( nMediaFlags & MEDIA_FLAG_UPDATEMODE_SUPPORTED ) then
FeatureRemoveAllInMediaAndLog();
else
FeatureRemoveAllInMedia();
endif;

// Added in 11.0 - Set appropriate StatusEx static text.
SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) );

else
// Added in 11.0 - Set appropriate StatusEx static text.
SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_MODIFY ) );
endif;
0 Kudos