How to append a file to a mobile CAB using WM6

  • Thread starter John R. Millwood
  • Start date


John R. Millwood

I need to append a configuration file (app.config) to an existing CAB file on
the user's side. This is a WM6, CF 2.0 or 3.5, Visual Studio 2008, C#,
Windows Mobile Professional (Pocket PC) project. App.config will get modifed
on the customer's side, and it needs to be appended to the CAB file before
deployed on the mobile device.

Following is the scenario:

I have a mobile application that calls Web service methods. App.config
contains URL to Web service along with it's Windows user name and password
for accessing the Web service site over SSL. This information can be entered
via the application on the handheld as a one time setup, but that is very
painful with a stylus. It's not something you want your users to experience.
So I want the ability for a customer/admin to modify app.config and append
that to the existing CAB file before it gets deployed on the PDA. This way,
the user doesn't have to configure the URL on the handheld. I'm deploying
the CAB over-the-air (OTA). So all the user has to do to deploy my
application on the PDA is browse to the Web site with IE and tap the
deployment hyperlink. The CAB automatically gets downloaded and installed.

What I've already done/researched:

I attempted to use cabwiz.exe with provisional XML injection using the
/postxml switch. The problem is that I can't find any examples on how to
append a file into the existing CAB file. I find all other type of examples
on injecting VPN, e-mail, ...etc., but nothing on appending a file.

Remember, this is happening on the customer's side and not my development
side. I want to deploy cabwiz.exe and cabwiz.ddf to my customer and write a
nice GUI to perform the process of appending app.config into the existing CAB.

One of my options is to deploy all my CAB contents to the customer and just
rebuild the entire CAB using cabwiz, but I don't like this solution; it will
be more difficult to maintain.

Any suggestions on how to append app.config into my CAB on the customer's





Hi John,

I'm now facing the exact problem today. For now, I'll try cabwiz from its
SDK. Hopefully, it's easy and free to distribute later. Hope we can keep
eachother updated on this issue. Thanks,

- Brian


Not sure how useful this is. I did append a config file to the CAB file
using copy command with /B option for binary file. But, the Cab file can no
longer be installed on device afterward for some reasons from my earlier test
even though the sililar append approach works for desktop installer. I'll
trying to find out a way to fix this.

- Brian



John R. Millwood


I was never able to append a file to the CAB. I just regenerated the entire
CAB using cabwiz.exe. In summary, following is my solution:

I deploy cabwiz.exe, cabwiz.ddf, .inf file of the CAB to generate and all
components referenced in .inf to the customer's system. I can use cabwiz.exe
to recreate the entire CAB file.

Thanks for your input.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question