Washington Apple Pi

A Community of Apple iPad, iPhone and Mac Users

electric pi

 

Bailing wire and TAPE - What's a package?

One of Mac OS 9's hidden surprises

© 1999 Dale Smith

Washington Apple Pi Journal, January/February 2000, reprint information

Mac OS 9 brought a lot of interesting new features to Mac OS. Some of them are rather esoteric...and even fun to play around with. One such feature I found new in Mac OS 9 is the "package".

What's a "package?"

A package in Mac OS 9 is a special kind of folder. Although it is a folder, it appears in Mac OS 9 as if it were a single file. A package can contain a hierarchy of subfolders and files all of which belong together. This can be an application with all its support files or a help system with its set of linked documentation files.

What's it for?

The feature was introduced for software developers to offer another easy way to distribute software. A user can install the software by just dragging one "file," the package, to the place the user wants it. The developer can be sure that no needed component will be overlooked by the user.

Because the package folder has a special "package bit" set, the folder in Mac OS 9 no longer displays its folder icon. Rather it shows the icon of the file identified as the main file within the package. This might be an application, a main help file, an installer application, or whatever is in the package.

You can just double click on the package icon, to lauch the application or installer, or open the main file in the package.

How can one play with it?

When I read about packages, I knew I wanted to play with them to see what I might be able to do with one. I was mainly interested in how I might run some of my favorite applications from a package.

But first I needed to know how to make a package. At that time there was no utility available to assist in making a package, though some developer tools probably did exist. Also none of the general file utilities (like FileBuddy or ResEdit, etc.) that permitted manipulation of certain information bits associated with a file or a folder would let me access the "package bit" of a folder, much less change it. For a few days I was stuck. Then some utilities began to make their appearance. There were four different utilities that I became aware of. One was an AppleScript that toggled the packge bit for the folder. Another was the Tape drag-n-drop utility and its BoxCutter Contextual Menu Module (CMM) for restoring a package to a standard folder. There is also the Instant Package CMM which was also a simple toggler for the package bit. Finally there was an update to FileTyper which also permitted the necessary manipulation.

I came to like Tape from Public Access Software. Tape does several nice things for you that some of the other available utilities do not: 1) verifies that the folder structure will make a valid package, and 2) does the whole job of making the package. All of the availble utilities will turn a ready to go folder into a package by setting the folder's package bit. But Tape does the whole job: verifies the folder, asks you to select the main file for the package, creates the alias for the main file in the top level folder, and then sets the folder's package bit. I would like Tape even better if it didn't need a separate contextual menu module called BoxCutter to clear the package bit from a folder.

 Tape is a simple drag-n-drop utility which makes it particularly easy to use. Just take the folder that you want to make into a package and drag and drop it onto the application icon and Tape's main window opens (Fig. 1).  

Fig. 1 - Tape, Main Window

 

The main window has two checkboxes: a) Create a new package using this folder and b) Verify selected folder. I recommend checking both checkboxes, since it takes very little time to verify a package and it is better to know that you'll be getting a valid package.

What makes a valid package? Well you start with a folder (we'll call it the top level folder) containing a number of files and/or folders.

The content of the top folder has some constraints. There must be a single main file that is the point of origin for whatever action is expected to occur when the package is double clicked. This main file will be represented by an alias at the top level folder of the package. This is the only alias that may exist at the top level of the package. When Tape verifies a folder it checks for possible multiple aliases at the top level and it will warn you if any alias already exists. So if you do have any aliases in the top folder, you either have to remove them or create a new folder to be the top folder which contains the previous folder.

When you click the OKAY button in the Tape main window, it will bring up a dialog telling you whether or not it is safe to use Tape to make a package from the selected folder. And when you click the OKAY button in that dialog, Tape presents a file selection dialog to have you select the main file for the package. Tape makes an alias of it in the top level folder, sets to folder's package bit, and the folder icon is replaced by the icon for the main file you selected.

One thing I have done in playing with the package idea is to convert one of my frequently used applications into a package. I use ProTERM Mac for my communications program. The application resides in a main folder with a number of subfolders. I converted the ProTERM folder into a package. The application runs just the same when I double click the package (ProTERM application) icon as when I double click the application. This makes perfect sense, because double-clicking on the package icon is treated in Mac OS 9 like a double click on the ProTERM alias in the top level folder.

Also, ProTERM is one application which stores all of its preferences within its own folder hierarchy rather than in the System Folder. So everything ProTERM needs to run is contained in the package.

When I am in ProTERM, the program, even under Mac OS 9, sees the pacakage as a folder hierarchy and thus has no problem accessing any files within or outside the package. If I have occasion to create a new file with the application, I can save it inside or outside the package as seems appropriate. I have even been able to update the application inside the package using Stuffit without removing the package setting. So many applications (I don't know how many) can "see" inside a package. But Finder in Mac OS 9 does not see inside packages.

Well, you've seen what I've been doing with the package idea so far. Now if it strikes your fancy, you too can play with packages using utilities like Tape, Instant Package CMM, or others that have come out. Just make up a folder the "does" something you want to do, and then "tape" it into a package to see if it still works. Just remember all the action has to come from a single point of origin ... an application or some other main file.

If this stuck your fancy and you like to discuss packages or tell of your experiences experimenting, we could discuss the subject further on the TCS, Confernce 3, on the Inside Macintosh Board or maybe the B.I.T.H.E.A.D. Board.

For further information on packages in Mac OS 9 see Apple Technote 1188:

http://developer.apple.com/technotes/tn/tn1188.html

The Tape program is published as shareware ($10) by:

Public Access Software
432 S. Robson Street
Mesa, AZ 85210-2410
Phone: (480) 964-4046
http://www.pasoftware.com


About the author: Dale Smith has been a member of the Pi since 1983. He is active on the TCS crew and has written occassional articles for the Journal. He does beta testing of various programs, some mentionable and others unmentionables :) He also tries to help members work through communication and OS problems via the Hotline or calls taken at times in the Pi Office.


Return to electric pi

Revised January 9, 2000 Lawrence I. Charters
Washington Apple Pi
URL: http://www.wap.org/journal/