Tonight I had my first opportunity to try out Visual Studio 2005 and the Windows Mobile 5.0 SDK to see what I could tinker with on my i-Mate SP5. I can only say my first experience was a disappointment and a real waste of an evening - I thought it was meant to be easier to develop for these devices than before? Apparently not.
After loading the SDK and creating a new "Windows Mobile 5.0 Smartphone" project, I was a bit stunned to see that on pressing F5 that I couldn't deploy to my device, with the following error:
The device security configuration disallowed the connection. Ensure that you have the appropriate certificates on your device for development. Review your SDK documentation for proper security settings for connecting to this device.
After looking at this document http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnppcgen/html/wmsecurity.asp
- it suggested that my device was application locked. Simple I thought, I'll just install the certificates from the SdkCerts.cab file in the SDK and off we go. Unfortunately not - I got an error:
"Installation was unsuccessful. The program or setting cannot be installed because it does not have sufficient system permissions".
So I tried the rapiconfig tool, also in the SDK:
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Tools>rapiconfig /p SdkCerts.xml
Config failed (0x80070005): Access is denied.
It turns out that the phone is application locked by default, and the only way to unlock it is to edit the policy by editing the registry. 1. Enable RAPI and user provided certificates:
You must use a registry editor signed by something the phone trusts already! RegEditSTG http://blogs.conchango.com/stuartpreston/files/regeditSTG.zip
will do the trick as it is already signed by HTC.
Copy the exe onto the device, launch it and change the policies as follows:
Navigate to HKLM\Security\Policies\Policies\
Click "Values" soft-key
Change "00001001" value to 1 (decimal) (recovery note: default is 2)
Change "00001005" value to 40 (decimal) (recovery note: default is 16)
At this point, you could probably import the certificates as above and deploy applications from Visual Studio 2005. However, I decided to go the whole way and completely unlock my device.2. Run SDA Security Unlocker to trust all applications (use this with caution):
Available from http://blogs.conchango.com/stuartpreston/files/SDA_ApplicationUnlock.zip
With the device connected by ActiveSync, run the program on your desktop machine.
Now you should be able to deploy successfully directly from within Visual Studio 2005.