Setup XML in .cab and .cpf Files
The _setup.xml files contain XML instructions. A .cab file created for Smartphone by using CABWizSP contains a setup file, _setup.xml, that holds XML instructions for the installer on how installation should proceed. Pocket PC and Smartphone can both use _setup.xml files to provide configuration instructions for .cpf files.
- A hand-made _setup.xml can be used with the makecab.exe utility to generate .cpf files for Pocket PC and Smartphone.
- _setup.xml is generated from the .inf file by CabWizSP for Smartphone .cab files.
- A Pocket PC .cab file that was created with CABWiz does not have a _setup.xml file. Instead, stores the instructions on how the application should be installed in a .dat file.
CABWizSP creates the _setup.xml files automatically, based on instruction script in an .inf file. In most situations, a developer writing an application for Smartphone will use CABWizSP to package the file, and will not need to insert additional XML.
The CAB Installer and Configuration Manager process the .cab or .cpf file after it reaches the device. The CAB installer extracts the contents of the .cab or .cpf file and sends the _setup.xml file to Configuration Manager for processing. The Configuration Manager is the central authority that processes the setup XML files that are included in the Smartphone .cab file, and the .cpf provisioning files on Smartphone and Pocket PC. Configuration Manager calls various Configuration Service Providers to configure the device and complete the installation.
Characteristics or parms for the Metabase Configuration Service Provider or the Registry Configuration Service Provider can contain an additional attribute called translation. Characteristics or parms for the FileOperation Configuration Service Provider must have a valid translation attribute when you are specifying a parm or characteristic that contains a file name or directory. The two values for this attribute are filesystem and install. A translation of type filesystem causes all file paths to be canonicalized (that is, the double backslashes are removed). A translation of type install includes all of the translations done for filesystem, but also translates all Windows CE Strings (for example, %CE2%) into the correct file path for the device. CABWizSP translates the .inf file into XML.
The following is a sample XML provisioning document that illustrates the types of operations that are possible when using the Configuration Manager. This XML was created by using CABWizSP and the .inf file that is in the Information File Creation topic. It moves the Microsoft Minesweeper files to the correct directory, creates a shortcut, and then adds two registry keys.
Note The AppName parm can have a maximum of 70 characters.
<wap-provisioningdoc>
<characteristic type="Install">
<parm name="InstallPhase" value="install" />
<parm name="AppName" value="Microsoft Mine Sweeper" />
<parm name="InstallDir" value="%CE1%\Mine Sweeper" translation="install" />
<parm name="NumDirs" value="2" />
<parm name="NumFiles" value="3" />
<parm name="NumRegKeys" value="1" />
<parm name="NumRegVals" value="2" />
<parm name="NumShortcuts" value="1" />
</characteristic>
<characteristic type="FileOperation">
<characteristic type="%CE14%" translation="install">
<characteristic type="MakeDir" />
<characteristic type="Minesweeper.lnk" translation="install">
<characteristic type="Shortcut">
<parm name="Source" value="%CE2%\winmine.exe"
translation="install"/>
</characteristic>
</characteristic>
</characteristic>
<characteristic type="%CE2%\files" translation="install">
<characteristic type="MakeDir" />
<characteristic type="file1.txt" translation="install">
<characteristic type="Extract">
<parm name="Source" value="file1.001" />
</characteristic>
</characteristic>
<characteristic type="file2.txt" translation="install">
<characteristic type="Copy">
<parm name="Source" value="%CE2%\files\file1.txt"
translation="install"/>
</characteristic>
</characteristic>
<characteristic type="file3.txt" translation="install">
<characteristic type="Move">
<parm name="Source" value="%CE2%\files\file2.txt"
translation="install"/>
</characteristic>
</characteristic>
<characteristic type="%CE2%\files\file1.txt"
translation="install">
<characteristic type="Delete">
<parm name="ForceDelete"/>
</characteristic>
</characteristic>
<characteristic type="%CE2%\files\file3.txt"
translation="install">
<characteristic type="Delete">
<parm name="ForceDelete"/>
</characteristic>
</characteristic>
<characteristic type="%CE2%\files" translation="install">
<characteristic type="RemoveDir" />
</characteristic>
</characteristic>
</characteristic>
<characteristic type="Registry">
<characteristic type="HKCU\Software\Mine Sweeper">
<parm name="MajorVersion" value="1" datatype="integer" />
<parm name="MinorVersion" value="0" datatype="integer" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
See Also
.cab Files | .cpf Files | FileOperation Configuration Service Provider | Registry Configuration Service Provider
Last updated on Friday, April 22, 2005
© 2005 Microsoft Corporation. All rights reserved.
Send feedback on this topic to the authors.