Friday, September 26, 2008

CabWizFixer: Support for files with the same name on Smart Device CAB installers

There is a know bug in cabwiz.exe when your deployment needs several files with the same name in separate folders. This is a typical scenario when you have multiple resource files (i.e. using localization) in a Smart Device Cab Project, but it can also be present when you try to face an app in a generic approach depending on the folders/files structure or just even as a bad coincidence in your app file names. In all cases the cab installer will mess up your deploy copying the same file in all your folders for each group of namesakes.

Let's see an example:

Update: The originally posted 7Wonders sample application has been removed due to copyright issues after asking them about the usage of their material. I replaced that sample with this one:

The Small Catalog Mobile app

This is quite a basic sample, but useful enough, of a good generic approach for a problem. The Problem: We need to implement a Pocket PC app to show a small and simple catalog of a few products. Just a way to show a set of pictures and a quick description of each product. The app should be very simple, and we don't need even to have a database. So, we can just rely on the file directory structure where each subfolder in our app folder will be a new product. The folder name is the product name, and it includes two files named description.txt and picture.jpg for the product description and image correspondingly.

Actually, this approach also makes things easier during the development process. We can build the directory structure in our project as we want it once it's deployed on the device in a sort of WYSIWYG design experience.


You can download the sample solution source code from the following link:

The solution includes two projects: BasicCatalog project itself, and a setup project. If you try to debug or run the solution from VS, it will be deployed and run as expected. But if you try to install the cab generated thru the setup project, the app will show always the same description and picture for all the products. The reason of this behavior is the cabwiz bug described at the beginning of this post. The same picture.jpg and description.txt files have been installed in all the product folders.


Here's when CabWizFixer can help us. This is a small tool we made internally based on part of the source code from the Clarius Orientation Aware Control which includes a built-in workaround for the cabwiz issue, a strong requirement for OAC applications as well as it relies on and extends the standard localization infrastructure provided by .NET Compact Framework.

With CabWizFixer, the Basic Catalog installer will work as expected. After install the tool, you just need to rebuild the installer and the new generated cab will install all the right files on the right location.

CabWizFixer is a experimental tool and it's provided "as is" with no warranties whatsoever. If you want to try it, here is the command-line installer:

For uninstall it just launch from a command-line console:

CabWizFixerInstaller.exe /uninstall

I hope this tool makes your life a little bit easier :)

Take care!

Monday, September 1, 2008

Orientation Aware Control 2008 Released!

Just last weekend we shipped Orientation Aware Control 2008, the latest stable version of the popular control for .Net Compact Framework from Clarius, formerly part of the Microsoft Patterns & Practices Mobile Client Software Factory.

You can find it in three different flavors:

  • OAC 2008 Community Edition: A free version targeting small application development, supporting different horizontal and vertical layouts for the default form factor.
  • OAC 2008 Professional Edition: Commercial version of the product. Take a look at the features comparison chart.
  • OAC 2008 Trial Edition: Fully functional Professional Edition that randomly shows a trial message.

Why should I use OAC 2008 over the p&p OAC?

OAC 2008 is an evolution of the original p&p OAC. Beyond some bug fixes and VB.Net and Smartphone support, you can keep in mind:

  • Visual Studio 2008 designer integration. As far as it targets VS 2005, p&p OAC doesn't support VS 2005.
  • .Net CF 3.5 support
  • It still being compatible with VS 2005.
  • Includes SipAwareContainer, a pretty cool panel control which detects the software input panel (SIP) status and resizes itself accordingly.
  • You can store layouts on satellite assemblies for reduced download time and use a tool for create separate .cab installers for each resolution/culture.

Wanna try it? You can go to the downloads page and take a look at it.

If you have previously installed Orientation Aware Control June 2008 RC Trial Edition over both VS2008 and VS2005 on the same machine, you should verify after uninstalling it and before installing OAC 2008 that the following files have been removed from your system:

Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Clarius.UI.OrientationAware.Designer.2.0.dll (v.
Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\DesignerMetadata\Clarius.UI.OrientationAware.*.asmmeta.dll

If any of these files remain on your system, please close Visual Studio and delete all of them before installing Orientation Aware Control 2008.

Hope you like the product. Remember to give us your feedback on the OAC Forum.

I'll continue posting about some of the features and usages of the OAC, so stay tuned!