How to get information about softwares installed on Windows Mobile devices?

By 42Gears Team

Best method is to ask the configuration service provider (CSP).

Step 1: Add Reference to Microsoft.WindowsMobile.Configuration
Step 2: Add the following statements at the top of the c# code file.

using System.Xml;
using Microsoft.WindowsMobile.Configuration;

Step 3: Prepare a csp string (xml format) and pass it to ProcessConfiguration method of ConfigurationManager. Return value is the xml string which contains all currently installed softwares on the device.

private void ListInstalledSoftwares()
{
string cspString = "";
XmlDocument xmlResult = null;

// Use CSP to get list of installed applications
try
{
XmlDocument configDoc = new XmlDocument();
configDoc.LoadXml(cspString);
xmlResult = ConfigurationManager.ProcessConfiguration(configDoc, false);
Debug.WriteLine(xmlResult.InnerXml);
}
catch (Exception ex)
{
Debug.WriteLine("Failed to get list of installed applications. CSP failure. [Exception: " + ex.Message + "]");
}
}

“Written with expertise and passion to help you understand the topic better.”

4
42Gears Team – Content Author
Published on May 19, 2010

Subscribe to our newsletter

Stay updated with the latest news, articles, and resources on enterprise mobility.

Weekly articles
Actionable insights delivered once a week. No noise.
No spam
Your privacy matters. Unsubscribe anytime.