🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #16714

Sys 4.1; hacking Installer scripts for use with floppy systems

#16714
From: earleh
Date: Wed, 10 Jun 1987 06:54
129 lines
7600 bytes
First of all, let me say that System 4.1 is a nice piece of work.
(The Finder that comes with it needs some hacking with ResEdit to
make things preload, though.)

I have a 512Ke, and use a 512K (yuch) at work.  The new System file
takes a lot of squeazin' to make it fit on a single sided floppy, but
with some careful hacking of Installer scripts, the job can be made
easier.  This procedure is not intended for the faint of heart, since
one little mistake can generate a severely crippled, maybe non-bootable
disk.

In INFO-MAC Digest,  Volume 5 : Issue 92, Joel West writes:
>
>Finally, people complained about the size.  One factor is the set of ROM
>patches to retrofit old traps and add new traps.  The resource sizes are:
>'PTCH'  0       540 bytes       all systems
>        105     5,696           Mac 512
>        117     26,884          Mac Plus, 512e
>        630     12,958          Mac SE
>        376     12,004          Mac II
>
>If you really need to make a compact a Mac Plus-only version, strip out:
>        PTCH: 105, 376, 630
>        snd,snth,ADBS,cicn: all
>That saves 40K in the System file.  You could also make an SE version
>by stripping the unused PTCH's an all but the ADBS.  For the Mac II,
>strip only the PTCH.

What follows is a summary of how I modified my "Mac Plus,512Ke,512k (v4.1)"
Installer script to (a) not install the patches, (b) not install any
desk accessories unless already in the destination System file, and
(c) skip the FONT update.  As a result, I am now running VersaTerm PRO
on a single-sided floppy, with a MiniFinder and 40k of free space.  If
you want more details, I refer you to "TN 75 Installer Scripts" for them,
this is just a cookbook.

Briefly, Installer scripts (resource 'insc', ID 0) look like a bunch
of file and resource names embedded in what looks like pcode.  Open up
one of them with FEdit or REdit (I prefer REdit over ResEdit because
it is much safer to use, also ResEdit crashes if I open 'insc's as
'insc' for some unknown reason).  Scan through the display in the
ASCII part of the window until you find 'DRVR'.  The two bytes
preceding the 'D' are a disposition code, telling the Installer what
to do with the resource.  The 'R' is followed by a few bytes of pcode,
mostly zeroes, then the driver name.  The stuff between the resource
type and the name (if present) is stuff like resource length, ID, and
filler bytes.  You know when you've found the end of the part of the
script describing a particular resource when you run up against
the next disposition code and resource type.

Find the entry for "Chooser".  Starting two bytes before the 'D' in
DRVR, the hex part of the display should read "600044525652".
Changing 6000 (hex) to 6040 (hex) tells the Installer to install the
Chooser only if there is one in the destination system.  Changing 6000
to 6040 for ALL the DRVRs (drivers) tells the Installer you don't
really want any of them unless already installed.  Depending on your
setup, you might or might not want to do this with ".Print" and the
Appletalk drivers, too.

Now for the patches.  These don't have names, but you can go by the ID
numbers, which are right after the resource type, 'PTCH'.  The number
is repeated, once for the source ID and once for the destination ID.
In case you can't convert decimal to hex in your head, here are the 
equivalents:

        dec                     hex
        0                       0
        105                     69
        117                     75
        630                     276
        376                     178

The default disposition code for the 'PTCH's is 6002 hex, and is to
be found just before the resource type, as with the 'DRVR's.  
Changing this code to 400A hex causes the Installer to REMOVE the
patches you don't want.  MAKE SURE TO DO THIS ONLY TO THE PATCHES
YOU don't WANT.

Now for the 'FONT's.  These are installed along with the 'FOND's, and
these are found at the end of this script.  Chances are, you have one
favorite font or two, and don't want Times, Helvetica, Courier, etc.
on all your disks.  You might not even like Apple fonts, and you use
Boston II, that's up to you.  Anyway, the default disposition code for
'FOND's is 6000.  Change it to 6040, and you only get the 'FOND's and
'FONT's you already have.  Trouble is, you get all the sizes.
Personally, I prefer to handle the font stuff with Font DA Mover, and
don't like the Installer messing with it.  I couldn't think of a way
to do this by changing the disposition code because as we all know, we
have to have Geneva (the "real" name for these two bytes is "rspec"
but I'm not using it because the term is vague, in case you wondered.) 

This is what I did to disable the font update completely.  This part
is tricky (I bet you thought the other stuff was tricky.)  Find the
hex string 0653797374656D000072.  This is the name of the System file,
followed by two zero bytes and then 72 hex.  The 72 hex is, I believe,
the number of resources handled by this update script.  STOP HERE IF
YOU ARE TIMID.  Change the 72 hex to 6C.  Go down to the first 'FOND'.
Back up two bytes to the beginning of the 6000 hex preceding it.
Press the '0' key and hold it down until you reach the end of the
'insc' resource.  (I strongly recommend REdit for this operation, 
because with FEdit it's kind of hard to tell when you have hit the
end of the script).

You're all done, except for one crucial part.  Go back up to the 
beginning of the script.  Locate the text for the script title and
help screen.  Alter the ASCII part of the text in such a way as to
positively identify this script as something that was hacked by
you and is not a virgin Apple product.  I find that the string
"ROGUE MONSTER: ARRRGGGH!  MONSTERS FROM THE DEPTHS!" right in the
middle of the help text works for me.  I also changed the title to
"Earle's DEATH script" just to make it distinctive.  Be careful not
to mess with the bytes that define the help and title string lengths,
or you will be sorry.  Just planting something offensive in the 
middle of these two strings is a pretty safe way to give most
people the idea there's something queer about your script.

I didn't bother with "snd,snth,ADBS,cicn: all" because the ADBS is
just a little bitty thing, hardly worth the trouble, and the 
Installer didn't give me the other things when I used the Mac Plus/
512k/512ke script.

Disclaimer: If you choose to hack up any software based on what I
            have written here, you do so at your own risk.  Neither
            my employer not myself approve of other people hacking up 
            software or using it for other than its intended use.
-- 
*********************************************************************
*Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755   *
*********************************************************************
Technical Details
Message-ID: <6443@dartvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!dartvax!earleh

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!dartvax!earleh
From: earleh@dartvax.UUCP
Newsgroups: comp.sys.mac
Subject: Sys 4.1; hacking Installer scripts for use with floppy systems
Message-ID: <6443@dartvax.UUCP>
Date: Wed, 10-Jun-87 02:54:18 EDT
Article-I.D.: dartvax.6443
Posted: Wed Jun 10 02:54:18 1987
Date-Received: Sat, 13-Jun-87 07:43:37 EDT
Organization: Society for the Prevention of Cruelty to Graduate Students
Lines: 129
Keywords: remove unused resources today, single-sided floppy, 512k