ActiveSync...is it installed or not?

  • Thread starter Thread starter Glyn Meek
  • Start date Start date
G

Glyn Meek

I posted something about this a few days ago, but we have been banging our
head against a brick wall for the last 5 days, almost none stop trying to
figure this out. We are trying to use RAPI to develop a routine to talk to
the Pocket PC. While it works perfectly when ActiveSync is up and connected,
and fails perfectly when ActiveSync is taken down or the device pulled from
the cradle, it gives us HUGE problems on PCs where ActiveSync is NOT EVEN
INSTALLED.

If one of our customers just happens to stumble into the PC<-> PPC interface
by accident, and they do not have ActiveSync installed on their PC, RAPI
does not like this AT ALL, and bad things happen. Now, we can fix this by
not allowing the user to even get to the RAPI failing stuff if we can detect
whether Activesync is even installed on the user's PC. If not, we don't go
to the RAPI stuff, and if it is, then RAPI handles everything
perfectly....So, our question is

"What is the DEFINITIVE way of determining if ActiveSync has been installed
on a PC?"

We have had two suggestions already...

1) Check for the presence of wcescomm.exe ( BUT HOW DO YOU KNOW WHICH
DIRECTORY IT IS IN, AS WE DON'T WANT TO SEARCH EVERY DIRECTORY!!)

and

2) Check in the registry to see. ( GREAT IDEA, BUT WHAT DO WE HAVE TO LOOK
FOR IN THE REGISTRY FOR ACTIVESYNC, AND IS THERE ANY WHITE PAPER OUT THERE
THAT TELLS US HOW TO DO THIS?)

or

is there some other method of determining if ActiveSync is loaded/installed
on a PC?

Regards and thanks

Glyn Meek
 
Chapter 15 of Doug Boling's Programming Windows CE.Net explains how to use
the CeUtil DLL to access the ActiveSync registry entries. Under
HKEY_LOCAL_MACHINE
the ActiveSync root key is CESVC_ROOT_MACHINE. If that is missing,
ActiveSync
is not installed. CeSvcOpen is the key fuction from the CeUtil DLL that you
should
investigate in solving your issue.

-Darren Shaffer
 
Hi, Glyn

Sorry for mentioned wcescomm.exe without the usage... *^_^*
You don't have to check every possible directories in the PC.
Even ActiveSync was installed but if wcescomm.exe is not running,
that would cause the same problem, I believe...

Instead, you can check the process list in the PC.
You can search MSDN for Process.GetProcessesByName() to check
if wcescomm.exe is running.
If you find it, that means ActiveSync will be triggered when cradled.

This gonna work because I did before with VB6 code.
However, if you feel registry way is easier, that would be fine,
bacause wcescomm.exe seldom get shutdown...

--

Best Regards,

Jan Yeh
MVP - Windows CE.NET, MCSD.NET, .NETcf consultant
http://blog.mvpcn.net/janyeh
 
Well 20 seconds of looking in my registry found this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services
It has MajorVersion MinorVersion and InstalledDir

Seems that if those exist, then AS is installed, if not, it's not.
 
This will only work if AS is currently running. Though it's a good point
that if AS isn't running, the RAPI stuff will likely fail as well (that
should be tested in his scenario).
 
Sure, it only work when AS is currently running.
However, AS is default running if it's installed, right?

The 2 ways, registry and process, are useful for detecting AS.
And it depends on developers' needs.

--

Best Regards,

Jan Yeh
MVP - Windows CE.NET, MCSD.NET, .NETcf consultant
http://blog.mvpcn.net/janyeh
 
Back
Top