• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Installer SDK tips?

halkyardo

Well-known member
As my ethernet card's driver starts looking more and more like an actual functioning piece of software, I've been giving some thought to how to distribute it - the SE/30 card's driver can be packaged neatly as a comd system extension that you can drop into your System Folder (only Network Software 1.5 supports this, but I don't see any arguments in favour of running an older version), but the driver for the Slot Manager-unaware SE is a DRVR resource that needs to be manually added to the System file, potentially having to adjust its resource ID to avoid conflicts with any other installed drivers. Yeah, yeah, you can do that with ResEdit and a couple of brain cells, but it'd be nice to make the install process a bit more polished than that.

I found the Apple Installer SDK on the Macintosh Garden, and that definitely feels like the right tool for the job (especially if I can bundle the right Network Software bits along with it like the Asante and Dayna driver disks did), but it's not exactly easy to get my head around, and the docs that come with it are very Inside Macintosh in style: detailed, well-written, and completely incomprehensible unless you already understand them. It's a chicken-and-egg type of situation - I'm sure I could start to make sense of them if I got my head around the basic concepts, but it's hard to glean those from a reference guide that assumes you know them already. The key to finally getting my head around IM and the Toolbox was to read third-party books about programming for the Mac OS, but I'm not aware of anything like that out there for the Installer.

It's especially frustrating that while there are examples included in the SDK, none of them seem to cover working with resources in the way that I would have to. The Network Software installers and the various ethernet card vendor's driver installers do exactly the things I want to do, but they're so convoluted (and undocumented) that it's difficult to follow what's going on.

This is partly just a rant - it's a pretty niche thing to even want to know about - but as a genuine question: is anyone aware of anything out there that explains Installer scripting in terms more accessible to mere mortals? I'm sure I'll figure it out eventually if I keep bashing my head against it, but if there's an easier way to learn, I'd love to know about it.
 

Nixontheknight

Well-known member
As my ethernet card's driver starts looking more and more like an actual functioning piece of software, I've been giving some thought to how to distribute it - the SE/30 card's driver can be packaged neatly as a comd system extension that you can drop into your System Folder (only Network Software 1.5 supports this, but I don't see any arguments in favour of running an older version), but the driver for the Slot Manager-unaware SE is a DRVR resource that needs to be manually added to the System file, potentially having to adjust its resource ID to avoid conflicts with any other installed drivers. Yeah, yeah, you can do that with ResEdit and a couple of brain cells, but it'd be nice to make the install process a bit more polished than that.

I found the Apple Installer SDK on the Macintosh Garden, and that definitely feels like the right tool for the job (especially if I can bundle the right Network Software bits along with it like the Asante and Dayna driver disks did), but it's not exactly easy to get my head around, and the docs that come with it are very Inside Macintosh in style: detailed, well-written, and completely incomprehensible unless you already understand them. It's a chicken-and-egg type of situation - I'm sure I could start to make sense of them if I got my head around the basic concepts, but it's hard to glean those from a reference guide that assumes you know them already. The key to finally getting my head around IM and the Toolbox was to read third-party books about programming for the Mac OS, but I'm not aware of anything like that out there for the Installer.

It's especially frustrating that while there are examples included in the SDK, none of them seem to cover working with resources in the way that I would have to. The Network Software installers and the various ethernet card vendor's driver installers do exactly the things I want to do, but they're so convoluted (and undocumented) that it's difficult to follow what's going on.

This is partly just a rant - it's a pretty niche thing to even want to know about - but as a genuine question: is anyone aware of anything out there that explains Installer scripting in terms more accessible to mere mortals? I'm sure I'll figure it out eventually if I keep bashing my head against it, but if there's an easier way to learn, I'd love to know about it.
it should actually be easier to use Installer VISE to make an installer. Macintosh Repository unfortunately has only PowerPC versions, but Vise 6.0 from macintosh garden might work on any mac with a 68020 or better, you just need to follow the protocol that is on the page to register it. Not sure if it will work for your need, but it might do some of the heavy-lifting for you
 

finkmac

NORTHERN TELECOM
Ahhh the Installer SDK. A fascinating piece of kit... I spent several days finding various versions and poking at them last year.

Rather emblematic of apple internal attitudes at the time. Nice for the user, insane for the person developing for it.

You now know the reason most people used VISE or InstallMaker... those are way simpler. I think they're even more or less drag and drop GUI deals versus the "write a script and run it through an MPW tool to make a usable install script that the installer app can process" of the Installer SDK.

Note that there's older versions of the Installer SDK. For the SE card I'd recommend SDK version 3 or 4.

I might be having false memories here, but I seem to recall some sort of install script decompiler. Would be useful to see how others handle it.
I also seem to recall MacTech having some articles on the Installer SDK... but I can't find them anymore!
 

cheesestraws

Well-known member
I think your comments are bang-on, @halkyardo, and now you know why anyone who didn't have to use the Apple installer tended to use something else instead. It's very much a swiss army precision chainsaw, where you reach for a precision screwdriver, press the wrong button, and a bulldozer crashes through the wall.

I'm kind of at the same place as you: I read the reference documentation, went "what" and put it aside as a problem for another day. I suspect you're probably going to either have to get your head around it, though, or write something else to install the resource in the System file, because I don't think either InstallerMaker or VISE do that (though I may be wrong about the latter). At a slight tangent, I vaguely remember some sample code that comes with CodeWarrior to install DRVRs and manages things like finding a spare resource ID - I think it's for an extension, but you could probably modify it into an application to do an install of the DRVR into the System? It's ugly, but it might be less detrimental to your sanity than trying to understand the Installer SDK...
 

halkyardo

