[ENH][GOODIE][PLEA] A simple installer trick

Andreas Raab andreas.raab at gmx.de
Tue Dec 10 21:25:08 UTC 2002


Hi Guys,

This was triggered by the last message asking for how to install a bunch
of .st files. Even though we have SAR files and they are far superior it
is annoying to no end for newbies getting things all messed up because
they don't put the files into the "right" location. Dandelion for
example, comes in a zip-file which has a directory named
"dandelion0.5beta20020413", but the install.st file looks for
"dandelion0.5". That (in addition to using "FileDirectory default")
makes it almost impossible for newbies to get anything going at all.
E.g., even if you tell people to load the "install.st" file chances are
really good that it won't work. So what's the solution?! A few lines of
code:

| dir ctx |
dir := FileDirectory default.
ctx := thisContext.
[ctx == nil or:[ctx receiver isKindOf: FileStream]] 
	whileFalse:[ctx := ctx sender].
ctx ifNotNil:[dir := ctx receiver directory].

The above will answer the directory in which "install.st" resides (or
nil if not coming from a file) and then you can (for example) do things
like:

	(dir readOnlyFileNamed: 'foo.st') fileIn.

and make your installations so that they work from *any* directory. So,
please, please, please, if you provide multiple-file installation and if
you do not use SAR then at least use this little hack to make life for
newbies a little easier.

Cheers,
  - Andreas




More information about the Squeak-dev mailing list