Mulle kybernetiK - Tech Info:
DualDeveloper: Installing WO451 Developer and WO5 Developer in parallel on Mac OS X 10.x
For this solution you need some scripts, it doesn't run out of the box. But you're lucky: I've already done the Job for you.
The problem

You cannot install the developer versions of WebObjects 4.5.1 and WebObjects 5 in parallel on your machine. This limits you to select beforehand what sort of development you will do on your machine.

I found it to be pretty annoying as I maintain WO apps written in Objective-C and some newer Direct2JavaClient Desktop apps. I cannot simply decide which of both I want to develop on my laptop - I need both options.

Understanding the problem

Both WebObjects 5 (Java) and WebObjects 4.5.1 (Objective-C) share some common frameworks. This is because Project Builder, WebObjects Builder and EOModeler are written in Objective-C. Unfortunately versioning in Frameworks is corrupted. As a matter of fact, resources are always loaded from the current version, not from the requested version. Apple's developers, possibly knowing this bug, didn't even care to version their WebObjects frameworks. The problem hence is WebObjects 4.5.1 and WebObjects 5 end up with identically named frameworks with identical versioning infos for the dyld - but in reality being incompatible.

But alas - you cannot simply use WebObjects Builder (5) to edit your "old" WO 4.5.1 components. Boolean bindings will be renamed to true/false instead of YES/NO and the .woo files will be unreadable by the WebObjects 4.5.1 runtime due to an increased version number that WO 4.5.1rejects to understand.


Because the problem only exists when using the tools required to build the applications it might be acceptable to restrict ourselves to either developing WO 4.5.1 or WO 5 applications at the same time. If that's acceptable we go on as follows: Identify the overlapping frameworks which cannot be used in parallel at the same time and have them moved "aside". Using a script we're then able to move the required frameworks in place as soon as we need them.

The plan

We begin by choosing a version of WebObjects to install first. In my case I chose WO 4.5.1. If you've finished the install and applied the latest patches (see do:

% sudo mkdir /Developer/Applications/WO451
% sudo mkdir /Developer/Applications/WO5
% sudo mkdir /System/Library/Frameworks/WO451
% sudo mkdir /System/Library/Frameworks/WO5
% sudo mkdir /System/Library/PrivateFrameworks/WO451
% sudo mkdir /System/Library/PrivateFrameworks/WO5
Afterwards you need to move some bundles aside by executing the following statements:

% cd /Developer/Applications
% sudo mv "WebObjects" WO451
% cd /System/Library/Frameworks
% sudo mv EOAccess.framework EOControl.framework EOInterface.framework EOModeler.framework WebObjects.framework WO451
% cd /System/Library/PrivateFrameworks
% sudo mv EOModelWizard.framework HTMLEditing.framework IDEServices.framework MultiScript.framework XML.framework WO451
You've just taken the first hurdle! Obviously the next step is to install WO 5. Please note that WO 5 will nevertheless overwrite some files that you've just installed which you might want to save, namely the WebObjects configuration (/Library/WebObjects/Configuration) and the Adaptor (+ Source) in /Developer/Examples/WebObjects/Source/Adaptors. (It's always a good idea to have a look at the files the package installer wants to install before clicking install. You do care for your machine's installation, don't you?) Being a crack-admin/coder™ I usually save these and later have a look with at what's changed since.

Now, after WO 5 is installed apply the current patches like you did with WO 4.5.1 before. After that, execute the following:

% cd /Developer/Applications
% sudo mv "WebObjects" WO5
% cd /System/Library/Frameworks
% sudo mv EOModeler.framework WebObjects.framework WO5
% cd /System/Library/PrivateFrameworks
% sudo mv EOAccess.framework EOControl.framework EOInterface.framework EOModelWizard.framework HTMLEditing.framework IDEServices.framework MultiScript.framework XML.framework WO5

Now enter the scripts! There are two scripts, wodev and womaintain that you'll have to download now. Get the dualDeveloperScripts.tar.gz via FTP or HTTP. In order to finalize the installment of DualDeveloper, you'll have to decide which version of WO you want to use next. If you want to use i.e. WebObjects 4, simply type:

% sudo wodev 4
Afterwards, you end up with an installment that nearly seems to be exactly as if you'd only installed a single version of WebObjects.

Magic scrolls

The first script, wodev, is the one you'll use most of the time. It will activate the version of WebObjects you pass it on the command line. One option, links, is optional. When used, instead of copying the frameworks in place it creates symlinks to the corresponding frameworks. The problem here is that Project Builder resolves those symlinks and inserts them into the projects which makes your projects not as portable as you would like to have 'em I guess. The benefit, however, is that you can really use the WO 5 and WO 4.5.1 tools in parallel at the same time.
The second script, womaintain, can be used to patch the current active version of WebObjects. To patch version 4.5.1 with i.e. update 3 (assuming you haven't already done this) you'd use the following sequence:

% sudo wodev 4
Now - as root - install update 3. Afterwards continue:
% sudo womaintain 4
Side effects

Although everything seems to be in place after this hacque, some things are worth to be noted. First, you cannot easily see which version of WebObjects is currently installed. I've upgraded the wodev script with this feature in version 1.1 of the scripts. If used without arguments, the result will look like this:

% sudo wodev
Usage: wodev {4|5} [links]
Currently active release: 4
However, there's no way to see this via the UI (i.e. the Dock). Next, if you click on an eomodel for example, chances the wrong version of the WebObjects will launch are not that bad. To solve this issue, one could use a different path than the proposed /Developer/Applications/WO{4|5} to move the applications aside (both scripts would have to be changed, but it's fairly easy). On the other hand, you can always start the correct version located in /Developer/Applications before clicking on an eomodel.
$Revision: 1.3 $ $Date: 2002/12/23 17:52:10 $ Written by ZNeK. Copyright © 2001, 2002 by Mulle kybernetiK.