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

Stephane Ducasse ducasse at iam.unibe.ch
Tue Dec 10 21:41:36 UTC 2002


Thanks andreas

for my turtle installation I always postponed this issue because I was 
lazy,
What I wanted was to ask to the filelist on which directory it was 
pointing,
but I could not know it easily, because several of them could be open, 
so I had to
  find the topmost one.....

My installation is really bad because I ask the user to load a file, 
but after
I forced him to tell where it was. uh? silly no? so thanks I will play 
with that and sar :)

On mardi, décembre 10, 2002, at 10:25  pm, Andreas Raab wrote:

> 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
>
>
>
Dr. Stéphane DUCASSE (ducasse at iam.unibe.ch) 
http://www.iam.unibe.ch/~ducasse/
  "if you knew today was your last day on earth, what would you do
  different? ... especially if, by doing something different, today
  might not be your last day on earth" Calvin&Hobbes





More information about the Squeak-dev mailing list