# HG changeset patch # User Claus Gittinger # Date 888432234 -3600 # Node ID 4dd439ebf1623f66681430e3b69117d2b794921f # Parent aa0b1c1ebfe6f75b62707897444766848959a1a9 added full installation diff -r aa0b1c1ebfe6 -r 4dd439ebf162 STXInstaller.st --- a/STXInstaller.st Wed Feb 25 18:20:32 1998 +0100 +++ b/STXInstaller.st Wed Feb 25 19:43:54 1998 +0100 @@ -1,9 +1,9 @@ Object subclass:#STXInstaller instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir installDocFiles - installSourceFiles installSTCFiles installGoodyFiles + installSourceFiles installSTCFiles installGoodyFiles fullDir actionPercentageHolder actionTextHolder commandTraceView - resources' - classVariableNames:'LastBinDir LastLibBinDir LastLibDir' + resources fullInstallation dfHolder copyProcess' + classVariableNames:'LastBinDir LastLibBinDir LastLibDir LastFullDir' poolDictionaries:'' category:'eXept-tools' ! @@ -50,6 +50,24 @@ "Modified: 18.7.1996 / 19:45:08 / cg" ! +defaultFullDirs + |dirs| + + dirs := OrderedCollection new. + dirs add:(Filename homeDirectory constructString:'stxDevelop'). + dirs add:((Filename homeDirectory + construct:'stx') + constructString:'develop'). + ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[ + dirs add:'/home/stx/develop'. + ]. + + ^ dirs sort + + "Modified: / 18.7.1996 / 19:45:08 / cg" + "Created: / 25.2.1998 / 17:14:43 / cg" +! + defaultLibBinDirs |dirs| @@ -104,23 +122,28 @@ |dirsToMake| dirsToMake := OrderedCollection new. - dirsToMake add:stxBinDir. - dirsToMake add:stxLibDir. - dirsToMake add:stxLibBinDir. - dirsToMake add:(stxLibDir asFilename constructString:'configurations'). - dirsToMake add:(stxLibDir asFilename constructString:'doc'). - dirsToMake add:(stxLibDir asFilename constructString:'doc/online'). - dirsToMake add:(stxLibDir asFilename constructString:'doc/online/english'). - dirsToMake add:(stxLibDir asFilename constructString:'doc/online/german'). - dirsToMake add:(stxLibDir asFilename constructString:'doc/online/french'). - dirsToMake add:(stxLibDir asFilename constructString:'doc/online/italian'). - dirsToMake add:(stxLibDir asFilename constructString:'include'). - dirsToMake add:(stxLibDir asFilename constructString:'resources'). - dirsToMake add:(stxLibDir asFilename constructString:'binary'). - dirsToMake add:(stxLibDir asFilename constructString:'bitmaps'). - dirsToMake add:(stxLibDir asFilename constructString:'goodies'). + fullInstallation ifTrue:[ + dirsToMake add:fullDir. + ] ifFalse:[ + dirsToMake add:stxBinDir. + dirsToMake add:stxLibDir. + dirsToMake add:stxLibBinDir. + dirsToMake add:(stxLibDir asFilename constructString:'configurations'). + dirsToMake add:(stxLibDir asFilename constructString:'doc'). + dirsToMake add:(stxLibDir asFilename constructString:'doc/online'). + dirsToMake add:(stxLibDir asFilename constructString:'doc/online/english'). + dirsToMake add:(stxLibDir asFilename constructString:'doc/online/german'). + dirsToMake add:(stxLibDir asFilename constructString:'doc/online/french'). + dirsToMake add:(stxLibDir asFilename constructString:'doc/online/italian'). + dirsToMake add:(stxLibDir asFilename constructString:'include'). + dirsToMake add:(stxLibDir asFilename constructString:'resources'). + dirsToMake add:(stxLibDir asFilename constructString:'binary'). + dirsToMake add:(stxLibDir asFilename constructString:'bitmaps'). + dirsToMake add:(stxLibDir asFilename constructString:'goodies'). + ]. + ^ dirsToMake - ^ dirsToMake + "Modified: / 25.2.1998 / 17:15:19 / cg" ! listOfOptionalPackages @@ -240,9 +263,31 @@ !STXInstaller methodsFor:'installing'! copyFiles - |msg fileSpec filesToCopy numFiles nDone| + |msg fileSpec filesToCopy numFiles nDone cmd| + + msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection. + + fullInstallation ifTrue:[ + msg at:4 put:(' all from CD' asText allBold). + msg at:6 put:' ' , (fullDir asText allBold). + actionTextHolder value:nil. + actionTextHolder value:msg. - msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection. + cmd := 'cp -r ../../* ' , fullDir. + "/ + "/ not all systems have cp -rv + "/ + OperatingSystem getOSType = 'linux' ifTrue:[ + cmd := 'cp -rv ../../* ' , fullDir. + ]. + commandTraceView showCR:cmd , ' ...'. + commandTraceView endEntry. + cmd := cmd , ' 2>&1' . + + self executeCommandAndShowOutput:cmd. + + ^ true + ]. fileSpec := self specOfFilesToCopy. @@ -278,7 +323,7 @@ nDone := 0. filesToCopy do:[:entry | - |fileName destDir cmd p text line doneSemaphore| + |fileName destDir cmd| fileName := entry key. destDir := entry value. @@ -304,29 +349,7 @@ commandTraceView endEntry. cmd := cmd , ' 2>&1' . - doneSemaphore := Semaphore new. - - [ - - p := PipeStream readingFrom:cmd. - p isNil ifTrue:[ - self warn:('command error. Could not execute:\\' , cmd) withCRs. - ] ifFalse:[ - [p atEnd] whileFalse:[ - (p readWaitWithTimeout:0.1) ifFalse:[ - line := p nextLine. - (line notNil and:[line notEmpty]) ifTrue:[ - commandTraceView showCR:((' ' , line) asText emphasizeAllWith:(#color->Color red)). - commandTraceView endEntry. - ] - ] - ]. - p close. - ]. - doneSemaphore signal. - ] forkAt:4. - - doneSemaphore wait. + self executeCommandAndShowOutput:cmd ] ]. @@ -335,8 +358,12 @@ ^ true - "Created: 17.7.1996 / 15:16:20 / cg" - "Modified: 22.5.1997 / 15:06:33 / cg" + " + STXInstaller open + " + + "Created: / 17.7.1996 / 15:16:20 / cg" + "Modified: / 25.2.1998 / 18:30:53 / cg" ! createDirectories @@ -408,11 +435,51 @@ commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...'). commandTraceView endEntry. - OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)'). + fullInstallation ifTrue:[ + OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)'). + ] ifFalse:[ + OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)'). + ]. ^ true - "Created: 17.7.1996 / 15:24:19 / cg" - "Modified: 22.5.1997 / 15:06:48 / cg" + "Created: / 17.7.1996 / 15:24:19 / cg" + "Modified: / 25.2.1998 / 19:20:59 / cg" +! + +executeCommandAndShowOutput:cmd + |doneSemaphore line p| + + doneSemaphore := Semaphore new. + + copyProcess := [ + + p := PipeStream readingFrom:cmd. + p isNil ifTrue:[ + self warn:('command error. Could not execute:\\' , cmd) withCRs. + ] ifFalse:[ + [ + [p atEnd] whileFalse:[ + (p readWaitWithTimeout:0.1) ifFalse:[ + line := p nextLine. + (line notNil and:[line notEmpty]) ifTrue:[ + commandTraceView showCR:((' ' , line) asText emphasizeAllWith:(#color->Color red)). + commandTraceView endEntry. + ] + ] + ]. + p close. + ] valueOnUnwindDo:[ + p shutDown + ] + ]. + doneSemaphore signal. + copyProcess := nil. + ] forkAt:4. + + doneSemaphore wait. + + "Created: / 25.2.1998 / 17:46:06 / cg" + "Modified: / 25.2.1998 / 18:36:50 / cg" ! outputInitialMessage @@ -465,6 +532,8 @@ askAndInstall "/ check, if we are in the projects/smalltalk directory + |answer| + resources := ResourcePack for:self class. (Filename currentDirectory pathName endsWith:'projects/smalltalk') ifFalse:[ @@ -472,6 +541,9 @@ ^ self ]. + answer := self askForFullInstallation. + answer ifFalse:[^ self]. + [self askForDestination] whileTrue:[ self checkForExistingInstallationAndConfirm ifTrue:[ self preInstall. @@ -486,23 +558,118 @@ ] ]. - "Modified: 2.3.1997 / 13:46:23 / cg" + "Modified: / 25.2.1998 / 16:54:51 / cg" ! askForDestination "open a dialog to enter destination directories" + fullInstallation ifTrue:[ + ^ self askForDestinationForFullInstallation + ] ifFalse:[ + ^ self askForDestinationForPartialInstallation + ] + + " + STXInstaller open + " + + "Modified: / 25.2.1998 / 17:12:45 / cg" +! + +askForDestinationForFullInstallation + "open a dialog to enter destination directories" + + |d cm l green dark img + fullDirHolder| + + LastFullDir isNil ifTrue:[ + LastFullDir := (Filename homeDirectory + construct:'stx') + constructString:'develop' + ]. + + fullDirHolder := LastFullDir asValue. + + Screen current hasColors ifTrue:[ + green := (Color red:0 green:80 blue:20) "darkened". + dark := Color grey:10. + ] ifFalse:[ + green := Color white. + dark := Color black. + ]. + + d := DialogBox new. + + d label:(resources string:'ST/X Full Installation'). + img := Image fromFile:'SmalltalkX.xbm'. + + l := d addTextLabel:img. + l adjust:#left; foregroundColor:green backgroundColor:dark. + + l := d addTextLabel:(resources string:'Smalltalk/X CD installation (full).'). + l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + d addVerticalSpace. + d addVerticalSpace. + + d addHorizontalLine. + + l := d addTextLabel:(resources string:'ST/X development directory:'). + l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + + cm := ComboBoxView on:fullDirHolder. + cm list:self defaultFullDirs. + d + addLabelledField:cm + label:(resources string:'stx develop') + adjust:#left + tabable:true + from:0.0 to:1.0 separateAtX:0.25 + nameAs:'fullBox'. + + (d componentAt:'fullBox.label') backgroundColor:dark; foregroundColor:Color white. + + d addVerticalSpace. + d addHorizontalLine. + + d addHelpButtonFor:'STXInstaller/installHelp.html'; + addAbortButton; + addOkButtonLabelled:(resources string:'install'). + d extent:500@400. + + d allViewBackground:dark. + + d openAtCenter. + d accepted ifTrue:[ + fullDir := LastFullDir := fullDirHolder value. + d destroy. + ^ true + ]. + d destroy. + ^ false + + " + STXInstaller open + " + + "Created: / 25.2.1998 / 17:11:37 / cg" + "Modified: / 25.2.1998 / 17:29:07 / cg" +! + +askForDestinationForPartialInstallation + "open a dialog to enter destination directories" + |d cm l green dark img stxLibDirHolder stxLibBinDirHolder stxBinDirHolder installDocHolder installSourceHolder installSTCHolder installGoodiesHolder binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes | - binMegabytes := 10. + binMegabytes := 12. libMegabytes := 30. - docMegabytes := 11. + docMegabytes := 15. stcMegabytes := 1. - srcMegabytes := 15. + srcMegabytes := 20. LastLibDir isNil ifTrue:[ LastLibDir := '/usr/local/lib/smalltalk' @@ -533,13 +700,13 @@ d := DialogBox new. - d label:(resources string:'ST/X CD Installation'). + d label:(resources string:'ST/X Partial Installation'). img := Image fromFile:'SmalltalkX.xbm'. l := d addTextLabel:img. l adjust:#left; foregroundColor:green backgroundColor:dark. - l := d addTextLabel:(resources string:'Smalltalk/X CD installation.'). + l := d addTextLabel:(resources string:'Smalltalk/X CD installation (partial).'). l adjust:#left; backgroundColor:dark; foregroundColor:Color white. d addVerticalSpace. d addVerticalSpace. @@ -549,6 +716,9 @@ l := d addTextLabel:(resources string:'Destination directories:'). l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + l := d addTextLabel:(resources string:'(the defaults below are recommended)'). + l adjust:#right; backgroundColor:dark; foregroundColor:Color white. + cm := ComboBoxView on:stxBinDirHolder. cm list:self defaultBinDirs. d @@ -648,67 +818,262 @@ d destroy. ^ false - "Modified: 22.5.1997 / 15:04:29 / cg" + " + STXInstaller open + " + + "Created: / 25.2.1998 / 17:11:26 / cg" + "Modified: / 25.2.1998 / 19:43:30 / cg" +! + +askForFullInstallation + "open a dialog to enter destination directories" + + |d cm l green dark img| + + Screen current hasColors ifTrue:[ + green := (Color red:0 green:80 blue:20) "darkened". + dark := Color grey:10. + ] ifFalse:[ + green := Color white. + dark := Color black. + ]. + + d := DialogBox new. + + d label:(resources string:'ST/X CD Installation'). + img := Image fromFile:'SmalltalkX.xbm'. + + l := d addTextLabel:img. + l adjust:#left; foregroundColor:green backgroundColor:dark. + + l := d addTextLabel:(resources string:'Smalltalk/X CD installation.'). + l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + d addVerticalSpace. + d addVerticalSpace. + + d addHorizontalLine. + + l := d addTextLabel:(resources string: +'You can either perform a ' , 'full' asText allBold , ' installation, or a ' , 'partial' asText allBold ,' installation.'). + l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + + d addVerticalSpace. + d addHorizontalLine. + + d leftIndent:20. + l := d addTextLabel:(resources string: +'The full installation is required if you want to build your own +customized smalltalk executable. It allows you to include additional +precompiled classes or classLibraries. +This is also required if you want to link your own standalone executables. + +It consists of a directory hierachy, including makefiles for a customizeable +rebuild of the whole smalltalk system. +(Actually, it simply copies the whole CD contents onto your disk). +This requires roughly 120-200Mb of hard disk space.'). + l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + + d addVerticalSpace. + d addHorizontalLine. + + l := d addTextLabel:(resources string: +'The partial installation requires less disk space and only copies the +smalltalk executable, shared libraries and support files onto your hard disk. +This requires roughly 70-90Mb of hard disk space. + + + '). + l adjust:#left; backgroundColor:dark; foregroundColor:Color white. + + + d leftIndent:0. + d addVerticalSpace. + d addHorizontalLine. + + + d addHelpButtonFor:'STXInstaller/installHelp.html'; + addAbortButton; + addOkButton:(Button label:(resources string:'install full') action:[fullInstallation:=true]); + addOkButtonLabelled:(resources string:'install partial'). + d extent:500@400. + + d allViewBackground:dark. + + fullInstallation := false. + d openAtCenter. + d accepted ifTrue:[ + d destroy. + ^ true + ]. + d destroy. + ^ false + + " + STXInstaller open + " + + "Created: / 25.2.1998 / 16:50:16 / cg" + "Modified: / 25.2.1998 / 19:42:31 / cg" ! checkForExistingInstallationAndConfirm "look if there is another installation and confirm reinstalling; return true if ok, false if not" - |whatToDo| + |whichDir canOverWrite whatToDo box| + + fullInstallation ifTrue:[ + whichDir := fullDir. + canOverWrite := false. + ] ifFalse:[ + whichDir := stxLibDir. + canOverWrite := true. + ]. - stxLibDir asFilename exists ifTrue:[ - whatToDo := Dialog - choose:(resources - string:'detected existing ST/X installation in %1' - with:stxLibDir asText allBold) - label:(resources string:'Attention') - labels:(resources array:#('remove first' 'overwrite' 'cancel')) - values:#(remove over nil) - default:nil. + whichDir asFilename exists ifTrue:[ + whatToDo := Dialog + choose:(resources + string:'detected existing ST/X installation in %1' + with:whichDir asText allBold) + label:(resources string:'Attention') + labels:(resources array:(canOverWrite + ifFalse:[#('remove first' 'cancel')] + ifTrue:[#('remove first' 'overwrite' 'cancel')] )) + values:(canOverWrite ifFalse:[#(remove nil)] ifTrue:[#(remove over nil)]) + default:nil. - whatToDo isNil ifTrue:[^false]. - whatToDo == #remove ifTrue:[ - ((stxLibDir findString:'stx') == 0 - and:[(stxLibDir findString:'smalltalk') == 0]) ifTrue:[ - "/ confirm again - (self confirm:(resources - string:'are you certain that the directory to remove -(' , stxLibDir , ') is really a smalltalk directory ? + whatToDo isNil ifTrue:[^false]. + whatToDo == #remove ifTrue:[ + ((whichDir findString:'stx') == 0 + and:[(whichDir findString:'smalltalk') == 0]) ifTrue:[ + "/ confirm again + (self confirm:(resources + string:'are you certain that the directory to remove +(' , whichDir , ') is really a smalltalk directory ? Remove it now ?')) ifFalse:[ - (self confirm:(resources - string:'overwrite ?')) ifTrue:[^ true]. - ^ false - ] - ]. + ^ false + ] + ]. + + [ + box := DialogBox new label:'please wait'. + box addTextLabel:'removing ' , whichDir , ' ...'. + box showAtPointer. + ] forkAt:(Processor activePriority+1). + box waitUntilVisible. - (OperatingSystem recursiveRemoveDirectory:stxLibDir) - ifFalse:[ - self warn:(resources string:'mhmh - could not remove old installation.') + (OperatingSystem recursiveRemoveDirectory:whichDir) + ifFalse:[ + self warn:(resources string:'mhmh - could not remove old installation. + +Please remove it manually (using root privileges if required) +and try again.'). + box destroy. + ^ false + ]. + + box destroy ]. - ]. - ^ true ]. + ^ true - "Modified: 2.3.1997 / 13:45:13 / cg" + " + STXInstaller open + " + + "Modified: / 25.2.1998 / 19:35:12 / cg" ! doInstall "install ST/X; return true if ok, false if not" - |progressView ok textView| + |progressView ok v textView p l + dirToMonitor doDfMonitoring dfMonitorProcess| + + doDfMonitoring := false. + + v := View new preferredExtent:(250 @ 350). + + textView := HVScrollableView for:TextCollector in:v. + textView origin:0.0@0.0 corner:1.0@1.0. + textView bottomInset:30. + commandTraceView := textView scrolledView. + + fullInstallation ifTrue:[ + dirToMonitor := fullDir. + ] ifFalse:[ + dirToMonitor := stxLibDir + ]. + + (OperatingSystem canExecuteCommand:'df ' , dirToMonitor) ifTrue:[ + p := HorizontalPanelView in:v. + p origin:0.0@1.0 corner:1.0@1.0. + p topInset:-30. + p horizontalLayout:#fit. + + l := Label label:'' in:p. + l labelChannel:(dfHolder := '' asValue). + l adjust:#left. + dfMonitorProcess := [ + |ok p text keys values i l| - textView := HVScrollableView for:TextCollector. - textView preferredExtent:(200 @ 300). - commandTraceView := textView scrolledView. + ok := true. + [ok] whileTrue:[ + doDfMonitoring ifTrue:[ + ok := false. + p := PipeStream readingFrom:('df -k ' , dirToMonitor). + p notNil ifTrue:[ + [ + text := p contentsOfEntireFile. + ] valueNowOrOnUnwindDo:[ + p close. + ]. +"/ Transcript showCR:text asString. + text notNil ifTrue:[ + text := text asCollectionOfLines. + text size >= 2 ifTrue:[ + keys := (text at:1) asCollectionOfWords. + values := (text at:2) asCollectionOfWords. + i := (keys indexOf:'Capacity'). + i == 0 ifTrue:[ + i := (keys indexOf:'capacity'). + ]. + i ~~ 0 ifTrue:[ + l := 'Used disk space: ' , (values at:i) withoutSeparators. + i := (keys indexOf:'Available'). + i == 0 ifTrue:[ + i := (keys indexOf:'available'). + i == 0 ifTrue:[ + i := (keys indexOf:'avail'). + i == 0 ifTrue:[ + i := (keys indexOf:'Avail'). + ]. + ]. + ]. + i ~~ 0 ifTrue:[ + l := l , ' (' , (values at:i) withoutSeparators , 'k available)'. + ]. + dfHolder value:l. + ok := true. + Delay waitForSeconds:9. + ] + ] + ]. + ]. + ]. + Delay waitForSeconds:1. + ] + ] forkAt:(Processor activePriority+3) + ]. progressView := ProgressIndicator inBoxWithLabel:'ST/X Installation' icon:(Depth8Image fromImage:Launcher aboutIcon) text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection abortable:true - view:textView + view:v closeWhenDone:false. progressView topView extent:(640 min:Display width) @ (500 min:Display height). @@ -721,9 +1086,12 @@ actionPercentageHolder := progressValue. actionTextHolder := currentAction. - self outputInitialMessage. + fullInstallation ifFalse:[ + self outputInitialMessage. + ]. (self createDirectories) ifTrue:[ + doDfMonitoring := true. ok := self copyFiles ]. self createSymbolicLinks. @@ -740,10 +1108,21 @@ ] ]. + dfMonitorProcess notNil ifTrue:[ + dfMonitorProcess terminate + ]. + copyProcess notNil ifTrue:[ + copyProcess terminate. + copyProcess := nil. + ]. ^ ok - "Created: 17.7.1996 / 15:11:27 / cg" - "Modified: 2.3.1997 / 12:59:47 / cg" + " + STXInstaller open + " + + "Created: / 17.7.1996 / 15:11:27 / cg" + "Modified: / 25.2.1998 / 19:36:08 / cg" ! open @@ -759,64 +1138,78 @@ |shInfo cshInfo msg havePath| + resources isNil ifTrue:[ + resources := ResourcePack for:self class. + ]. + msg := (resources string:'ST/X Installation complete.\\') withCRs. shInfo := ''. cshInfo := ''. - havePath := true. - (((OperatingSystem getEnvironment:'PATH') - asCollectionOfSubstringsSeparatedBy:$:) - includes:stxBinDir) ifFalse:[ + fullInstallation ifTrue:[ + msg := msg , 'You will now find a development directory hierarchy +in ''' , fullDir asText allBold , '''. + +To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk'' +and start smalltalk with the command: ''./smalltalk''. + +To perform a partial installation of your customized smalltalk later, +use the INSTALL script found in ''' , fullDir , ''''. - havePath := false. - shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. - cshInfo := 'set path=($path ' , stxBinDir , ')\'. - msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\' - with:stxBinDir asText allBold) withCRs. - ]. + ] ifFalse:[ + havePath := true. + (((OperatingSystem getEnvironment:'PATH') + asCollectionOfSubstringsSeparatedBy:$:) + includes:stxBinDir) ifFalse:[ - (stxLibDir ~= '/usr/local/lib/smalltalk' - and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[ - msg := msg , (resources string:'The library directory is not a standard ST/X library directory\("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk").\You have to define the %1 environment variable\as %2 before ST/X can be started.\' - with:'STX_LIBDIR' asText allBold - with:stxLibDir asText allBold) withCRs. - havePath ifFalse:[ - msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs. - ] ifTrue:[ - msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs. + havePath := false. + shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. + cshInfo := 'set path=($path ' , stxBinDir , ')\'. + msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\' + with:stxBinDir asText allBold) withCRs. ]. - shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. - cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. - ]. + (stxLibDir ~= '/usr/local/lib/smalltalk' + and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[ + msg := msg , (resources string:'The library directory is not a standard ST/X library directory\("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk").\You have to define the %1 environment variable\as %2 before ST/X can be started.\' + with:'STX_LIBDIR' asText allBold + with:stxLibDir asText allBold) withCRs. + havePath ifFalse:[ + msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs. + ] ifTrue:[ + msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs. + ]. - shInfo notEmpty ifTrue:[ - '*********************************************************' errorPrintCR. - (resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR. - (resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR. - '' errorPrintCR. - shInfo withCRs errorPrintCR. - '' errorPrintCR. - (resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR. - '' errorPrintCR. - cshInfo withCRs errorPrintCR. - '' errorPrintCR. - '*********************************************************' errorPrintCR. + shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. + cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. + ]. + + shInfo notEmpty ifTrue:[ + '*********************************************************' errorPrintCR. + (resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR. + (resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR. + '' errorPrintCR. + shInfo withCRs errorPrintCR. + '' errorPrintCR. + (resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR. + '' errorPrintCR. + cshInfo withCRs errorPrintCR. + '' errorPrintCR. + '*********************************************************' errorPrintCR. + ]. ]. msg := msg , '\\Have fun using ST/X !!'. self information:msg withCRs. - " - STXInstaller new postInstall - " - - "Modified: 2.3.1997 / 13:28:18 / cg" + "Modified: / 25.2.1998 / 19:29:04 / cg" ! preInstall - "clobber the doc directory, to avoid copying cyclic symbolic links" + "clobber the doc directory, to avoid copying cyclic symbolic links. + Notice, the CD does not contain symlinks, but checking for them + allows installing from a development dir." |f| @@ -831,7 +1224,7 @@ STXInstaller new preInstall " - "Modified: 18.7.1996 / 22:10:42 / cg" + "Modified: / 25.2.1998 / 17:39:55 / cg" ! ! !STXInstaller class methodsFor:'documentation'!