Wednesday, April 2, 2008

Killer Whales can be dangerous

Don't get me wrong, Orca has been the mainstay of anyone wanting to rapidly edit Windows Installer files for a long time. And does an excellent job. Mostly.

The problem is that there are a few nasty things that Orca does silently. So you won't even know the msi file being worked on has been corrupted. See my previous entry about the _Streams table.

One other danger is the Copy and Paste Rows functionality.

When a row is copied, it's fields are placed as tab delimited strings onto the clipboard.
When multiple rows are copied, each row's string is separated by appropriate end of line characters.

However, if a string field in a row contains a tab, or an end of line character, then that row cannot be pasted back into the database.

Unfortunately, the user is not made aware when pasting rows that Orca has stopped pasting them because it has found an invalid number of tabs (fields) in the row for the table.

This becomes dangerous because an expected behaviour, copy and pasting rows, silently doesn't work.

InstEd resolves this problem by quoting fields that have tab and end of line characters, and escaping quotes within such an escaped field. This is compatible with Excel, so that pasting rows back into InstEd or Excel will result in correct behaviour.

Furthermore, it only quotes fields that contain tab or end of line characters, or that have a quote at the start or end of the field. This provides as much compatibility for copying from InstEd and pasting into Orca as is possible.

The upshot is that InstEd will always copy and paste rows correctly within itself, and with Excel, whereas Orca has the potential to (silently) lose information when pasting rows.

No comments: