.net – Windows Mobile Cab Setup to detect .NET CF 3.5 and Install It

.net-3.5netwindows-mobile

I have developed windows mobile 6 professional application using targeted framework as .NET CF 3.5 and professional 6 SDK. Also created its SmartDeviceCab file. When I install it on device not having CF 3.5 it fails to run my application (because the device has .NET CF 2.0).
Now I know that I must have NET CF 3.5 on the device where I want to run my app.
How can I detect the current version of CF and install(if required) CF 3.5 from my cab setup. I have explored and gone through much on Setup.dll but its too old way and I didn't find way to run cab file from my Setup.dll. Please help me to find the solution. Would be grateful if link/sample code provided. More frustrating is, I never touched VC++.

I have gone through:
Detecting if the Compact Framewok is installed on mobile device and its links.

Shailesh K.

Best Answer

Very simple. It has a little C++ code, but you don't have to change it at all. It's simply a matter of creating a second smart device cab project containing the .NET cab file you want to install (3.5 in your case), and swapping the installation DLL for the one created from the C++ project included in the sample. You just add registry values that describe where the cab files you want to install are and you're golden. You don't need to detect what version of .NET they have installed, just throw it in there and it will install over the top of any existing installation. There is a full whitepaper that explains it in the sample, as well as source code. Just download the Windows Mobile 6 SDK and navigate to this directory on your computer after installing it. Open the document titled "MultiCab Whitepaper.doc" and follow the instructions.

C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\multicabinstall

I used this for my own project and it works SO well!

Related Topic