Search
Desktop

Windows Server 2008 and Windows Vista : Creating Custom ADMX and ADML Files (part 3) - Core ADMX File Concepts

Published 2 min readBy Programming4us Editorial Team

5. Tying the ADMX and ADML Files Together

The ADMX file is responsible for creating the category and policy structure within the GPME, whereas the ADML file is responsible for the text for the category, policy, and any other elements used. Any number of ADML files can be used with a single ADMX file to create language-specific interfaces.

The policy section in the ADMX file creates each individual policy within the GPME. Because the policy must have associated text, the ADMX file must reference the ADML file to supply the correct text for the policy wording. To do this, use the presentation element in the policy statement, as shown in the following snippet from an ADMX file:

<policy name="Sample_Checkbox" class="Machine"
displayName="$(string.Sample_Checkbox)"
explainText="$(string.Sample_Checkbox_Help)"
presentation="$(presentation.Sample_Checkbox)"
key="Software\Policies\Examples">
<parentCategory ref="CHECKBOX_CATEGORY"/>
<supportedOn ref="windows:SUPPORTED_ProductOnly"/>
<elements>
<boolean id="Checkbox" valueName="ExampleCheckbox">
<trueValue>
<decimal value="1"/>
</trueValue>
<falseValue>
<decimal value="0"/>
</falseValue>
</boolean>
...

Note that the presentation element references the presentation.Sample_Checkbox variable. This variable is defined in the ADML file, shown here:

<presentation id="Sample_Checkbox">
<checkBox refId="Checkbox">Check box text</checkBox>
</presentation>

Because these two entries for presentation match and there are the same number of entries in both the ADMX and ADML file, the display should correctly show the check box with the “Check box text.”

Warning


You should also be aware of the data type that is used in the ADMX file and how it matches with the parameter definition in the ADML file. The ADMX file uses the boolean data type, which matches the checkBox parameter definition in the ADML file. Table 4 shows how to match the data types from the ADMX file to the associated parameter definitions in the ADML file.

Table 4. ADMX Data Type to ADML Parameter Definition Matrix

ADMX File Data TypeADML File Parameter Definition
boolean ElementcheckBox Element
text ElementtextBox Element
decimal Element (elements)decimalTextBox Element
text ElementcomboBox Element
enum ElementdropdownList Element
item ElementdropdownList Element
list ElementlistBox Element