Compartilhar via


FileOperation Configuration Service Provider Example for OMA Client Provisioning

4/8/2010

The FileOperation Configuration Service Provider manages files and directories on the device.

The following XML example can be used as a template to configure settings for the FileOperation Configuration Service Provider. Below the FileOperation characteristic type, replace the value for each parameter and characteristic type with values that correspond to your system.

Note

Characteristics or parameters for the FileOperation Configuration Service Provider contain an additional attribute called "translation" when specifying a parameter 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, double backslashes are removed). A translation of type "install" includes all the translations done for "filesystem", but also translates all CE Strings (for example, %CE2%) into the correct file path for the device. Cabwiz will automatically add the appropriate translation to file operations and registry keys in an .inf file.

Code Example

The following example creates a shortcut for Minesweeper (Minesweeper.lnk), extracts the settings into a file (file1.txt) in a new directory (%CE2%\files), copies those settings into a new file (file2.txt), moves the file to a new location and new file name (file3.txt) while simultaneously removing the Hidden attribute (if it was set), deletes file1.txt and file3.txt, and then deletes the new directory (%CE2%\files).

<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">
         <characteristic type="Extract">
            <parm name="Source" value="file1.001" />
         </characteristic>
      </characteristic>
      <characteristic type="file2.txt">
         <characteristic type="Copy">
            <parm name="Source" 
            value="%CE2%\files\file1.txt" translation="install"/>
         </characteristic>
      </characteristic>
      <characteristic type="file3.txt">
         <characteristic type="Move">
            <parm name="Source" 
            value="%CE2%\files\file2.txt" translation="install"/>
            <parm name="RemoveAttributes" value="H" />
         </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>

Remarks

One provisioning XML file typically contains configuration information for multiple Configuration Service Providers. To use this example, you must replace the values as appropriate, and add the node as a child of the OMA Client Provisioning file. For information about the syntax of this file, see OMA Client Provisioning Files. For examples, see OMA Client Provisioning XML File Examples.

See Also

Reference

FileOperation Configuration Service Provider Example for OMA Client Provisioning
FileOperation Configuration Service Provider