Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to disable subfeature in run time


2 replies to this topic

vvasilev

vvasilev
  • Full Members
  • 11 posts

Posted 19 June 2009 - 11:17

I have difficulties to disable/deselect a subfeature during run time.

In a custom installation mode a have a feature with two subfeatures. They are not self-excluding!

What I tried to do is checking for a certain registry key in a custom action function and use the function

MsiSetFeatureState(hMSI, "Feature\\SubFeat1", INSTALLSTATE_ABSENT);

when the registry entry doesn't exist. The function is fired up when the user selects "Custom Installation" and hits Next.

This approach works fine on a parent feature, but it seems not to work on a subfeature... sad.gif

Any ideas?

Thanks in advance

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 June 2009 - 18:41

In Windows Installer this works differently than in InstallScript. Use just the feature name, without parent
MsiSetFeatureState(hMSI, "SubFeat1", INSTALLSTATE_ABSENT);


vvasilev

vvasilev
  • Full Members
  • 11 posts

Posted 22 June 2009 - 10:31

Stefan,

works great!

Thanks a lot!