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

Stephen Pair spair at acm.org
Tue Dec 10 21:34:20 UTC 2002


An even better solution would be to bind some sort of "installer" object
to "self" just like the SARInstaller does.  That way you could write
"self directory" or "self fileName" or "self fullFileName" instead of
jumping up the context stack.

But, short of that, I certainly agree with you.

- Stephen

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Andreas Raab
> Sent: Tuesday, December 10, 2002 4:25 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: [ENH][GOODIE][PLEA] A simple installer trick
> 
> 
> 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