How to determine if Microsoft ActiveSync is installed on a PC

What is the best / most reliable way to detect if Microsoft ActiveSync is on your computer? My PC program uses RAPI to extract files from a device, and if it is not installed, there is an error that RAPI.dll cannot find.

+3
source share
3 answers

You can read the registry to determine if ActiveSync is installed.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services 
+4
source
/// <summary>
/// Checks to see if ActiveSync/Windows Mobile Device Center
/// is installed on the PC.
/// </summary>
/// <param name="syncVersion">The version of the synchronization tool installed.</param>
/// <returns>True: Either ActiveSync or Windows Mobile Device Center is 
/// installed. False: version is null
/// </returns>
private static bool isActiveSyncInstalled(out Version syncVersion)
{
            using (RegistryKey reg = 
                Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows CE Services"))
            {
                if (reg == null)
                {
                    syncVersion = null;
                    return false;
                }

                int majorVersion = (int)reg.GetValue("MajorVersion", 0);
                int minorVersion = (int)reg.GetValue("MinorVersion", 0);
                int buildNumber = (int)reg.GetValue("BuildNumber", 0);

                syncVersion = new Version(majorVersion, minorVersion, buildNumber);
            }
            return true;
}
+7
source

, C:\Windows\System32\rapi.dll
rapi.dll ?

0

Source: https://habr.com/ru/post/1711084/


All Articles