[Windows Mobile Software Development] Sleuth255:
Settings customization is pretty advanced stuff. You might want to get going first by simply using User Customization to install some cabs. If I were first starting out, I'd install cabs that customize my device. For example, I have a Tilt, so I would install a Keyboard patch cab for the Tilt layout and another cab that disables the AT&T hidden proxy. This would require two CAB: statements in SDConfig.txt.

However, if you're yearning to do more settings customization, then the "XML:" config statement is the key. Here's my XML provisioning file called SleuthProvisioning.xml. It initializes me in cleartype mode, changes my notification settings, initializes the default SIP to Block Recognizer, sets power and backlight timeouts, re-arranges my today screen and updates my Owner Name. :)

<wap-provisioningdoc>

<!-- ClearType Preferences -->

<characteristic type="Registry">
<!-- Just adding this Key enables ClearType -->
<characteristic type="HKLM\System\GDI\CLEARTYPE">
<parm name="Default" value="0" datatype="integer"/>
<noparm name="Default"/>
</characteristic>
<characteristic type="HKLM\System\GDI\ClearTypeSettings">
<parm name="OffOnRotation" value="0" datatype="integer"/>
</characteristic>

<!-- Owner Preferences -->

<characteristic type="HKCU\ControlPanel\Owner">
<parm name="Name" value="Sleuth 255" datatype="string"/>
<!-- Owner value is SZ_BINARY: 320 Unicode characters (640 bytes). XML "Binary" datatype processes this as Base64-->
<parm name="Owner" value="SwBlAaSwDyuuIIgvrRRvAHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" datatype="binary"/>
</characteristic>

<!-- Notification Preferences -->

<!-- New Email Message -->
<characteristic type="HKCU\ControlPanel\Notifications\{A877D65A-239C-47a7-9304-0D347F580408}">
<parm name="Options" value="2" datatype="integer"/>
</characteristic>
<!-- Reminders -->
<characteristic type="HKCU\ControlPanel\Notifications\{15F11F90-8A5F-454c-89FC-BA9B7AAB0CAD}">
<parm name="Options" value="1073741833" datatype="integer"/>
</characteristic>

<!-- Power/Backlight Timeout Preferences -->

<characteristic type="HKCU\ControlPanel\BackLight">
<parm name="BatteryTimeout" value="240" datatype="integer"/>
<parm name="ACTimeout" value="360" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\System\CurrentControlSet\Control\Power\Timeouts">
<parm name="ACSuspendTimeout" value="300" datatype="integer"/>
<parm name="BattSuspendTimeout" value="180" datatype="integer"/>
</characteristic>

<!-- Application Preferences -->

<characteristic type="HKCU\Software\The Paradigm Group\sipchange\Parameters">
<parm name="DefaultSIP" value="Block Recognizer" datatype="string"/>
<parm name="Delay" value="10" datatype="integer"/>
</characteristic>
<characteristic type="HKCU\Software\Spacreat\SP TimeSync\General settings">
<parm name="Start minimized" value="Yes" datatype="string"/>
</characteristic>
<characteristic type="HKCU\Software\Spacreat\SP TimeSync\NTP client">
<parm name="Autosync period" value="21600" datatype="string"/>
</characteristic>
<!-- Silent Keyboard Sliding Sound -->
<characteristic type="HKLM\Software\HTC\SlidingSound">
<parm name="ActiveSlidingSound" value="0" datatype="integer"/>
<parm name="SlidingSoundEffect" value="0" datatype="integer"/>
</characteristic>

<!-- Today Screen Order/Enabled Preferences -->

<characteristic type="HKLM\Software\Microsoft\Today\Items\HTC Home">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="0" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\Windows Live Search">
<parm name="Enabled" value="1" datatype="integer"/>
<parm name="Order" value="1" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Messaging"">
<parm name="Enabled" value="1" datatype="integer"/>
<parm name="Order" value="5" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Calendar"">
<parm name="Enabled" value="1" datatype="integer"/>
<parm name="Order" value="20" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Tasks"">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="21" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"TomTom"">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="22" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\Windows Live">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="23" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Pocket Plus"">
<parm name="Enabled" value="1" datatype="integer"/>
<parm name="Order" value="24" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Spb Weather"">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="26" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Spb Time"">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="28" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Spb Backup"">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="42" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\"Owner Info"">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="46" datatype="integer"/>
</characteristic>
<characteristic type="HKLM\Software\Microsoft\Today\Items\Getting Started">
<parm name="Enabled" value="0" datatype="integer"/>
<parm name="Order" value="47" datatype="integer"/>
</characteristic>
</characteristic>

<-- File Operations -->
<-- Copy the SP Timesync link to startup so it gets executed whenever I reset -->

<characteristic type="FileOperation">
<characteristic type="%CE2%\Startup" translation="install">
<characteristic type="MakeDir" />
<characteristic type="StartTimeSync.lnk" translation="install">
<characteristic type="Copy">
<parm name="Source" value="\windows\Start Menu\Programs\SP TimeSync.lnk" translation="install" />
</characteristic>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

Lets take a look at this more closely. The XML itself sets up two Configuration Service providers. One is used for registry operations and one for file operations. both are enclosed by the wap-provisioning tags. Here they are shown without any operations:

<wap-provisioningdoc>
<characteristic type="Registry">
</characteristic>
<characteristic type="FileOperation">
</characteristic>
</wap-provisioningdoc>

Registry CSPs

Within the registry type, I set a lot of cool stuff. You should be able to firgure out how it works if you have basic registry skills. Essentially, setting values for any registry key looks like this:

<characteristic type="HKCU\ControlPanel\BackLight">
<parm name="BatteryTimeout" value="240" datatype="integer"/>
<parm name="ACTimeout" value="360" datatype="integer"/>
</characteristic>

First you set the key with the <characteristic type> tag, then you set values with the <parm name> tags. Binary values are a PITA since they're encoded Base 64 (see my entry for Owner Information above). If you want to set owner information as I did in the example, then you need to convert Unicode to Base64. Post here if you want to learn how and I'll show you how I do it.

Special characters within quotes in XML files must be represented using html special character sequences. For instance, the double quote (") character sequence is " so "Today\Items\"Pocket Plus"" would be written as "Today\Items\"Pocket Plus"". The full list of special HTML character sequences can be found here. This is especially important when changing today screen plugin order since some today screen registry entries actually have quotes in the key name. See my provisioning file above under "Today Screen order/enabled preferences" for an example of this.