[CMake] CPack WIX - disable feature by default

tonka tonka tonka3100 at gmail.com
Tue Mar 7 04:25:39 EST 2017


Hello,



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"/>

    </Feature>



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



    <CPackWiXPatch>

      <CPackWiXFragment Id="#PRODUCTFEATURE">

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

      </CPackWiXFragment>

    </CPackWiXPatch>



But not into the subfeature CM_C_dev



Does anybody know how I can do that (or maybe another way)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170307/0ff0671c/attachment.html>


More information about the CMake mailing list