Well-known member
Note that there's older versions of the Installer SDK. For the SE card I'd recommend SDK version 3 or 4.
Do you happen to have any pointers as to where I could find older versions? I might be missing something, but the only one I can track down is that (presumably rather late) version that I found on the Garden.

I might be having false memories here, but I seem to recall some sort of install script decompiler. Would be useful to see how others handle it.
I also seem to recall MacTech having some articles on the Installer SDK... but I can't find them anymore!
That's the beauty of the 'write it all as resources' approach, I suppose! I've had some success just feeding an Installer script to DeRez and giving it the right arguments to find and use the Installer resource definitions. Resorcerer also understands Installer resources, as it turns out.

The resource-based approach would also be quite handy for my development workflow. I'm committing heresy and doing all the development on a modern system using the Retro68 toolchain. Being able to write my installer script in Rez syntax (Retro68 has a reimplementation of Rez for modern systems) and then compile it to a resource file means that I can (hopefully) set things up to produce an installer as part of my automated builds and produce a ready-to-go disk image as the end product without any manual intervention. That'd be kinda neat.
 

NJRoadfan

Well-known member
Based on my experiences with Apple development documentation over the decades (from Apple IIgs to MacOS X), they tend to not provide any decent examples. They document stuff, but don't actually show you how to use it. SDKs need example code while DDKs need sample driver source. Its one place that Microsoft did a good job over the years, but Apple lagged behind.
 

finkmac

NORTHERN TELECOM
Do you happen to have any pointers as to where I could find older versions? I might be missing something, but the only one I can track down is that (presumably rather late) version that I found on the Garden.
They'll be buried in the Apple Develop CDs on macintoshgarden... the Toolchest CDs from 92-95 will have them.
 

halkyardo

Well-known member
At a slight tangent, I vaguely remember some sample code that comes with CodeWarrior to install DRVRs and manages things like finding a spare resource ID - I think it's for an extension, but you could probably modify it into an application to do an install of the DRVR into the System? It's ugly, but it might be less detrimental to your sanity than trying to understand the Installer SDK...
Yeah, the thought had crossed my mind to just write my own special-purpose tool to install (and potentially uninstall) it. It's only Resources, after all.

The Inside Macintosh-recommended way (for which they have example code) is to add your driver to the driver table at runtime (either in an INIT at boot time, or when your software starts), rather than messing with the System file. It'd be really nice to do it with an INIT (and consistent with the Extension that the SE/30 driver uses), but I suspect that ordering will become a problem - presumably the network driver needs to be ready to go before AppleTalk comes up, and if that technique worked well I bet that ethernet card vendors would have used it rather than shoving resources into the System file.

Oh well, if I do get my head around the Installer, I'll do my best to write it up in easier-to-understand terms so that it might be useful to other people!
 

cheesestraws

Well-known member
Based on my experiences with Apple development documentation over the decades (from Apple IIgs to MacOS X), they tend to not provide any decent examples

Yes, I'd very much agree with this. Apple example code is 'here's something someone at DTS made for fun, which may or may not explain anything'.

I suspect that ordering will become a problem

... when did 'aini's become a thing? System 7? Wouldn't help you for System 6.
 

halkyardo

Well-known member
From what I remember... Ethernet card drivers usually are a seperate INIT?
Yes and no. For Slot Manager-aware ethernet cards, the system (technically the Network Software) provides a generic .ENET driver, which then looks for an enet resource with an ID that matches the Board ID in the card's declaration ROM, and hands the actual driver operation off to that. This allows the system to support multiple ethernet cards from different vendors through a single driver interface (the .TOKN and .FDDI drivers did a similar thing for token-ring and FDDI interfaces).

Orignally the .ENET driver only looked for enet resources in the System file, but later versions of the driver (e.g. Network Software Installer 1.5) also looked for resources in files of type comd in the Extensions folder. Apple used this for their cards and on-board ethernet on later systems, but most of the ethernet driver disks I've looked at don't seem to use this mechanism (they instead install an enet resource into the System file, presumably for compatibility with earlier Network Software versions that didn't have the comd loader).

So yes, ethernet drivers can be loaded from the Extensions folders, but they're not INITs, and the loading mechanism doesn't support all types of cards. Apologies for being pedantic, I've just been deeply immersed in this stuff for a month or two now and the madness is starting to show.

On the SE, though, none of that applies, because there's no Slot Manager. Non-Slot Manager cards are handled in a much more rudimentary way - they are expected to install a .ENET0 driver, and software using the driver (e.g. AppleTalk, MacTCP, etc.) is expected to fall back and try to load .ENET0 if it can't find any Slot Manager ethernet cards for the .ENET driver.

This brings up some tricky questions about installation, too - for example, consider if someone had previously been using a DaynaPORT SCSI/Link, whose driver is also .ENET0. I'm assuming that having two driver table entries with the same name would be a Bad Thing, so an installer would have to handle that case as well. Ugh.
 

uyjulian

Well-known member
If there is a mechanism like NSIS plugins, you could use that to handle your driver installation code.
 

halkyardo

Well-known member
Just an update to this - I'm slowly but surely getting my head around the Installer. Mostly just by trial and error, and reading and re-reading the documentation, but another find that really helped put the pieces together was a program called Cappella that was distributed along with later version of the Installer SDK - it's a graphical editor specifically for installer resources that's also capable of importing and 'disassembling' existing Installer scripts. Of course with imported scripts all the rules and assertions just have numbers rather than descriptive names (just like when you're looking at them in ResEdit), but it makes it a lot easier to understand what's going on and keep track of all the references between rules, packages, atoms, filespecs and all that jazz.

The Installer SDK 1.2.4 archive that's up on the Macintosh Garden has a copy of Cappella under "Upgrader 1.2.3 & Engines:Installer Engine 4.5.2:Tools:Experimental"
 
Top