Squeak SmalltalkJoker Squeak Smalltalk : Tools Tricks Usage : prevnext SAR Installer

SARInstaller
About SAR files

If you have a Squeak package that has more than one file you should 
consider making a SAR out of it.

As part of the SqueakMap project, we've come up with a convention for 
structuring multi-file Squeak archives. We're using the .sar (Squeak 
ARchive) extension for these. They're Zip archives that can have any 
contents; there are two special member names that are reserved:

install/preamble -- filed in first
install/postscript -- filed in next

The preamble and postscript are filed in as Smalltalk code.

Within the preamble and postscript, self stands for the SARInstaller 
that's loading the archive.

About SARInstaller

SARInstaller is a package that knows how to load SAR (Squeak ARchive) 
files.

Here's how to load different types of SAR members from a preamble or 
postscript file:

SAR Member type  load using
Change sets  self fileInMemberNamed: 'member.cs'
DVS packages  self fileInPackageNamed: 'member.st'
Monticello packages  self fileInMonticelloPackageNamed: 'member.mc'

Projects (with construction of a ViewMorph)  self fileInProjectNamed: 
'member.pr' createView: true

Projects (without construction of a ViewMorph)  self 
fileInProjectNamed: 'member.pr' createView: false

Genie gesture dictionaries  self fileInGenieGestureDictionaryNamed: 
'member.ggd'

Graphics files (.gif, .jpg, .form, etc.) (loaded as SketchMorphs)  
self openGraphicsFile: 'member.jpg'

Text files (loaded as text editor windows)  self openTextFile: 
'member.text'

Morph(s) in files  self fileInMorphsNamed: 'member.morph' addToWorld: 
true

Arbitrary files can be extracted in various ways:
using their member name as a filename  self extractMember: 'member.xxx'

specifying a different filename  self extractMember: 'member.xxx' 
toFileNamed: 'newName'

using their member name as a filename but stripping the directories  
self extractMemberWithoutPath: 'member.xxx'

using their member name as a filename but stripping the directories 
and specifying a different directory  self extractMemberWithoutPath: 
'member.xxx' inDirectory: 'directoryName'

And if those aren't enough, you can get to the zip or its members 
directly:

self zip ...
self memberNamed: 'memberName' ...
(self memberNamed: 'memberName') contentStream ...

This gives you complete flexibility over how to install.

To create SAR packages, you can use the ArchiveViewer or other zip 
tool manually, or use the SARBuilder or DVS packages.

Getting SARInstaller
3.6 images include the SARInstaller package.

You can get SARInstaller for 3.4 and 3.5 images from SqueakMap

a copy of v16 has been uploaded here too: SARInstallerFor34-nk.cs.gz

Or the SARInstaller for 3.2 images from SqueakMap