PDA

View Full Version : Uninstall when all features are unchecked



polloymedio
07-03-2007, 12:31 PM
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

polloymedio
07-03-2007, 02:05 PM
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.

polloymedio
07-04-2007, 10:11 AM
Please anyone, any reply is welcome!

polloymedio
07-04-2007, 11:59 AM
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;