Setting up Windows Mobile devices with cab files

(updated grammar).

Well after seeing articles on MSDN like Provisioning for Windows Mobile-Based Devices. I have realised for a while now that it should be possible to create XML files that can be used to setup things like RAS Connections, Security Settings and Email. However after several small attempts (no more than an hour or two). Lots of documentation seems aimed at the OEM with information on how to bootstrap a device (set it up in ROM), like Vodafone or HP device do (when you hard reset them and they automatically install stuff). There is information on creating a cpf file however this never seemed to work.

However after playing with it for a day I finally figured it out. This provisioning WM5 doc helped.

So did this; all the Configuration Service Provider settings available. Good thing is, if there isn’t a custom provider to do what you require, you can use the Registry provider to set up what ever you need in registry.

Cpf files need to be signed to run, however Cab files do not. So if you use the same method but produce a cab file it will work (unsigned). YAY.

Next a post on why cab files can only have 998 files in them gave me another idea. Decompiling the cab file, I was using to install an application on the device, I saw all the files included in the cab with extensions ending in 003,004 etc, and a _setup.xml, hmm now that sounds familiar.

Opening the _setup.xml file displays information like this:

< characteristic type="Resources.dll" translation="install" >

< characteristic type="Extract" >

< parm name="Source" value="RESOUR~1.025" / >

< /characteristic >

This is basically an XML translation of the inf file you use to create cab files.

So I then added my RAS connection setup information to this _setup file and archived it all back to a cab file. This produced a cab file that not only set up my RAS connection on the device but also installs my application. Brilliant!

I will be using this all the time from now on, I just wish I had worked it out sooner. I am unsure to if it works on 2003 SE or not… will have to try.


Blogger William Luu said...

Hey there, i'm not sure if you've seen this or not, but there was a opst on the WindowsMobile blog about this.


- Will

5:50 PM  

Post a Comment

<< Home