http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.InstallingMultipleCABFiles
Installing Multiple CAB Files
Often a mobile device application may require that other software be installed onto the device in addition to the actual application; for example a managed application requires the .NET Compact Framework and might also require SQL Server Everywhere Edition. Each piece of software is normally contained in a separate
CABfile meaning that the user will have to manually copy each
CABfile to the device and install them separatly.
Rather then make the user install each
CABfile individually, it's preferable to package all of the unique
CABfile into a single master
CABfile and have the master
CABfile handle the details of installing the other
CABfile instances. Another consideration is that the application installation should only install a
CABfile if the CAB file's software hasn't already been installed.
You can easily create a master
CABfile that contains multiple CAB files by simply using the Visual Studio 2005 Smart Device CAB project. This Smart Device CAB project acts as the master
CABfile, so you just add all of the desired CAB files to the project. When the master
CABfile is deployed to the device, it will automatically place each individual
CABfile on the device.
To install each individual
CABfile requires 2 separate executables
- A program that loops through the list of all of the CAB files and uses ShellExecute to install each one individually
- A DLL that gets associated with the master CABfile. All CAB files can optionally have a DLL associated with them. The DLL must expose 4 entry points: Install_Init, Install_Exit, Uninstall_Init, and Uninstall_Exit. In this case the DLL associated with the master CABfile simply executes the above program from the Install_Exit entry point
Once the master
CABfile, Program and DLL are complete, the install process goes like this:
- The master CABfile is copied to the device
- The user initiates the CABFile install process by using the File Explorer (or similar) to navigate to and tap on the master CABfile.
- The device installs the master CABfile just as any other CABFile by extracting the individual CAB Files and placing them on the device in the location specified in the Visual Studio Smart Device CAB project.
- Once all of the individual CAB files are placed on the device, the DLL's Install_Exit entry point (a.k.a. function) is called
- The Install_Exit function then launches the program
- The program then loops through each CABfile and installs them
Note that the first 2 steps that the user manually performs can be automatically performed as part of a desktop MSI as discussed in
Like pretty much anything else in programming, the best way to understand the multiple
CABfile install process is with a sample.
If you would like information about how to install a
CABfile to a device from a desktop MSI file...
- Checkout the InstallApplication entry