Browse Source

Merge topic 'wix-disabled-components'

ad453f05 CPackWIX: Support CPACK_COMPONENT_<compName>_DISABLED
6f108f84 CPackComponent: Document the *_HIDDEN and *_DISABLED variables
Brad King 9 years ago
parent
commit
5ec03c93fc

+ 6 - 0
Help/release/dev/wix-disabled-components.rst

@@ -0,0 +1,6 @@
+wix-disabled-components
+-----------------------
+
+* The CPack WIX generator now supports
+  :variable:`CPACK_COMPONENT_<compName>_DISABLED`.
+  This can be used to deselect a component from being installed by default.

+ 9 - 1
Modules/CPackComponent.cmake

@@ -75,9 +75,17 @@
 #
 #  The dependencies (list of components) on which this component depends.
 #
+# .. variable:: CPACK_COMPONENT_<compName>_HIDDEN
+#
+#  True if this component is hidden from the user.
+#
 # .. variable:: CPACK_COMPONENT_<compName>_REQUIRED
 #
-#  True is this component is required.
+#  True if this component is required.
+#
+# .. variable:: CPACK_COMPONENT_<compName>_DISABLED
+#
+#  True if this component is not selected to be installed by default.
 #
 # .. command:: cpack_add_component
 #

+ 4 - 0
Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx

@@ -86,6 +86,10 @@ void cmWIXFeaturesSourceWriter::EmitFeatureForComponent(
     AddAttribute("Display", "hidden");
   }
 
+  if (component.IsDisabledByDefault) {
+    AddAttribute("Level", "2");
+  }
+
   EndElement("Feature");
 }