[Windows Mobile Development and Hacking General] bengalih:
This post is meant to introduce the issue of why some CAB files are unsuccessful, what causes it, and what can be done about it.

This is just some initial info I am putting forth and I encourage others who cook and make CAB files to provide their input to more fully flesh out this problem.

Have you ever attempted an install of a CAB on your device and near the very end...after the progress bar has moved most of the way, it finishes and says installation was "unsuccessful"? If so, read on...

There is probably more than one reason why a CAB won't install on a device. For instance, the CAB may be for the wrong device type (as CABs can specify what device types they will or will not install on). Also, there are security issues that many of you are aware of regarding unsigned CABS. However, in most cases, as long as the CAB is for your device-type and you either have security turned off, or accept the prompt to install then the CAB will properly install.

However, if you have ever had the issue with a CAB stating installation is "unsuccessful" after the process, it seems the issue has to do with DLL files that are registered as "shared" or "self-registering"

Below is a picture of a CAB opened with a CAB editing program. You can see that one of the DLL files (type "application extension") is set to "Yes" for "shared" and "self-registering".

I noticed that this CAB would install without a problem on my stock AT&T Tilt ROM, but had problems when trying to install to my cooked version. However, if I turned these flags on the file to "No" and then saved the CAB, the new CAB file would install properly.

I have experienced this on several CABs, on ROMs of all types.

In my experimentation it appears that if the DLL file in the CAB is set to shared/self-registering that it will not install if that file doesn't already exist on your system and is not registered properly (e.g. proper entires in the registry).

In this particular example (this was a CAB for a dialer) the DLL in question existed in the stock ROM, but not in my cooked ROM (since I pulled out the dialer).

Quick Overview of Test:

When I installed on my cooked ROM (with multiple changes) -

no

good.

When I installed on the stock ROM - good.

When I installed on the stock ROM (recooked with no changes) - good.

When I installed on the stock ROM (recooked with JUST that file removed) -

no

good.

In all cases, if I turned the option for shared/self-registering to "No" the CAB would install without a problem.

I believe that the existence of just the single file is not always

all

that is needed. I think that in some cases if related registry entries of other DLLs which call upon the file are not present then the results may be the same (i.e. unsuccessful if set to shared/self-registering).

When crafting my own CABs, sometimes these flags unintentionally get set to "Yes" and I get the same failed result. Without fail, if I edit the CAB and set these options to "No" the CAB installs fine and the application functions fine.

I don't really know why you would set a DLL to shared/self-registering as my knowledge doesn't really run that far and in my experience CABs with that setting generally fail. So a developer with further skill may wish to elaborate.

I hope that someone else finds this info useful and please feel free to add any accurate information.