PDA

View Full Version : Determining installed features during a modify install



EKallen
01-16-2009, 01:08 PM
I'm trying to determine which features are already installed during a Modify install. I've tried using FeatureIsItemSelected, but I'm not sure what to pass in for the szFeatureSource parameter. I've tried MEDIA, but that seems to return TRUE regardless.

Is this the right function to call? What should I be using for szFeatureSource?

Thanks,
-Ed

EKallen
01-23-2009, 01:53 PM
I found the answer! The function to call is MsiGetFeatureState. My code now looks something like this:

NUMBER nInstalled, nAction;
BOOL bFeatureInstalled;

//...
if (MsiGetFeatureState(IMSI_HANDLE, "FeatureName", nInstalled, nAction) = ERROR_SUCCESS) then
if (nInstalled = INSTALLSTATE_LOCAL) then
bFeatureInstalled = TRUE;
else
bFeatureInstalled = FALSE;
endif;
else
//...
endif;