views:

329

answers:

1

Hi,
My application is targeted for Compact .Net 1.0 framework. The application has to check and download any updates available from a web-site. I am thinking of providing the updates as CAB files. Since the CAB files are processor type specific, I want to download the CAB file based on the Processor Type. What is the API for getting the Processor type (ARM/SH/MIPS/etc)?

Thanks,
Kishore A

+2  A: 

There's nothing available directly from within the managed libraries. You'll need to use P/Invoke to call into the native Coredll.dll and use a method called GetSystemInfo.

pinvoke.net is an excellent resource for using P/Invokes for both mobile and desktop development. The pertinent entry for you is: http://www.pinvoke.net/default.aspx/coredll.GetSystemInfo

Calling this method will return a SYSTEM_INFO structure that contains information about the processor architecture.

If that route looks like too much work, you can always check out a commercial package called Smart Device Framework from OpenNETCF: http://opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx

In the SDF, you'll be interested in OpenNETCF.WindowsCE.DeviceManagement.SystemInformation -- that will return the same basic information as the P/Invoke, but within a nice managed wrapper.

CBono