Double-clickable app proposal

Chris Reuter cgreuter at calum.csclub.uwaterloo.ca
Mon Feb 2 21:49:03 UTC 1998


>  Folks - 
>
> What if a Squeak VM file could recognize if an image file were simply
> appended to it, and do the right thing?  Then it should take no more
> to make a double-clickable app than to do a save followed by a file
> copy.
> 
> OS gurus:  Can this be done simply on the Mac PPC, 68K, Windows,
>Unix, OS/2, etc?

Well, the easy way to do this under Unix would be to prepend something
like

#!/usr/local/bin/Squeak

onto the beginning of the image and make Squeak ignore it.  That has
the effect of making Unix treat the image file as a script with Squeak
as the interpreter.  Of course, the actual prefix string should be
settable from Squeak and the interpreter smart enough skip an
arbitrary number of bytes so that an installation script, say, could
put the actual path to Squeak in there without needing to run Squeak.

As for appending the image to an executable, the COFF file format is,
according to my more-knowledgable co-worker, not sufficiently
standardized to allow this to work portably.  (I'm not sure about ELF,
though.)  What he proposes is storing the image in an object (.o) file
and linking it to the interpreter.  This would require the use of the
system linker.  It's probably preferable to the #! approach since it
guarantees that the image and interpreter are compatible.



			  --Chris





More information about the Squeak-dev mailing list