Skip to main content

Set Variable "Search"

User stories

  • As a Setup developer I can declaratively author setting variables such that I don't have to write code to set variables.


Add a new "search" element called SetVariable that can be scheduled during Detect just like any other search:

<xs:element name="SetVariable">
<xs:documentation>Schedules a "search" that sets a variable to the given value.</xs:documentation>
<xse:parent namespace="" ref="Bundle" />
<xse:parent namespace="" ref="Fragment" />
<xs:attributeGroup ref="SearchCommonAttributes" />
<xs:attribute name="Value" type="xs:string">
<xs:documentation>New value for the variable.</xs:documentation>
<xs:attribute name="Type">
<xs:documentation>Type of the variable, inferred from the value if not specified.</xs:documentation>
<xs:restriction base="xs:string">
<xs:enumeration value="string" />
<xs:enumeration value="numeric" />
<xs:enumeration value="version" />
<xs:anyAttribute namespace="##other" processContents="lax">
Extensibility point in the WiX XML Schema. Schema extensions can register additional
attributes at this point in the schema.


If we want to allow setting variables outside of Detect, then we may want to rename this element.

See Also