Share via


FileOperation Configuration Service Provider Example

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

Note This Configuration Service Provider is not available on Windows Mobile-based Pocket PC.

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 parm and characteristic type with values that correspond to your system.

Note Characteristics or parms for the FileOperation Configuration Service Provider contain an additional attribute called "translation" when 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, 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. CabWizSP will automatically add the appropriate translation to file operations and registry keys in an .inf file.

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 renames the file (file3.txt), deletes file1.txt and file3.txt, and then deletes the new directory (%CE2%\files).

<wap-provisioningdoc>
   <characteristic type="FileOperation">
      <characteristic type="%CE14%" translation="install">
         <characteristic type="MakeDir" /> 
         <characteristic type="Minesweeper.lnk">
            <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"/>
            </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>
</wap-provisioningdoc>

See Also

FileOperation Configuration Service Provider Example | FileOperation Configuration Service Provider

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.