UnMacBinary v2.2

Joel Baxter (jbaxter@lemur.stanford.edu), "Johnny Law" in Myth

Unzip32.dll is from InfoZip, at http://www.cdrom.com/pub/infozip/

Program icon designed by [K]uniklo, ported to PC version by me (tried
an existing PC version w/o success).  See http://members.aa.net/~casur/myth/


WHAT IS IT?

UnMacBinary is a freeware Win32 program that has two handy functions that
it can perform on a list of files.  First, it strips the extra MacBinary
information off of them (if it exists) so that they can be viewed on a PC.
Second, it can also read Zip archives and extract the files within (and then
check the extracted files for MacBinary encoding).

Why am I worried about MacBinary?  I like the game Myth, and MacBinary
encoding is probably the most common reason that a Myth film is not viewable
with the PC version of the game.  For more details, see
http://www.corporation.org/AboutMythFilms/index.html

There is an existing shareware program, called "RK MacWin", that can get rid
of MacBinary encoding for you.  But I got tired of RK MacWin's interface, and
I didn't want to pay the shareware fee for it.  There's also been a program
released recently called Myth Fixer (http://www.init5.com/software/mythfixer/)
that has a similar purpose.  Advantages: a neat GUI, and information
presented about the film that you opened.  Disadvantages as of v1.0: no batch
processing of films, no Zip archive processing, and a slightly less robust
detection and correction of MacBinary encoding (although it should work fine
for Myth films).  The author(s) of MythFixer are looking at the source for
UnMacBinary with an eye toward merging the utilities, so we'll see what
happens there.  I think that would be a Good Thing.


HOW DO YOU INSTALL IT?

Just plop the UnMacBinary executable (unmacbinary.exe) somewhere.  If you
end up using it often in command-line mode (see below), you'll want to make
sure it is in your executables path.  If you're just going to be doing
drag-and-drop, though, you can put it anywhere, and then make a shortcut to
it in a convenient spot (like on your desktop).

If you are downloading the full version, rather than an update, there is
also a library to install: unzip32.dll.  Put this in the same folder as
unmacbinary.exe.  (If you would rather put it into your Windows or
Windows\System folder, it will also work there.)

The icon included is for use with your UnMacBinary shortcut, if you want to
use it.  Saw it on [K]uniklo's page and liked the looks of it.  I tried to
get it to be used for the UnMacBinary application itself, but MSVC++ has
resisted my best efforts in that direction.  Maybe that's not possible for
a console app.  If you know otherwise, let me know.


HOW DO YOU USE IT?

You can use UnMacBinary in several different ways.

If you like drag-and-drop, you're in luck.  Just select a bunch of files or
Zip archives and drag them onto the unmacbinary.exe icon (or shortcut).

Any dragged file that  is MacBinary encoded will have its MacBinary encoding
removed.  Any dragged Zip archives will first have their MacBinary encoding
removed if necessary, then they will be unzipped, and then the file(s) from
the archive will be processed to remove any MacBinary encoding from them.

One drawback to drag-and-drop is that it will specify the files with
DOS-style short filenames.  But if a file does not need to be changed by
UnMacBinary, then drag-and-drop will not affect its filename.  Also, if you
drag a Zip archive onto UnMacBinary, all the files inside will retain their
long filenames, whether or not they need to be changed.

The way I personally use UnMacBinary for Myth films is with a folder on my
desktop that contains a shortcut to UnMacBinary and a shortcut to my Myth
Reco folder.  After downloading a set of films into that folder, I drag all
the archives onto UnMacBinary (to unzip them, to and fix any films that need
fixing), and then I drag all the resulting films into the Reco folder so I
can view them with Myth.


However, if you like to use the "Run" function of the Start menu, or the DOS
shell, or some other shell, then you can just invoke unmacbinary.exe with a
list of files or Zip archives on the command line.  Example:

	unmacbinary.exe "this file" "that_file.zip" "the other file"

If UnMacBinary isn't in your executables path, you would of course have to
specify the complete path to it.  Also, if the files or Zip archives aren't
in the current directory, you have to specify complete paths for them as
well.  UnMacBinary expects DOS-style paths, to be compatible with the types
of paths it gets from drag-and-drop operation.  I didn't want to worry about
making it deal with multiple path types.

Note that if you are typing the command line into a DOS shell, you can drag
a file onto the shell window, and it will automatically type out the name
of the file for you.  However, you'll only get the DOS-style "short file
name" (8.3 format) if you do this, not the long filename.


VERSION HISTORY

2.2   - Identical to (unreleased) 2.2b1

2.2b1 - (unreleased)
      - Fixed small memory leak when processing Zip archives
      - Reduced the number of messages spouted by the UnZipper
      - Added a version resource to the app
      - Added an icon to the distribution

2.1b1 - All MacBinary files now handled, not just Myth films
      - Any resource fork or GetInfo data is now also stripped, not just the
        MacBinary header
      - Zip archives that themselves have MacBinary headers are handled

2.0b1 - Added the use of Unzip32.dll to be able to process Zip archives
        containing Myth films

1.0   - Strip MacBinary headers off of Myth films


NOTES

InfoZip is cool folks, go check them out.

UnMacBinary is pretty safe about not leaving files mangled if things go
wrong; if, for some reason, the conversion fails, then it will print an
error message and restore the original file.  Files that have been
extracted from an archive will NOT be "stuffed back into" the archive if an
error occurs.  And any Zip archives processed by UnMacBinary will not ever
be deleted or changed in any way by UnMacBinary, UNLESS they are themselves
MacBinary encoded... in which case, of course, the encoding will be removed.

Files extracted from a Zip archive will be in the same folder as the Zip
archive, unless the archive contains extra folder information for that file.
If there is extra folder information, those folders will be created.

If a file ends in ".zip" (case not important), UnMacBinary thinks it is a
Zip archive and will try to treat it as such, AFTER removing any MacBinary
encoding on the file.  If it fails to understand it as a Zip archive, it
will skip it and move to the next file.

UnMacBinary is meant for use with small files, because it just slurps the
whole file into memory when working with it.  This is fine for files the
size of Myth films, for example.

The source code, such as it is, is available on request.  It can be compiled
with minor changes on many different platforms, and in many different
development environments (because it is so freakin' simple).  The limiting
factor as of version 2.0 is the UnZip library that I interface with.  The
one I'm using is built to interface with MSVC code on a Wintel box; other
versions are available from the InfoZip folks, but I haven't tried using
them.  Also, my "glue code" for the UnZip library is very Windows-specific,
and the code that reads the data fork length out of the MacBinary header is
little-endian.  Caveat hackor.

This text file must be distributed with the UnMacBinary executable.  I
retain all rights to UnMacBinary (but not the UnZip code); it's just that I
would like UnMacBinary to be freely distributable.  UnMacBinary may not be
charged for, or be part of a compilation of software that is charged for.

For more information about who has the rights to the UnZip code, and how it
may be used, see http://www.cdrom.com/pub/infozip/doc/COPYING

As for liability?  It's all yours, buddy.  Use this software at your own
risk.

