CPack WIX - disable feature by default

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

CPack WIX - disable feature by default

tonka tonka



I’ve create an installer with cpack and WIX (cpack –G WIX). Everything works fine, but I have one big problem.


I have 2 features, which are created by cpack(wix).


    <Feature Id="ProductFeature" Display="expand" ConfigurableDirectory="INSTALL_ROOT" Title="MyApp" Level="1">

         <Feature Id="CM_C_dev" Title="Development" Description=" Development "/>

         <Feature Id="CM_C_runtime" Title="Runtime" Description="Runtime"/>



My Problem:

I want to deactivate the CM_C_dev feature by default (CPACK_WIX seems to ignore my set(CPACK_COMPONENT_DEV_DISABLED ON)  ). The user should be able to activate it if he/she wants that. I know how I can do it with WIX itself (handmade), but I have big troubles to inject that into the cpack_wix flow.

I have to add Level=”2” to the Feature with the Id=”CM_C_DEV” like


    <Feature Id="CM_C_dev" Title="Development" Description=" Development " Level=”2”/>


or add a property (as value) like


    <Feature Id="CM_C_dev" Title="Development" Description=" Development ">DISABLE_FEATUREA</Feature>


I’ve tried the CPACK_WIX_PATCH function, but I’m only able to add something to the ProductRoot feature (ID=”ProductFeature”) via



      <CPackWiXFragment Id="#PRODUCTFEATURE">

            <Environment Id="MyEnvironment" Action="set" Name="MyVariableName" Value="MyVariableValue"/>




But not into the subfeature CM_C_dev


Does anybody know how I can do that (or maybe another way)?


Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: