Friday, August 8, 2014

Deploying a Service on Windows Mobile 6.x

Smile

In one of projects I’m working on at my workplace there is a service for Windows CE handheld devices (Motorola MC3x90 series)[1].Work This service has been developed following the instructions at http://msdn.microsoft.com/en-us/library/aa446909.aspx. While it says it apply to Microsoft® Windows® CE 4.0 and 5.0 it also works on newer Windows CE versions as well. Nerd smile

Unfortunately when I try to put it over to Windows Mobile Mobile phone(Which indeed based on the Windows CE platform) devices of the same manufacturer (MC3x90Z series) the service was not loading despite validating that dll can be loaded from another app as well as copying over exact registry settings which are the only two pieces that need to get it running. Thinking smile

Troubleshooting was also very painful since there was no command prompt app in these windows mobile devices so had to put some 3rd party console programs like the one you gets with Windows Mobile Developer Power Toys[2]. Still the services.exe was refusing to load and run service when warm booted and this was very frustrating. Annoyed

After lot of cursing Devilfinally found another one which also was developed by me long time ago and had a working service on Windows Mobile.Angel And a careful examination on the CAB file revealed that it need couple of work from our part to get a service running on Windows Mobile platform. Following is the findings.Light bulb

1. A compatible console.dll should be copied to \Windows directory. You can find the one I had been using (Don’t know exactly where I had found it) at my Google Drive

2. Following Registry settings apart from what needed for Service loading as described in the referenced msdn tutorial.

[HKEY_LOCAL_MACHINE\Drivers\Console]

”OutputTo"=dword:00000000

[HKEY_LOCAL_MACHINE\Services]

”AllowCmdLine"=dword:00000001

3. Last but not least. A shortcut at \Windows\StartUp folder to load the service. You can create one by creating a file with extention .lnk which contains a text in following format

<length of the text following after #>#services load <name of registry key of service>

e.g.

20#services load MTXSVC

Good luck and happy coding!Computer

 

References

[1] Handheld Computers http://www.motorolasolutions.com/US-EN/Business+Product+and+Services/Mobile+Computers/Handheld+Computers

[2] Windows Mobile Developer Power Toys http://www.microsoft.com/en-us/download/details.aspx?id=10601

[Published with Windows Live Writer on Windows 8.1]

No comments: