Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 273
sw_engineer Avatar asked Jul 13 '09 12:07

sw_engineer


3 Answers

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!

like image 130
Dylan Vester Avatar answered Nov 15 '22 14:11

Dylan Vester


In WM 6, I believe (it could have been WM 5), they disallowed running a cab from within another cab. The only way to do it all in one go is through an MSI from the desktop. There are MSDN samples on how to get that started.

What I do in my app is detect the .NET CF version in my cab. If they don't have the right one, I fail the install and tell the user to install from the desktop. It's not the greatest solution, but MS doesn't really give us a choice.

like image 41
ageektrapped Avatar answered Nov 15 '22 16:11

ageektrapped


This is not really an answer to your question, but in a situation like this I would just deploy two CABs: my application and the .Net CF 3.5 CAB. It's not that hard to tell a customer/client to install your app, and if it doesn't work to then install the .Net cab.

like image 44
MusiGenesis Avatar answered Nov 15 '22 15:11

MusiGenesis