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

MsiGetFeatureState

Hi,

When i call the MsiGetFeatureState function, I always get a value of 2 which represents INSTALLSTATE_ABSENT. I assume this is happening because it can not find the feature which i have passed in as a parameter. But i do not know where i am going wrong because i am hard coding the feature name into the function call.

ie.

MsiGetFeatureState(hMSI,"featureName",installState,actionState);

I always get a value of 2 for installState.

Any help or suggestions would be appreciated

Thanks,
Suchin
Labels (1)
0 Kudos
(2) Replies
Reddy611
Level 6

Try like..

You came to know that..the feature is selected or not.

szFeature = "X-Feature name";
MsiGetFeatureState(hMSI, szFeature, lResult, lAction);

if (lAction > 0 ) then
MsiSetProperty(ISMSI_HANDLE,"PINS","1");
else
MsiSetProperty(ISMSI_HANDLE,"PINS","0");
endif;


If it returns "1" means he selectd the feature to install in the target diretory.

i think Code will help.

Thanks

Reddy 611
0 Kudos
suchin_kumar
Level 4

Hi Reddy,

Thanks for the reply. However, I need to check the value during Repair, in the maintenance mode.

-Suchin
0 Kudos