How to change the Feature state in a custom action
Posted 10 November 2005 - 19:45
I'm trying to change the feature based on User's chose.
How do i do that.
I tried calling the function MsiSetFeatureState but it did not change the Feature from
ACMSAMPLE; Installed: Absent; Request: Local; Action: Local
ACMSAMPLE; Installed: Absent; Request: null; Action: null
'm calling :
MsiSetFeatureState(hMSI, sFeatureName.GetBuffer(MAX_PATH), INSTALLSTATE_ABSENT)
Please can anyone help....
Posted 11 November 2005 - 10:12
Are you sequencing your custom action properly (there are restriction on when you can call MsiSetFeatureState)?
Why don't you simply add a Remove control event to the Next button of the dialog where the user makes the choice?
Posted 14 November 2005 - 03:37
I know the cause of the problem. Its cause by the InstallLevel and the FeatureLevel mismatch.
Is there any way to get the InstallLevel programmically?
I see that there is a function to set the installlevel(MsiSetInstallLevel) but before i change the install level i would like to save the original installlevel.
Posted 14 November 2005 - 05:46
Wat about the FeatureLevel? I know it is in the Feature table but how can i access the Feature table to get the FeatureLevel information out.
As far as i see, the MISGET... function all getting from Property table only.
Any advice would be very much appreciated.
Posted 14 November 2005 - 09:34
Posted 15 November 2005 - 03:43
I have a few features and not all of them are having the same feature level.
I'm writing a C code to read the user's selection from an application (created in C++) and based on user's selection, i will disable/enable the feature. By settng the feature state to INSTALLSTATE_LOCAL if selected and INSTALLSTATE_ABSENT if deselected.
I have tried using the function MsiSetFeatureState but that function will not work if my INSTALLLEVEL is different from the FEATURELEVEL that i like to change.
Is there any other way to change the feature state programmically?