cg@1503: "{ Package: 'stx:libtool2' }" cg@1503: cg@0: Object subclass:#STXInstaller cg@1279: instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir stxPkgDir stxDocDir stxTopDir cg@1279: installDocFiles installSourceFiles installSTCFiles cg@1279: installGoodyFiles fullDir actionPercentageHolder actionTextHolder cg@1279: commandTraceView resources dfHolder copyProcess installWhat' cg@1139: classVariableNames:'LastPartialDir LastFullDir' cg@0: poolDictionaries:'' cg@0: category:'eXept-tools' cg@0: ! cg@0: cg@0: cg@28: !STXInstaller class methodsFor:'startup'! cg@0: cg@0: open cg@0: ^ self new open cg@0: cg@11: " cg@11: STXInstaller open cg@11: " cg@1: ! ! cg@1: cg@1: !STXInstaller methodsFor:'defaults'! cg@1: cg@1: defaultBinDirs cg@1132: |dirs stxRel| cg@1: cg@1132: stxRel := self smalltalkRelease. cg@1: dirs := OrderedCollection new. cg@1119: cg@1119: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1132: dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel , '\bin'. cg@1132: dirs add:'c:\Programme\SmalltalkX\' , stxRel , '\bin'. cg@1132: dirs add:'c:\SmalltalkX\' , stxRel , '\bin'. cg@1119: ] ifFalse:[ cg@1132: dirs add:'/opt/smalltalk/' , stxRel , '/bin'. cg@1119: dirs add:'/usr/local/bin'. cg@1119: dirs add:'/usr/bin'. cg@1119: cg@1119: dirs add:(Filename homeDirectory constructString:'bin'). cg@1281: dirs add:((Filename homeDirectory construct:'stx') constructString:'bin'). cg@1119: dirs add:'/tmp/stxbin'. cg@1119: ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[ cg@1119: dirs add:'/home/stx/bin'. cg@1119: ]. cg@1119: ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[ cg@1119: dirs add:'/home2/stx/bin'. cg@1119: ]. cg@3: ]. cg@3: cg@3: "/ dirs := dirs select:[:path | cg@3: "/ |f| cg@3: "/ cg@3: "/ f := path asFilename. cg@3: "/ f exists and:[f isDirectory]]. cg@1117: ^ dirs "sort" cg@1: cg@1119: "Created: / 18.7.1996 / 19:43:00 / cg" cg@1132: "Modified: / 31.5.1999 / 12:11:48 / cg" cg@1: ! cg@1: cg@678: defaultFullDirs cg@678: |dirs| cg@678: cg@678: dirs := OrderedCollection new. cg@1515: cg@1515: dirs add:((Filename homeDirectory constructString:'stxDevelop')). cg@1515: dirs add:((Filename homeDirectory constructString:'develop')). cg@1515: dirs add:((Filename homeDirectory constructString:'work')). cg@1515: cg@1515: "/ ('/home' asFilename exists cg@1515: "/ and:['/home' asFilename isDirectory]) ifTrue:[ cg@1515: "/ dirs add:'/home/work'. cg@1515: "/ ]. cg@678: cg@1117: ^ dirs "sort" cg@678: cg@678: "Modified: / 18.7.1996 / 19:45:08 / cg" cg@678: "Created: / 25.2.1998 / 17:14:43 / cg" cg@678: ! cg@678: cg@1139: defaultInstDirs cg@1139: |dirs d stxRel| cg@1139: cg@1139: stxRel := self smalltalkRelease. cg@1139: dirs := OrderedCollection new. cg@1139: cg@1139: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1139: dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel. cg@1139: dirs add:'c:\Programme\SmalltalkX\' , stxRel. cg@1139: dirs add:'c:\SmalltalkX\' , stxRel. cg@1139: ] ifFalse:[ cg@1139: dirs add:'/opt/smalltalk/' , stxRel. cg@1139: dirs add:'/usr/local/smalltalkX'. cg@1139: cg@1139: d := (Filename homeDirectory constructString:'smalltalkX'). cg@1139: (dirs includes:d) ifFalse:[dirs add:d]. cg@1139: d := (Filename homeDirectory constructString:'stx'). cg@1139: (dirs includes:d) ifFalse:[dirs add:d]. cg@1139: d := '/tmp/stx'. cg@1139: (dirs includes:d) ifFalse:[dirs add:d]. cg@1139: ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[ cg@1139: d := '/home/stx'. cg@1139: (dirs includes:d) ifFalse:[dirs add:d]. cg@1139: ]. cg@1139: ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[ cg@1139: d := '/home2/stx'. cg@1139: (dirs includes:d) ifFalse:[dirs add:d]. cg@1139: ]. cg@1139: ]. cg@1139: cg@1139: "/ dirs := dirs select:[:path | cg@1139: "/ |f| cg@1139: "/ cg@1139: "/ f := path asFilename. cg@1139: "/ f exists and:[f isDirectory]]. cg@1139: ^ dirs "sort" cg@1139: cg@1139: "Created: / 18.7.1996 / 19:43:00 / cg" cg@1139: "Modified: / 31.5.1999 / 18:32:17 / cg" cg@1139: ! cg@1139: cg@24: defaultLibBinDirs cg@1132: |dirs stxRel| cg@24: cg@1132: stxRel := self smalltalkRelease. cg@24: dirs := OrderedCollection new. cg@1119: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1132: dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel , '\lib'. cg@1132: dirs add:'c:\Programme\SmalltalkX\' , stxRel , '\lib'. cg@1132: dirs add:'c:\SmalltalkX\' , stxRel , '\lib'. cg@1119: ] ifFalse:[ cg@1132: dirs add:'/opt/smalltalk/' , stxRel , '/lib'. cg@1119: dirs add:'/usr/local/lib'. cg@1119: dirs add:'/usr/lib'. cg@1119: dirs add:'/lib'. cg@1281: dirs add:(Filename homeDirectory constructString:'lib'). cg@24: cg@1281: dirs add:((Filename homeDirectory construct:'stx') constructString:'lib'). cg@1119: dirs add:'/tmp/stxlib'. cg@1119: dirs add:'/home/stx/lib'. cg@1119: dirs add:'/home2/stx/lib'. cg@1119: ]. cg@24: ^ dirs sort cg@24: cg@1119: "Created: / 18.7.1996 / 19:43:21 / cg" cg@1132: "Modified: / 31.5.1999 / 12:12:17 / cg" cg@24: ! cg@24: cg@1: defaultLibDirs cg@1132: |dirs stxRel| cg@1: cg@1132: stxRel := self smalltalkRelease. cg@1: dirs := OrderedCollection new. cg@1119: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1132: dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel , '\lib'. cg@1132: dirs add:'c:\Programme\SmalltalkX\' , stxRel , '\lib'. cg@1132: dirs add:'c:\SmalltalkX\' , stxRel , '\lib'. cg@1119: ] ifFalse:[ cg@1132: dirs add:'/opt/smalltalk/' , stxRel , '/lib'. cg@1119: dirs add:'/usr/local/lib/smalltalk'. cg@1119: dirs add:'/usr/lib/smalltalk'. cg@1281: dirs add:((Filename homeDirectory construct:'lib') constructString:'smalltalk'). cg@1281: dirs add:((Filename homeDirectory construct:'stx') constructString:'lib'). cg@1119: dirs add:'/tmp/stxlib'. cg@1119: dirs add:'/home/stx/lib'. cg@1119: dirs add:'/home2/stx/lib'. cg@1119: ]. cg@3: cg@3: "/ dirs := dirs select:[:path | cg@3: "/ |f| cg@3: "/ cg@3: "/ f := path asFilename. cg@3: "/ f exists and:[f isDirectory]]. cg@1117: ^ dirs "sort" cg@1: cg@1119: "Created: / 18.7.1996 / 19:43:21 / cg" cg@1132: "Modified: / 31.5.1999 / 12:12:30 / cg" cg@11: ! cg@0: cg@11: directoriesToMake cg@1138: |dirsToMake docDir docOnlineDir| cg@0: cg@11: dirsToMake := OrderedCollection new. cg@1010: installWhat == #full ifTrue:[ cg@678: dirsToMake add:fullDir. cg@678: ] ifFalse:[ cg@678: dirsToMake add:stxBinDir. cg@678: dirsToMake add:stxLibDir. cg@1281: stxLibDir ~= stxLibBinDir ifTrue:[ cg@1281: dirsToMake add:stxLibBinDir. cg@1281: ]. cg@1279: dirsToMake add:stxDocDir. cg@1279: docOnlineDir := stxDocDir asFilename construct:'online'. cg@1279: dirsToMake add:docOnlineDir name. cg@1279: dirsToMake add:(docOnlineDir constructString:'english'). cg@1138: dirsToMake add:(docOnlineDir constructString:'german'). cg@1281: installDocFiles ifTrue:[ cg@1281: dirsToMake add:(docOnlineDir constructString:'french'). cg@1281: dirsToMake add:(docOnlineDir constructString:'italian'). cg@1281: ] cg@678: ]. cg@678: ^ dirsToMake cg@0: cg@1138: "Modified: / 31.5.1999 / 17:52:03 / cg" cg@11: ! cg@11: cg@73: listOfOptionalPackages cg@73: ^ #( cg@73: 'libDB' cg@73: 'clients/CBrowser' cg@73: 'libcompat' cg@73: 'libxt' cg@73: cg@73: cg@73: "/ mhmh - these should not be needed here ... cg@73: cg@73: 'projects/smalltalk/bitmaps/javaImages' cg@73: 'doc/online/english/overview/icons' cg@73: ) cg@73: cg@73: "Created: 2.3.1997 / 12:39:59 / cg" cg@73: "Modified: 2.3.1997 / 13:24:41 / cg" cg@73: ! cg@73: cg@1117: smalltalkRelease cg@1117: ^ Smalltalk majorVersionNr printString cg@1117: , '.' , Smalltalk minorVersionNr printString cg@1117: , '.' , Smalltalk revisionNr printString. cg@1117: ! cg@1117: cg@1279: specOfCommonFilesToCopy cg@1279: |fileSpec| cg@1279: cg@1279: fileSpec := #( cg@1279: "/ name destination subDir required mode cg@1279: ( 'projects/smalltalk/include' #lib nil true '644' ) cg@1279: ( 'projects/smalltalk/*.rc' #lib nil true '644' ) cg@1519: ( 'projects/smalltalk/*.wsp' #lib nil true '644' ) cg@1368: ( 'projects/smalltalk/banner*.xpm' #lib nil true '644' ) cg@1279: ( 'projects/smalltalk/patches' #lib nil true '644' ) cg@1284: ( 'COPYRIGHT' nil nil true '644' ) cg@1519: ( 'RELEASE' nil nil true '644' ) cg@1519: ( 'doc/online/german/LICENCE_STX.html' nil 'doc/online/german' true '644' ) cg@1519: ( 'doc/online/english/LICENCE_STX.html' nil 'doc/online/english' true '644' ) cg@1284: ( 'doc/online/german/LICENCE_DEMO_STX.html' nil 'doc/online/german' true '644' ) cg@1284: ( 'doc/online/english/LICENCE_DEMO_STX.html' nil 'doc/online/english' true '644' ) cg@1279: ). cg@1279: cg@1279: installDocFiles ifTrue:[ cg@1279: fileSpec := fileSpec , #( cg@1281: ( 'doc' nil nil false '644' ) cg@1279: ). cg@1279: ]. cg@1279: cg@1279: installSTCFiles ifTrue:[ cg@1279: fileSpec := fileSpec , #( cg@1279: ( 'include' #lib nil false '644' ) cg@1279: ( 'configurations' #lib nil false '644' ) cg@1279: ( 'configurations/PACKS' #lib 'configurations' false '644' ) cg@1279: ( 'configurations/my*' #lib 'configurations' false '644' ) cg@1279: ( 'configurations/vendor*' #lib 'configurations' false '644' ) cg@1279: ( 'rules' #lib nil false '644' ) cg@1279: ). cg@1279: ]. cg@1279: cg@1279: installGoodyFiles ifTrue:[ cg@1279: fileSpec := fileSpec , #( cg@1281: ( 'goodies/*.st' #pkg 'stx/goodies/source' false '644' ) cg@1281: ( 'goodies/*.chg' #pkg 'stx/goodies/source' false '644' ) cg@1279: ). cg@1279: ]. cg@1279: cg@1279: cg@1279: ^ fileSpec cg@1279: cg@1279: "Created: / 2.5.1999 / 13:17:37 / cg" cg@1284: "Modified: / 24.12.1999 / 01:16:42 / cg" cg@1279: ! cg@1279: cg@11: specOfFilesToCopy cg@1119: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1119: ^ self specOfWindowsFilesToCopy cg@1119: ]. cg@1119: ^ self specOfUnixFilesToCopy cg@1119: cg@1119: "Modified: / 2.5.1999 / 13:17:59 / cg" cg@1119: ! cg@1119: cg@1119: specOfUnixFilesToCopy cg@11: |fileSpec| cg@0: cg@1279: fileSpec := self specOfCommonFilesToCopy. cg@1279: cg@1279: fileSpec := fileSpec , #( cg@27: "/ name destination subDir required mode cg@12: ( 'projects/smalltalk/smalltalk' #bin nil true '755' ) cg@27: ( 'projects/smalltalk/stx' #bin nil true '755' ) cg@1281: ( 'librun/librun.so' #lib 'lib' true '644' ) cg@5: ). cg@0: cg@5: installSTCFiles ifTrue:[ cg@5: fileSpec := fileSpec , #( cg@24: ( 'stc/stc' #bin nil false '755' ) cg@24: ( 'rules/stmkmp' #bin nil false '755' ) cg@24: ( 'rules/stmkmf' #bin nil false '755' ) cg@1281: ( 'configurations/COMMON' #lib 'configurations' false '644' ) cg@24: ( 'configurations/PACKS' #lib 'configurations' false '644' ) cg@24: ( 'configurations/my*' #lib 'configurations' false '644' ) cg@24: ( 'configurations/vendor*' #lib 'configurations' false '644' ) cg@5: cg@276: ( 'support/VGL/vogl/src/libvogl.*' #lib 'lib' false '644' ) cg@276: ( 'support/VGL/vogl/src/*.h' #lib 'include' false '644' ) cg@276: ( 'support/DLD/dld-3.2.5/libdld.*' #lib 'lib' false '644' ) cg@276: cg@1281: ( 'goodies/persistency/db-1.6/PORT/libdb.*' #libBin 'lib' false '644' ) cg@0: cg@1281: "/ ( 'librun/librun.o' #libBin nil false '644' ) cg@1281: "/ ( 'librun/librun.a' #libBin nil false '644' ) cg@5: ). cg@5: ]. cg@0: cg@5: installGoodyFiles ifTrue:[ cg@5: fileSpec := fileSpec , #( cg@1281: ( 'goodies/rdoit/rdoit' #bin nil false '755' ) cg@1707: ( 'goodies/xml/indelv/abbrev.stc' #pkg 'stx/goodies/xml/indelv' true ) cg@1281: ). cg@1281: ] ifFalse:[ cg@1281: fileSpec := fileSpec , #( cg@1281: ( 'goodies/persistency/libdbase.so' #pkg 'stx/goodies/persistency' true '644' ) cg@5: ). cg@5: ]. cg@0: cg@11: ^ fileSpec cg@11: cg@1119: "Modified: / 30.4.1999 / 18:02:22 / cg" cg@1119: "Created: / 2.5.1999 / 13:17:37 / cg" cg@1119: ! cg@1119: cg@1119: specOfWindowsFilesToCopy cg@1119: |fileSpec| cg@1119: cg@1279: fileSpec := self specOfCommonFilesToCopy. cg@1279: cg@1279: fileSpec := fileSpec , #( cg@1119: "/ name destination subDir required cg@1132: ( 'projects\smalltalk\smalltalk.bat' #bin nil true ) cg@1132: ( 'projects\smalltalk\stx.exe' #bin nil true ) cg@1503: ( 'projects\smalltalk\winstx.exe' #bin nil true ) cg@1132: ( 'projects\smalltalk\stxspawn.exe' #bin nil true ) cg@1279: ( 'projects\smalltalk\*.dll' #bin nil true ) cg@1119: ). cg@1119: cg@1119: installSTCFiles ifTrue:[ cg@1119: fileSpec := fileSpec , #( cg@1132: ( 'projects\smalltalk\stc.exe' #bin nil false ) cg@1132: ( 'libbc\*.lib' #lib nil false ) cg@1279: ( 'rules' #lib nil false ) cg@1119: ). cg@1119: ]. cg@1119: cg@1119: installGoodyFiles ifTrue:[ cg@1119: fileSpec := fileSpec , #( cg@1279: ( 'goodies/rdoit/rdoit.exe' #bin nil false ) cg@1119: ). cg@1119: ]. cg@1119: cg@1119: ^ fileSpec cg@1119: cg@1119: "Created: / 2.5.1999 / 13:23:06 / cg" cg@1503: "Modified: / 16.10.2001 / 12:25:58 / cg" cg@11: ! ! cg@11: cg@11: !STXInstaller methodsFor:'installing'! cg@11: cg@1519: add:specEntry toFileSpec:fileSpec cg@1519: (specEntry first startsWith:'./') ifTrue:[ cg@1519: specEntry at:1 put:(specEntry first copyFrom:3). cg@1519: ]. cg@1519: (specEntry first startsWith:'.\') ifTrue:[ cg@1519: specEntry at:1 put:(specEntry first copyFrom:3). cg@1519: ]. cg@1519: (fileSpec includes:specEntry) ifFalse:[ cg@1519: fileSpec add:specEntry cg@1519: ] ifTrue:[ cg@1519: "/ self halt cg@1519: ] cg@1519: ! cg@1519: cg@1281: addFilesToSpec:fileSpec relativeTo:rel fromINSTALLSpec:f cg@1281: |s entry t cond dst| cg@1281: cg@1281: s := f asFilename readStream. cg@1281: s isNil ifTrue:[^ self]. cg@1281: [s atEnd] whileFalse:[ cg@1281: entry := s nextLine. cg@1281: (entry startsWith:$#) ifFalse:[ cg@1281: t := entry asCollectionOfWords. cg@1281: t size >= 2 ifTrue:[ cg@1281: cond := t at:3 ifAbsent:nil. cg@1281: (cond ~= 'optionalSource' cg@1281: or:[installSourceFiles]) ifTrue:[ cg@1281: ((rel startsWith:'goodies/') not cg@1281: or:[installGoodyFiles]) ifTrue:[ cg@1281: dst := t at:2. cg@1281: (dst startsWith:'packages/stx/') ifTrue:[ cg@1519: self add:(Array cg@1281: with:(rel asFilename constructString:(t at:1)) cg@1281: with:#pkg cg@1281: with:('stx' asFilename constructString:(dst copyFrom:'packages/stx/' size+1)) cg@1519: with:true) cg@1519: toFileSpec:fileSpec. cg@1281: ] ifFalse:[ cg@1519: ((dst = 'bin') or:[dst startsWith:'bin/']) ifTrue:[ cg@1519: (dst = 'bin') ifTrue:[ cg@1519: self add:(Array cg@1519: with:(rel asFilename constructString:(t at:1)) cg@1519: with:#bin cg@1519: with:nil cg@1519: with:true) cg@1519: toFileSpec:fileSpec. cg@1519: ] ifFalse:[ cg@1519: self add:(Array cg@1519: with:(rel asFilename constructString:(t at:1)) cg@1519: with:#bin cg@1519: with:(dst copyFrom:'bin/' size+1) cg@1519: with:true) cg@1519: toFileSpec:fileSpec. cg@1519: ]. cg@1519: ] ifFalse:[ cg@1519: ((dst = 'lib') or:[dst startsWith:'lib/']) ifTrue:[ cg@1519: (dst = 'lib') ifTrue:[ cg@1519: self add:(Array cg@1519: with:(rel asFilename constructString:(t at:1)) cg@1519: with:#lib cg@1519: with:nil cg@1519: with:true) cg@1519: toFileSpec:fileSpec. cg@1519: ] ifFalse:[ cg@1519: self add:(Array cg@1519: with:(rel asFilename constructString:(t at:1)) cg@1519: with:#lib cg@1519: with:(dst copyFrom:'lib/' size+1) cg@1519: with:true) cg@1519: toFileSpec:fileSpec. cg@1519: ] cg@1519: ] ifFalse:[ cg@1519: self halt:'unhandled destination: ' , dst. cg@1519: ] cg@1281: ] cg@1281: ] cg@1281: ] cg@1281: ]. cg@1281: ]. cg@1281: ]. cg@1281: ]. cg@1281: s close. cg@1281: ! cg@1281: cg@790: changeWritability cg@791: |msg| cg@790: cg@1010: installWhat == #full ifTrue:[ cg@792: msg := (resources array:#('ST/X Installation' '' 'making target dir writable' '' '' '')) asStringCollection. cg@790: cg@792: commandTraceView showCR:(resources string:'making target dir writable ...'). cg@792: commandTraceView endEntry. cg@790: OperatingSystem executeCommand:('(cd ' , fullDir , ' ; find . -exec chmod u+w {} \;)'). cg@790: ]. cg@790: cg@791: "Created: / 17.7.1996 / 15:24:19 / cg" cg@792: "Modified: / 20.4.1998 / 15:40:00 / cg" cg@790: ! cg@790: cg@11: copyFiles cg@1132: |msg fileSpec filesToCopy numFiles nDone cmd topDir topDirPrefix| cg@1132: cg@1132: msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection. cg@678: cg@1132: OperatingSystem isUNIXlike ifTrue:[ cg@1132: topDir := '../..'. cg@1132: topDirPrefix := '../../'. cg@1132: ] ifFalse:[ cg@1132: topDir := '..\..'. cg@1132: topDirPrefix := '..\..\'. cg@1132: ]. cg@678: cg@1010: installWhat == #full ifTrue:[ cg@1515: "/ MUST be under stx (for packagePath stuff) cg@1516: fullDir asFilename baseName ~= 'stx' ifTrue:[ cg@1516: fullDir := fullDir asFilename constructString:'stx'. cg@1516: ]. cg@1517: fullDir asFilename recursiveMakeDirectory. cg@1517: fullDir asFilename exists ifFalse:[ cg@1517: self warn:'Oops - failed to create directory: ' , fullDir. cg@1517: ^ false cg@1517: ]. cg@1516: cg@678: msg at:4 put:(' all from CD' asText allBold). cg@678: msg at:6 put:' ' , (fullDir asText allBold). cg@678: actionTextHolder value:nil. cg@678: actionTextHolder value:msg. cg@11: cg@1512: actionPercentageHolder value:-1. cg@1512: OperatingSystem isUNIXlike ifTrue:[ cg@1516: cmd := '(cd ' , topDir , '/doc/online ; find . -type s -exec rm {} \; )'. cg@1516: commandTraceView showCR:'removing symbolic links ...'. cg@1516: commandTraceView endEntry. cg@1516: self executeCommandAndShowOutput:cmd emphasize:false. cg@1518: cg@1512: cmd := '(cd ' , topDir , ' ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'. cg@1512: commandTraceView showCR:'copying ...'. cg@1512: commandTraceView endEntry. cg@1512: cmd := cmd , ' 2>&1' . cg@678: cg@1512: self executeCommandAndShowOutput:cmd emphasize:false. cg@1516: cg@1516: cmd := '(cd ' , fullDir , '/doc/online ; make )'. cg@1516: commandTraceView showCR:'creating symbolic links ...'. cg@1516: commandTraceView endEntry. cg@1516: self executeCommandAndShowOutput:cmd emphasize:false. cg@1516: cg@1512: ] ifFalse:[ cg@1512: fullDir asFilename exists ifFalse:[ cg@1512: commandTraceView showCR:(resources string:'creating %1 ...' with:fullDir asFilename pathName). cg@1512: commandTraceView endEntry. cg@1512: OperatingSystem recursiveCreateDirectory:fullDir asFilename pathName cg@1512: ]. cg@1512: self recursiveCopy:(topDir , '\*') to:fullDir. cg@1512: ]. cg@1512: actionPercentageHolder value:100. cg@678: ^ true cg@678: ]. cg@11: cg@1281: fileSpec := self specOfFilesToCopy asOrderedCollection. cg@1281: cg@1281: actionPercentageHolder value:0. cg@1281: "/ search for INSTALL.files specs, and add to list ... cg@1281: actionTextHolder value:nil. cg@1281: actionTextHolder value:(resources array:#('ST/X Installation' '' 'searching for packages to install...' '' '' '')) asStringCollection. cg@1281: cg@1281: topDir asFilename recursiveDirectoryContentsDo:[:f | cg@1281: f asFilename baseName = 'INSTALL.files' ifTrue:[ cg@1281: self addFilesToSpec:fileSpec relativeTo:f asFilename directoryName fromINSTALLSpec:(topDir asFilename construct:f). cg@1281: ] cg@1281: ]. cg@11: cg@0: filesToCopy := OrderedCollection new. cg@0: cg@0: fileSpec do:[:entry | cg@8: |fileNames dest subDir required destDir| cg@0: cg@8: fileNames := entry at:1. cg@0: dest := entry at:2. cg@0: subDir := entry at:3. cg@0: required := entry at:4. cg@0: cg@0: dest == #bin ifTrue:[ cg@0: destDir := stxBinDir cg@0: ] ifFalse:[ cg@24: dest == #libBin ifTrue:[ cg@24: destDir := stxLibBinDir cg@24: ] ifFalse:[ cg@1279: dest == #pkg ifTrue:[ cg@1279: destDir := stxPkgDir cg@1279: ] ifFalse:[ cg@1279: dest == nil ifTrue:[ cg@1279: destDir := stxTopDir cg@1279: ] ifFalse:[ cg@1279: destDir := stxLibDir cg@1279: ] cg@1279: ] cg@24: ] cg@0: ]. cg@0: cg@0: destDir := destDir asFilename. cg@0: subDir notNil ifTrue:[ cg@0: destDir := destDir construct:subDir cg@0: ]. cg@0: cg@8: filesToCopy add:(fileNames -> destDir pathName) cg@0: ]. cg@0: cg@0: numFiles := filesToCopy size. cg@0: nDone := 0. cg@0: cg@0: filesToCopy do:[:entry | cg@678: |fileName destDir cmd| cg@0: cg@0: fileName := entry key. cg@0: destDir := entry value. cg@0: cg@8: ((fileName includes:$*) cg@1132: or:[(topDirPrefix , fileName) asFilename exists])ifTrue:[ cg@4: actionPercentageHolder value:(nDone / numFiles * 100) rounded. cg@0: cg@4: msg at:4 put:' ' , (fileName asText allBold). cg@4: msg at:6 put:' ' , (destDir asText allBold). cg@4: actionTextHolder value:nil. cg@4: actionTextHolder value:msg. cg@4: cg@73: ((fileName includes:$*) not cg@1136: and:[(topDirPrefix , fileName) asFilename exists not]) ifTrue:[ cg@73: (self listOfOptionalPackages includes:fileName) ifFalse:[ cg@117: commandTraceView showCR:('cannot copy ' , fileName , ' - not included in distribution'). cg@117: commandTraceView endEntry. cg@73: ] cg@73: ] ifFalse:[ cg@1136: destDir asFilename exists ifFalse:[ cg@1136: commandTraceView showCR:(resources string:'creating %1 ...' with:destDir asFilename pathName). cg@1136: commandTraceView endEntry. cg@1136: OperatingSystem recursiveCreateDirectory:destDir asFilename pathName cg@1136: ]. cg@1132: self recursiveCopy:(topDirPrefix , fileName) to:destDir. cg@73: ] cg@1: ]. cg@0: cg@0: nDone := nDone + 1 cg@0: ]. cg@0: cg@0: ^ true cg@0: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@678: "Created: / 17.7.1996 / 15:16:20 / cg" cg@1138: "Modified: / 31.5.1999 / 18:07:33 / cg" cg@0: ! cg@0: cg@0: createDirectories cg@0: |msg dirsToMake numDirs nDone| cg@0: cg@11: msg := (resources array:#('ST/X Installation' '' 'creating directory:' '' '' '')) asStringCollection. cg@0: cg@11: dirsToMake := self directoriesToMake. cg@0: cg@0: numDirs := dirsToMake size. cg@0: nDone := 0. cg@0: cg@0: dirsToMake do:[:dirName | cg@0: |d errMsg stop box| cg@0: cg@0: actionPercentageHolder value:(nDone / numDirs * 100) rounded. cg@0: cg@4: msg at:4 put:' ' , (dirName asText allBold). cg@0: actionTextHolder value:nil. cg@0: actionTextHolder value:msg. cg@0: cg@0: d := dirName asFilename. cg@0: cg@11: commandTraceView showCR:(resources string:'creating %1 ...' with:d pathName). cg@117: commandTraceView endEntry. cg@4: cg@0: d exists ifFalse:[ cg@0: OperatingSystem recursiveCreateDirectory:d pathName cg@0: ]. cg@0: cg@0: d exists ifFalse:[ cg@1279: errMsg := (resources string:'failed to create directory: %1\\Please check your permissions.' with:dirName) withCRs. cg@0: stop := true cg@0: ] ifTrue:[ cg@0: d isDirectory ifFalse:[ cg@11: errMsg := resources string:'not a directory: %1' with:dirName. cg@0: stop := true cg@0: ] ifTrue:[ cg@0: (d isReadable cg@0: and:[d isWritable]) ifFalse:[ cg@11: errMsg := resources string:'no read/write access to directory: %1' with:dirName. cg@0: stop := false cg@0: ] ifTrue:[ cg@0: errMsg := nil cg@0: ] cg@0: ] cg@0: ]. cg@0: cg@0: errMsg notNil ifTrue:[ cg@0: box := WarningBox new. cg@0: box title:errMsg. cg@0: box showAtPointerNotCovering:(WindowGroup activeGroup topViews first). cg@1: stop ifTrue:[^ false]. cg@0: ]. cg@0: cg@0: Delay waitForSeconds:0.25. cg@0: nDone := nDone + 1. cg@0: ]. cg@0: ^ true cg@0: cg@0: "Created: 17.7.1996 / 15:24:19 / cg" cg@117: "Modified: 22.5.1997 / 15:06:41 / cg" cg@19: ! cg@19: cg@1134: createRegistryEntries cg@1134: |release msg k| cg@1134: cg@1134: msg := (resources array:#('ST/X Installation' '' 'creating registry entries' '' '' '')) asStringCollection. cg@1134: actionTextHolder value:nil. cg@1134: actionTextHolder value:msg. cg@1134: cg@1134: commandTraceView showCR:(resources string:'creating registry entries...'). cg@1134: commandTraceView endEntry. cg@1134: cg@1134: release := self smalltalkRelease. cg@1134: cg@1134: k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'. cg@1282: k isNil ifTrue:[ cg@1282: self warn:'cannot update registry under HKEY_LOCAL_MACHINE\Software\eXept'. cg@1282: ^ self. cg@1282: ]. cg@1282: cg@1134: k := k createSubKeyNamed:'eXept'. cg@1134: k := k createSubKeyNamed:'Smalltalk/X'. cg@1134: k valueNamed:'CurrentVersion' put:release. cg@1134: cg@1134: k := k createSubKeyNamed:release. cg@1134: k valueNamed:'LibDir' put:stxLibDir. cg@1134: k valueNamed:'BinDir' put:stxBinDir. cg@1279: k valueNamed:'DocDir' put:stxDocDir. cg@1279: k valueNamed:'PackageDirPath' put:stxPkgDir. cg@1134: cg@1282: "Modified: / 23.12.1999 / 22:21:18 / cg" cg@1134: ! cg@1134: cg@19: createSymbolicLinks cg@1367: |msg dirsToMake numDirs nDone languages cmd| cg@19: cg@1132: OperatingSystem isUNIXlike ifFalse:[^ self]. cg@1132: cg@19: msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection. cg@1134: actionTextHolder value:nil. cg@1134: actionTextHolder value:msg. cg@19: cg@1010: installWhat == #full ifTrue:[ cg@1511: commandTraceView showCR:(resources string:'setting up symbolic links in doc...'); endEntry. cg@678: OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)'). cg@1511: cg@1511: commandTraceView showCR:(resources string:'setting up symbolic links in projects/smalltalk...'); endEntry. cg@1511: OperatingSystem executeCommand:('(cd ' , fullDir , '/projects/smalltalk ; ln -s ../../lib*/*.so .)'). cg@1511: OperatingSystem executeCommand:('(cd ' , fullDir , '/projects/smalltalk ; ln -s ../../goodies/*/*.so .)'). cg@1508: ^ self. cg@1508: ]. cg@1367: "/ OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)'). cg@1281: cg@1511: commandTraceView showCR:(resources string:'setting up symbolic links in lib...'); endEntry. cg@1281: cg@1508: #( cg@1508: 'libbasic/libbasic.so' cg@1508: 'libbasic2/libbasic2.so' cg@1508: 'libbasic3/libbasic3.so' cg@1508: 'libcomp/libcomp.so' cg@1508: 'libboss/libboss.so' cg@1508: 'libview/*.so' cg@1508: 'libview2/libview2.so' cg@1508: 'libwidg/libwidg.so' cg@1508: 'libwidg2/libwidg2.so' cg@1508: 'libwidg3/libwidg3.so' cg@1508: 'libhtml/libhtml.so' cg@1508: 'libui/libui.so' cg@1508: 'libtool/libtool.so' cg@1508: 'libtool2/libtool2.so' cg@1508: 'goodies/persistency/libdbase.so' cg@1508: ) do:[:src | |cmd| cg@1508: cmd := '(cd ' , stxLibDir , '/lib ; ln -s ../../packages/stx/' , src , ' . )'. cg@1508: commandTraceView showCR:cmd; endEntry. cg@1508: OperatingSystem executeCommand:cmd. cg@678: ]. cg@19: cg@1367: installDocFiles ifTrue:[ cg@1367: msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection. cg@1367: actionTextHolder value:nil. cg@1367: actionTextHolder value:msg. cg@1367: cg@1367: commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...'); endEntry. cg@1367: cg@1367: languages := #( cg@1367: 'english' cg@1367: 'german' cg@1367: 'french' cg@1367: 'italian' cg@1367: 'spanish' cg@1367: 'japanese' cg@1367: ). cg@1367: languages := languages select:[:l | (stxDocDir , '/online/' , l) asFilename exists]. cg@1367: cg@1367: languages do:[:thisLang | cg@1367: |langDir| cg@1367: cg@1367: langDir := stxDocDir , '/online/' , thisLang. cg@1367: languages do:[:otherLang | cg@1367: otherLang ~= thisLang ifTrue:[ cg@1367: cmd := '(cd ' , langDir , ' ; ln -s ../' , otherLang , ' .)'. cg@1367: commandTraceView showCR:cmd; endEntry. cg@1367: OperatingSystem executeCommand:cmd. cg@1367: ] cg@1367: ]. cg@1367: cg@1367: cmd := '(cd ' , langDir , ' ; ln -s ../icons .)'. cg@1367: commandTraceView showCR:cmd; endEntry. cg@1367: OperatingSystem executeCommand:cmd. cg@1367: cg@1367: cmd := '(cd ' , langDir , ' ; ln -s ../pictures .)'. cg@1367: commandTraceView showCR:cmd; endEntry. cg@1367: OperatingSystem executeCommand:cmd. cg@1367: ] cg@1367: ] cg@678: "Created: / 17.7.1996 / 15:24:19 / cg" cg@1134: "Modified: / 31.5.1999 / 14:46:36 / cg" cg@678: ! cg@678: cg@678: executeCommandAndShowOutput:cmd cg@1508: ^ self executeCommandAndShowOutput:cmd emphasize:true cg@1508: ! cg@1508: cg@1508: executeCommandAndShowOutput:cmd emphasize:doEmphasize cg@678: |doneSemaphore line p| cg@678: cg@1119: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1119: ^ self cg@1119: ]. cg@1119: cg@678: doneSemaphore := Semaphore new. cg@678: cg@678: copyProcess := [ cg@678: cg@678: p := PipeStream readingFrom:cmd. cg@678: p isNil ifTrue:[ cg@678: self warn:('command error. Could not execute:\\' , cmd) withCRs. cg@678: ] ifFalse:[ cg@678: [ cg@678: [p atEnd] whileFalse:[ cg@678: (p readWaitWithTimeout:0.1) ifFalse:[ cg@678: line := p nextLine. cg@678: (line notNil and:[line notEmpty]) ifTrue:[ cg@1508: doEmphasize ifTrue:[ cg@1508: line := line asText emphasizeAllWith:(#color->Color red). cg@1508: ]. cg@1508: commandTraceView showCR:(' ' , line). cg@678: commandTraceView endEntry. cg@678: ] cg@678: ] cg@678: ]. cg@678: p close. cg@678: ] valueOnUnwindDo:[ cg@678: p shutDown cg@678: ] cg@678: ]. cg@678: doneSemaphore signal. cg@678: copyProcess := nil. cg@678: ] forkAt:4. cg@678: cg@678: doneSemaphore wait. cg@678: cg@678: "Created: / 25.2.1998 / 17:46:06 / cg" cg@1119: "Modified: / 30.4.1999 / 18:00:43 / cg" cg@73: ! cg@73: cg@73: outputInitialMessage cg@1279: ^ self. cg@1279: cg@73: #( cg@73: 'Notice:' cg@73: '' cg@73: 'During the installation, you may get error messages' cg@73: 'complaining that some files where not found' cg@73: 'and could therefore not be copied.' cg@73: ) do:[:line | cg@73: commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). cg@73: commandTraceView endEntry. cg@73: ]. cg@73: cg@73: Delay waitForSeconds:2. cg@73: cg@73: #( cg@73: '' cg@73: 'This is normal behavior; since the CD may contain' cg@73: 'broken symbolic links to non-existing packages' cg@73: 'which are either not contained on your ordered' cg@276: 'package (i.e. non-commercial) or are not required' cg@276: 'for your architecture (and therefore not contained' cg@276: 'on the CD).' cg@276: '' cg@73: ) do:[:line | cg@73: commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). cg@73: commandTraceView endEntry. cg@73: ]. cg@73: cg@73: Delay waitForSeconds:2. cg@73: cg@73: #( cg@73: '' cg@73: 'Please excuse this inconvenience.' cg@73: '' cg@73: ) do:[:line | cg@73: commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). cg@73: commandTraceView endEntry. cg@73: ]. cg@73: cg@73: Delay waitForSeconds:2. cg@73: cg@73: "Created: 2.3.1997 / 12:49:52 / cg" cg@276: "Modified: 8.8.1997 / 17:47:06 / cg" cg@1132: ! cg@1132: cg@1279: recursiveCopy:src to:dst cg@1281: self recursiveCopy:src to:dst print:true cg@1281: ! cg@1281: cg@1281: recursiveCopy:src to:dst print:doPrint cg@1282: |cmd srcBaseName srcF dstF d| cg@1132: cg@1279: srcF := src asFilename. cg@1279: dstF := dst asFilename. cg@1282: mb@1779: srcF directory exists ifFalse:[ mb@1779: ^ self mb@1779: ]. mb@1779: cg@1514: srcBaseName := srcF baseName. cg@1514: (srcBaseName startsWith:'.#') ifTrue:[^ self]. cg@1514: cg@1514: (#( cg@1514: 'CVS' cg@1514: 'not_delivered' cg@1514: '.cvsignore' cg@1514: '.dir.info' cg@1514: ) includes:srcBaseName) ifTrue:[ cg@1514: ^ self cg@1514: ]. cg@1282: cg@1514: srcBaseName includesMatchCharacters ifTrue:[ cg@1514: doPrint ifTrue:[ cg@1514: OperatingSystem isUNIXlike ifTrue:[ cg@1514: commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). cg@1279: ] ifFalse:[ cg@1514: commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). cg@1514: ]. cg@1514: commandTraceView endEntry. cg@1514: ]. mb@1779: cg@1514: (srcF directory directoryContents ? #()) do:[:fileName | cg@1514: (srcBaseName match:fileName) ifTrue:[ cg@1514: (#( cg@1514: 'CVS' cg@1514: 'not_delivered' cg@1514: ) includes:fileName) ifFalse:[ cg@1514: self cg@1514: recursiveCopy:(srcF directory construct:fileName) cg@1514: to:dstF cg@1514: print:doPrint cg@1132: ] cg@1132: ] cg@1132: ] cg@1514: ] ifFalse:[ cg@1514: srcF isDirectory ifFalse:[ cg@1514: (dstF exists and:[dstF isDirectory]) ifTrue:[ cg@1514: dstF := dstF construct:srcBaseName. cg@1514: ]. cg@1514: "/ special check for windows bug cg@1514: "/ (lists trans.tbl files, but wont find it later) cg@1514: srcF exists ifTrue:[ cg@1514: Object errorSignal handle:[:ex | cg@1514: commandTraceView showCR:('*** Error: ' , ex errorString) cg@1514: ] do:[ cg@1514: srcF copyTo:dstF. cg@1514: ] cg@1514: ]. cg@1514: OperatingSystem isUNIXlike ifTrue:[ cg@1514: srcF isExecutable ifTrue:[ cg@1514: dstF makeExecutableForAll cg@1514: ] cg@1514: ] cg@1514: ] ifTrue:[ cg@1514: doPrint ifTrue:[ cg@1514: OperatingSystem isUNIXlike ifTrue:[ cg@1514: commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). cg@1514: ] ifFalse:[ cg@1514: commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). cg@1514: ]. cg@1514: commandTraceView endEntry. cg@1514: ]. cg@1514: d := dstF asFilename construct:srcBaseName. cg@1514: (d exists) ifFalse:[ cg@1514: d makeDirectory. cg@1514: ]. cg@1514: (srcF directoryContents ? #()) do:[:fileName | cg@1514: self recursiveCopy:(srcF construct:fileName) cg@1514: to:d cg@1514: print:doPrint cg@1514: ] cg@1514: ] cg@1514: ] cg@1132: cg@1132: "Created: / 31.5.1999 / 13:05:09 / cg" cg@1369: "Modified: / 3.3.2000 / 01:51:54 / cg" cg@1367: ! cg@1367: cg@1367: removeMakefilesInDoc cg@1367: |cmd msg| cg@1367: cg@1367: OperatingSystem isUNIXlike ifFalse:[ ^ self ]. cg@1509: installWhat == #full ifTrue:[^ self]. cg@1367: cg@1367: installDocFiles ifTrue:[ cg@1367: msg := (resources array:#('ST/X Installation' '' 'removing useless makefiles in doc' '' '' '')) asStringCollection. cg@1367: actionTextHolder value:nil. cg@1367: actionTextHolder value:msg. cg@1367: cg@1367: commandTraceView showCR:(resources string:'removing useless makefiles in doc ...'); endEntry. cg@1367: cg@1367: #( cg@1367: 'Make.proto' cg@1367: 'nt.mak' cg@1367: 'vms.mak' cg@1367: 'Makefile' cg@1367: ) do:[:toRemove | cg@1367: cmd := '(cd ' , stxDocDir , ' ; find . -name ''' , toRemove , ''' -exec rm {} \; )'. cg@1367: cg@1367: commandTraceView showCR:cmd; endEntry. cg@1367: OperatingSystem executeCommand:cmd. cg@1367: ] cg@1367: ] cg@0: ! ! cg@0: cg@0: !STXInstaller methodsFor:'startup'! cg@0: cg@0: askAndInstall cg@0: "/ check, if we are in the projects/smalltalk directory cg@0: cg@1119: |answer here| cg@678: cg@11: resources := ResourcePack for:self class. cg@11: cg@1132: (((here := Filename currentDirectory pathName) endsWith:'projects/smalltalk') not cg@1132: and:[(here asLowercase endsWith:'stx\binbc') not cg@1132: and:[(here asLowercase endsWith:'projects\smalltalk') not cg@1132: ]]) ifTrue:[ cg@1150: "/ double - check if some of my expected files exists here ... cg@1151: ('../../libbasic' asFilename exists cg@1151: and:['../../libbasic' asFilename isDirectory]) ifTrue:[ cg@1150: self warn:(resources string:'Oops - current directories name seems to not end with ''/projects/smalltalk''\\Assume its OK.' withCRs). cg@1150: ] ifFalse:[ cg@1150: self warn:(resources string:'must be in the ''projects/smalltalk'' directory'). cg@1150: ^ self cg@1150: ] cg@0: ]. cg@0: cg@678: answer := self askForFullInstallation. cg@678: answer ifFalse:[^ self]. cg@678: cg@0: [self askForDestination] whileTrue:[ cg@73: self checkForExistingInstallationAndConfirm ifTrue:[ cg@73: self preInstall. cg@73: self doInstall ifTrue:[ cg@73: self postInstall. cg@73: ^ self cg@73: ]. cg@73: (self confirm:(resources string:'installation failed or aborted - retry ?')) cg@73: ifFalse:[ cg@73: ^ self cg@73: ] cg@0: ] cg@0: ]. cg@0: cg@1132: "Modified: / 31.5.1999 / 12:04:14 / cg" cg@0: ! cg@0: cg@0: askForDestination cg@0: "open a dialog to enter destination directories" cg@0: cg@1010: installWhat == #full ifTrue:[ cg@678: ^ self askForDestinationForFullInstallation cg@678: ] ifFalse:[ cg@678: ^ self askForDestinationForPartialInstallation cg@678: ] cg@678: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@678: "Modified: / 25.2.1998 / 17:12:45 / cg" cg@678: ! cg@678: cg@678: askForDestinationForFullInstallation cg@678: "open a dialog to enter destination directories" cg@678: cg@678: |d cm l green dark img cg@678: fullDirHolder| cg@678: cg@678: LastFullDir isNil ifTrue:[ cg@1515: LastFullDir := (Filename homeDirectory construct:'work') constructString:'stx' cg@678: ]. cg@678: cg@678: fullDirHolder := LastFullDir asValue. cg@678: cg@678: Screen current hasColors ifTrue:[ cg@678: green := (Color red:0 green:80 blue:20) "darkened". cg@678: dark := Color grey:10. cg@678: ] ifFalse:[ cg@678: green := Color white. cg@678: dark := Color black. cg@678: ]. cg@678: cg@678: d := DialogBox new. cg@678: cg@678: d label:(resources string:'ST/X Full Installation'). cg@678: img := Image fromFile:'SmalltalkX.xbm'. cg@678: cg@678: l := d addTextLabel:img. cg@678: l adjust:#left; foregroundColor:green backgroundColor:dark. cg@678: cg@678: l := d addTextLabel:(resources string:'Smalltalk/X CD installation (full).'). cg@678: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@1508: cg@1508: l := d addTextLabel:(resources string:'\Notice: this simply copies all of the CD to the destination directory below.\If any problem is encountered, manually copy the CD to your harddisk.') withCRs. cg@1508: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@1508: cg@678: d addVerticalSpace. cg@678: d addVerticalSpace. cg@678: cg@678: d addHorizontalLine. cg@678: cg@678: l := d addTextLabel:(resources string:'ST/X development directory:'). cg@678: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@678: cg@678: cm := ComboBoxView on:fullDirHolder. cg@678: cm list:self defaultFullDirs. cg@678: d cg@678: addLabelledField:cm cg@678: label:(resources string:'stx develop') cg@678: adjust:#left cg@678: tabable:true cg@678: from:0.0 to:1.0 separateAtX:0.25 cg@678: nameAs:'fullBox'. cg@678: cg@678: (d componentAt:'fullBox.label') backgroundColor:dark; foregroundColor:Color white. cg@678: cg@678: d addVerticalSpace. cg@678: d addHorizontalLine. cg@678: cg@678: d addHelpButtonFor:'STXInstaller/installHelp.html'; cg@678: addAbortButton; cg@678: addOkButtonLabelled:(resources string:'install'). cg@678: d extent:500@400. cg@1151: d resize. "/ compute best size cg@678: cg@678: d allViewBackground:dark. cg@678: cg@678: d openAtCenter. cg@678: d accepted ifTrue:[ cg@678: fullDir := LastFullDir := fullDirHolder value. cg@678: d destroy. cg@678: ^ true cg@678: ]. cg@678: d destroy. cg@678: ^ false cg@678: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@678: "Created: / 25.2.1998 / 17:11:37 / cg" cg@678: "Modified: / 25.2.1998 / 17:29:07 / cg" cg@678: ! cg@678: cg@678: askForDestinationForPartialInstallation cg@678: "open a dialog to enter destination directories" cg@678: cg@2: |d cm l green dark img cg@1132: stxInstDirHolder stxLibDirHolder stxLibBinDirHolder stxBinDirHolder cg@5: installDocHolder installSourceHolder installSTCHolder installGoodiesHolder cg@73: binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes cg@1132: goodyMegabytes stxRel list stxInstDir cg@0: | cg@0: cg@1139: binMegabytes := 20. cg@73: libMegabytes := 30. cg@1139: docMegabytes := 12. cg@1117: stcMegabytes := 2. cg@1139: srcMegabytes := 20. cg@1139: goodyMegabytes := 10. cg@11: cg@1132: stxRel := self smalltalkRelease. cg@1132: cg@1119: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1132: LastPartialDir isNil ifTrue:[ cg@1139: LastPartialDir := 'c:\Programme\eXept\SmalltalkX\' , stxRel cg@1119: ]. cg@1132: "/ LastLibDir isNil ifTrue:[ cg@1132: "/ LastLibDir := 'c:\Programme\SmalltalkX\' , stxRel , '\lib' cg@1132: "/ ]. cg@1132: "/ LastLibBinDir isNil ifTrue:[ cg@1132: "/ LastLibBinDir := 'c:\Programme\SmalltalkX\' , stxRel , '\lib' cg@1132: "/ ]. cg@1132: "/ LastBinDir isNil ifTrue:[ cg@1132: "/ LastBinDir := 'c:\Programme\SmalltalkX\' , stxRel , '\bin' cg@1132: "/ ]. cg@1119: ] ifFalse:[ cg@1132: LastPartialDir isNil ifTrue:[ cg@1132: LastPartialDir := '/opt/smalltalk/' , stxRel cg@1119: ]. cg@1132: "/ LastLibDir isNil ifTrue:[ cg@1132: "/ LastLibDir := '/opt/smalltalk/' , stxRel , '/lib' cg@1132: "/ ]. cg@1132: "/ LastLibBinDir isNil ifTrue:[ cg@1132: "/ LastLibBinDir := '/opt/smalltalk/' , stxRel , '/lib' cg@1132: "/ ]. cg@1132: "/ LastBinDir isNil ifTrue:[ cg@1132: "/ LastBinDir := '/opt/smalltalk/' , stxRel , '/bin' cg@1132: "/ ]. cg@0: ]. cg@0: cg@1132: stxInstDirHolder := LastPartialDir asValue. cg@1132: "/ stxLibDirHolder := LastLibDir asValue. cg@1132: "/ stxLibBinDirHolder := LastLibBinDir asValue. cg@1132: "/ stxBinDirHolder := LastBinDir asValue. cg@24: cg@5: installDocHolder := true asValue. cg@5: installSourceHolder := true asValue. cg@5: installSTCHolder := true asValue. cg@5: installGoodiesHolder := true asValue. cg@0: cg@0: Screen current hasColors ifTrue:[ cg@0: green := (Color red:0 green:80 blue:20) "darkened". cg@0: dark := Color grey:10. cg@0: ] ifFalse:[ cg@0: green := Color white. cg@0: dark := Color black. cg@0: ]. cg@0: cg@0: d := DialogBox new. cg@0: cg@1279: d label:(resources string:'ST/X Standard Installation'). cg@2: img := Image fromFile:'SmalltalkX.xbm'. cg@2: cg@2: l := d addTextLabel:img. cg@2: l adjust:#left; foregroundColor:green backgroundColor:dark. cg@2: cg@1279: l := d addTextLabel:(resources string:'Smalltalk/X Standard installation (partial).'). cg@0: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@0: d addVerticalSpace. cg@0: d addVerticalSpace. cg@0: cg@0: d addHorizontalLine. cg@0: cg@11: l := d addTextLabel:(resources string:'Destination directories:'). cg@0: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@0: cg@1132: l := d addTextLabel:(resources string:'(the default below is recommended)'). cg@678: l adjust:#right; backgroundColor:dark; foregroundColor:Color white. cg@678: cg@1132: cm := ComboBoxView on:stxInstDirHolder. cg@1139: list := self defaultInstDirs collect:[:line | cg@1132: line replChar:$\ withString:'\\' cg@1132: ]. cg@1132: cm list:list. cg@0: d cg@0: addLabelledField:cm cg@1132: label:(resources string:'install into:') cg@0: adjust:#left cg@0: tabable:true cg@0: from:0.0 to:1.0 separateAtX:0.25 cg@1132: nameAs:'instDirBox'. cg@0: cg@1132: (d componentAt:'instDirBox.label') backgroundColor:dark; foregroundColor:Color white. cg@24: cg@1132: "/ cm := ComboBoxView on:stxBinDirHolder. cg@1132: "/ list := self defaultBinDirs collect:[:line | cg@1132: "/ line replChar:$\ withString:'\\' cg@1132: "/ ]. cg@1132: "/ cm list:list. cg@1132: "/ d cg@1132: "/ addLabelledField:cm cg@1132: "/ label:(resources string:'binaries') cg@1132: "/ adjust:#left cg@1132: "/ tabable:true cg@1132: "/ from:0.0 to:1.0 separateAtX:0.25 cg@1132: "/ nameAs:'binaryBox'. cg@1132: "/ cg@1132: "/ (d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white. cg@1132: "/ cg@1132: "/ cm := ComboBoxView on:stxLibBinDirHolder. cg@1132: "/ cm list:self defaultLibBinDirs. cg@1132: "/ d cg@1132: "/ addLabelledField:cm cg@1132: "/ label:(resources string:'libraries') cg@1132: "/ adjust:#left cg@1132: "/ tabable:true cg@1132: "/ from:0.0 to:1.0 separateAtX:0.25 cg@1132: "/ nameAs:'libraryBinBox'. cg@1132: "/ cg@1132: "/ (d componentAt:'libraryBinBox.label') backgroundColor:dark; foregroundColor:Color white. cg@1132: "/ cg@1132: "/ cm := ComboBoxView on:stxLibDirHolder. cg@1132: "/ cm list:self defaultLibDirs. cg@1132: "/ d cg@1132: "/ addLabelledField:cm cg@1132: "/ label:(resources string:'other files') cg@1132: "/ adjust:#left cg@1132: "/ tabable:true cg@1132: "/ from:0.0 to:1.0 separateAtX:0.25 cg@1132: "/ nameAs:'libraryBox'. cg@1132: "/ cg@1132: "/ (d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white. cg@0: cg@5: d addVerticalSpace. cg@5: d addHorizontalLine. cg@5: d addVerticalSpace. cg@5: cg@11: (d addTextLabel:(resources string:'required:')) cg@5: adjust:#left; foregroundColor:Color white backgroundColor:dark. cg@5: cg@5: d leftIndent:35. cg@11: (d addTextLabel:(resources string:'binaries (approx. %1 Mb)' with:binMegabytes printString)) cg@5: adjust:#left; foregroundColor:Color white backgroundColor:dark. cg@11: (d addTextLabel:(resources string:'libraries (approx. %1 Mb)' with:libMegabytes printString)) cg@5: adjust:#left; foregroundColor:Color white backgroundColor:dark. cg@5: d leftIndent:0. cg@5: cg@5: d addVerticalSpace. cg@5: d addHorizontalLine. cg@5: d addVerticalSpace. cg@5: cg@11: (d addTextLabel:(resources string:'optional:')) cg@5: adjust:#left; foregroundColor:Color white backgroundColor:dark. cg@5: cg@73: (d addCheckBox:((resources string:'doc files (+%1 Mb)' with:docMegabytes)) on:installDocHolder) cg@5: labelView foregroundColor:Color white backgroundColor:dark. cg@73: (d addCheckBox:((resources string:'stc & support files (+%1 Mb)' with:stcMegabytes)) on:installSTCHolder) cg@10: labelView foregroundColor:Color white backgroundColor:dark. cg@10: cg@10: d addVerticalSpace. cg@10: d addHorizontalLine. cg@10: d addVerticalSpace. cg@10: cg@11: (d addTextLabel:(resources string:'optional (but highly recommended):')) cg@10: adjust:#left; foregroundColor:Color white backgroundColor:dark. cg@10: cg@73: (d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder) cg@5: labelView foregroundColor:Color white backgroundColor:dark. cg@1117: (d addCheckBox:((resources string:'goodies (+%1 Mb)' with:goodyMegabytes)) on:installGoodiesHolder) cg@5: labelView foregroundColor:Color white backgroundColor:dark. cg@5: cg@5: d addVerticalSpace. cg@5: d addHorizontalLine. cg@5: cg@24: d addHelpButtonFor:'STXInstaller/installHelp.html'; cg@24: addAbortButton; cg@24: addOkButtonLabelled:(resources string:'install'). cg@73: d extent:500@400. cg@1151: d resize. "/ compute best size cg@0: cg@0: d allViewBackground:dark. cg@0: cg@0: d openAtCenter. cg@0: d accepted ifTrue:[ cg@1279: stxInstDir := LastPartialDir := stxTopDir := stxInstDirHolder value. cg@1279: stxDocDir := stxInstDir asFilename constructString:'doc'. cg@1132: stxLibDir := stxInstDir asFilename constructString:'lib'. cg@1132: stxLibBinDir := stxInstDir asFilename constructString:'lib'. cg@1132: stxBinDir := stxInstDir asFilename constructString:'bin'. cg@1279: stxPkgDir := stxInstDir asFilename constructString:'packages'. cg@1132: cg@1132: "/ stxLibDir := LastLibDir := stxLibDirHolder value. cg@1132: "/ stxLibBinDir := LastLibBinDir := stxLibBinDirHolder value. cg@1132: "/ stxBinDir := LastBinDir := stxBinDirHolder value. cg@5: installDocFiles := installDocHolder value. cg@5: installSourceFiles := installSourceHolder value. cg@5: installSTCFiles := installSTCHolder value. cg@5: installGoodyFiles := installGoodiesHolder value. cg@1: d destroy. cg@0: ^ true cg@0: ]. cg@1: d destroy. cg@0: ^ false cg@0: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@678: "Created: / 25.2.1998 / 17:11:26 / cg" cg@1139: "Modified: / 31.5.1999 / 18:37:50 / cg" cg@678: ! cg@678: cg@678: askForFullInstallation cg@1508: "open a dialog to ask if a full installation is wanted; cg@1508: Leave the result in installWhat (a symbol, either #full or #partial)." cg@678: cg@678: |d cm l green dark img| cg@678: cg@678: Screen current hasColors ifTrue:[ cg@678: green := (Color red:0 green:80 blue:20) "darkened". cg@678: dark := Color grey:10. cg@678: ] ifFalse:[ cg@678: green := Color white. cg@678: dark := Color black. cg@678: ]. cg@678: cg@678: d := DialogBox new. cg@678: cg@678: d label:(resources string:'ST/X CD Installation'). cg@678: img := Image fromFile:'SmalltalkX.xbm'. cg@678: cg@678: l := d addTextLabel:img. cg@678: l adjust:#left; foregroundColor:green backgroundColor:dark. cg@678: cg@678: l := d addTextLabel:(resources string:'Smalltalk/X CD installation.'). cg@678: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@678: d addVerticalSpace. cg@678: d addVerticalSpace. cg@678: cg@678: d addHorizontalLine. cg@678: cg@678: l := d addTextLabel:(resources string: cg@1279: 'You can either perform a ' , 'full' asText allBold , ' installation, or a ' , 'standard' asText allBold ,' (partial) installation.'). cg@678: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@678: cg@678: d addVerticalSpace. cg@678: d addHorizontalLine. cg@678: cg@678: d leftIndent:20. cg@678: l := d addTextLabel:(resources string: cg@1117: 'full:' asText allBold , ' cg@1117: The full installation is required if you want to build your own cg@1117: customized smalltalk executable. It allows you to create and include cg@1117: additional precompiled binary classes or classLibraries. cg@678: This is also required if you want to link your own standalone executables. cg@678: cg@678: It consists of a directory hierachy, including makefiles for a customizeable cg@678: rebuild of the whole smalltalk system. cg@678: (Actually, it simply copies the whole CD contents onto your disk). cg@1510: This requires roughly 200-300Mb of hard disk space (dep. upon architecture).'). cg@678: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@678: cg@678: d addVerticalSpace. cg@678: d addHorizontalLine. cg@678: cg@678: l := d addTextLabel:(resources string: cg@1279: 'standard:' asText allBold , ' cg@1279: The standard (runTime) installation requires less disk space and only copies the cg@678: smalltalk executable, shared libraries and support files onto your hard disk. cg@1117: This setup allows normal smalltalk development and is also useful as a runtime cg@1117: environment for smalltalk applications. cg@1151: However, it does not support recreation of a new smalltalk executable and/or cg@1117: shared binary classLibraries. cg@1151: This setup also saves a lot of disk space, if multiple users are going to cg@1151: use smalltalk, since most of the code is shared (both on disk and in memory). cg@1151: This requires roughly 70-120Mb of hard disk space (dep. upon architecture). cg@678: cg@678: cg@678: '). cg@678: l adjust:#left; backgroundColor:dark; foregroundColor:Color white. cg@678: cg@678: cg@678: d leftIndent:0. cg@678: d addVerticalSpace. cg@678: d addHorizontalLine. cg@678: cg@678: cg@678: d addHelpButtonFor:'STXInstaller/installHelp.html'; cg@678: addAbortButton; cg@1010: addOkButton:(Button label:(resources string:'full') action:[installWhat := #full]); cg@1279: addOkButtonLabelled:(resources string:'standard'). cg@1151: d extent:500@500. cg@1151: d resize. "/ compute best size ... cg@678: cg@678: d allViewBackground:dark. cg@678: cg@1010: installWhat := #partial. cg@678: d openAtCenter. cg@678: d accepted ifTrue:[ cg@678: d destroy. cg@678: ^ true cg@678: ]. cg@678: d destroy. cg@678: ^ false cg@678: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@678: "Created: / 25.2.1998 / 16:50:16 / cg" cg@678: "Modified: / 25.2.1998 / 19:42:31 / cg" cg@0: ! cg@0: cg@0: checkForExistingInstallationAndConfirm cg@0: "look if there is another installation and confirm cg@0: reinstalling; return true if ok, false if not" cg@0: cg@678: |whichDir canOverWrite whatToDo box| cg@678: cg@1010: installWhat == #full ifTrue:[ cg@678: whichDir := fullDir. cg@678: canOverWrite := false. cg@678: ] ifFalse:[ cg@678: whichDir := stxLibDir. cg@678: canOverWrite := true. cg@678: ]. cg@1: cg@678: whichDir asFilename exists ifTrue:[ cg@678: whatToDo := Dialog cg@678: choose:(resources cg@678: string:'detected existing ST/X installation in %1' cg@678: with:whichDir asText allBold) cg@678: label:(resources string:'Attention') cg@678: labels:(resources array:(canOverWrite cg@678: ifFalse:[#('remove first' 'cancel')] cg@678: ifTrue:[#('remove first' 'overwrite' 'cancel')] )) cg@678: values:(canOverWrite ifFalse:[#(remove nil)] ifTrue:[#(remove over nil)]) cg@678: default:nil. cg@73: cg@678: whatToDo isNil ifTrue:[^false]. cg@678: whatToDo == #remove ifTrue:[ cg@678: ((whichDir findString:'stx') == 0 cg@678: and:[(whichDir findString:'smalltalk') == 0]) ifTrue:[ cg@678: "/ confirm again cg@678: (self confirm:(resources cg@678: string:'are you certain that the directory to remove cg@678: (' , whichDir , ') is really a smalltalk directory ? cg@23: cg@73: Remove it now ?')) ifFalse:[ cg@678: ^ false cg@678: ] cg@678: ]. cg@678: cg@678: [ cg@678: box := DialogBox new label:'please wait'. cg@678: box addTextLabel:'removing ' , whichDir , ' ...'. cg@678: box showAtPointer. cg@678: ] forkAt:(Processor activePriority+1). cg@678: box waitUntilVisible. cg@23: cg@678: (OperatingSystem recursiveRemoveDirectory:whichDir) cg@678: ifFalse:[ cg@1512: OperatingSystem removeDirectory:whichDir. cg@1512: whichDir asFilename exists ifTrue:[ cg@1512: self warn:(resources string:'mhmh - could not remove old installation. cg@678: cg@1132: Please remove it manually (using administrator privileges if required) cg@678: and try again.'). cg@1512: box destroy. cg@1512: ^ false cg@1512: ] cg@678: ]. cg@678: cg@678: box destroy cg@1: ]. cg@0: ]. cg@678: cg@0: ^ true cg@0: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@1132: "Modified: / 31.5.1999 / 13:23:03 / cg" cg@0: ! cg@0: cg@0: doInstall cg@0: "install ST/X; return true if ok, false if not" cg@0: cg@678: |progressView ok v textView p l cg@1132: dirToMonitor doDfMonitoring dfMonitorProcess kB drive| cg@678: cg@678: doDfMonitoring := false. cg@678: cg@678: v := View new preferredExtent:(250 @ 350). cg@678: cg@678: textView := HVScrollableView for:TextCollector in:v. cg@678: textView origin:0.0@0.0 corner:1.0@1.0. cg@678: textView bottomInset:30. cg@1516: textView lineLimit:10000. cg@678: commandTraceView := textView scrolledView. cg@678: cg@1010: installWhat == #full ifTrue:[ cg@678: dirToMonitor := fullDir. cg@678: ] ifFalse:[ cg@678: dirToMonitor := stxLibDir cg@678: ]. cg@678: cg@1132: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1132: drive := Filename rootDirectoryOnVolume:(dirToMonitor asFilename volume) cg@1132: ] ifFalse:[ cg@1132: drive := dirToMonitor cg@1132: ]. cg@1152: drive := drive asFilename. cg@678: cg@1132: p := HorizontalPanelView in:v. cg@1132: p origin:0.0@1.0 corner:1.0@1.0. cg@1132: p topInset:-30. cg@1132: p horizontalLayout:#fit. cg@1132: cg@1132: l := Label label:'' in:p. cg@1132: l labelChannel:(dfHolder := '' asValue). cg@1132: l adjust:#left. cg@1132: dfMonitorProcess := [ cg@1132: |ok info free kB i l| cg@4: cg@1132: ok := true. cg@1132: [ok] whileTrue:[ cg@1132: doDfMonitoring ifTrue:[ cg@1132: ok := false. cg@1132: info := OperatingSystem getDiskInfoOf:drive pathName. cg@1132: info notNil ifTrue:[ cg@1132: free := info at:#freeBytes ifAbsent:nil. cg@1132: free notNil ifTrue:[ cg@1132: kB := free / 1024. cg@1132: kB > 10000 ifTrue:[ cg@1132: l := (kB // 1024) printString, 'Mb available.'. cg@1132: ] ifFalse:[ cg@1132: l := kB printString , 'Kb available.'. cg@678: ]. cg@1132: dfHolder value:l. cg@1132: ok := true. cg@1132: Delay waitForSeconds:9. cg@678: ]. cg@678: ]. cg@1132: ]. cg@1132: Delay waitForSeconds:1. cg@1132: ] cg@1132: ] forkAt:(Processor activePriority+3). cg@0: cg@0: progressView := ProgressIndicator cg@1118: inBoxWithLabel:'ST/X Installation' icon:(Icon stxIcon) cg@0: text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection cg@4: abortable:true cg@678: view:v cg@4: closeWhenDone:false. cg@73: progressView topView extent:(640 min:Display width) @ (500 min:Display height). cg@0: cg@0: ok := false. cg@0: cg@0: progressView showProgressOf: cg@4: [:progressValue :currentAction| |msg| cg@4: cg@4: Processor activeProcess withPriority:7 do:[ cg@682: [ cg@682: actionPercentageHolder := progressValue. cg@682: actionTextHolder := currentAction. cg@682: cg@1010: installWhat == #full ifFalse:[ cg@682: self outputInitialMessage. cg@682: ]. cg@0: cg@682: (self createDirectories) ifTrue:[ cg@682: doDfMonitoring := true. cg@682: ok := self copyFiles cg@682: ]. cg@790: self changeWritability. cg@682: self createSymbolicLinks. cg@1367: self removeMakefilesInDoc. cg@1367: cg@1134: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@1134: self createRegistryEntries. cg@1134: ]. cg@682: cg@682: progressValue value:100. cg@73: cg@1117: progressView topView raise. cg@1117: commandTraceView showCR:'Installation finished.' asText allBold. cg@1117: commandTraceView endEntry. cg@1117: textView flash. cg@1117: cg@682: progressView topView abortButton label:(resources string:'continue'). cg@682: progressView topView abortButton action:[progressView topView hide]. cg@682: msg := (resources cg@682: array:#('ST/X Installation finished.' '' 'press continue ...' '' '' '')) cg@682: asStringCollection. cg@682: actionTextHolder value:nil. cg@682: actionTextHolder value:msg. cg@682: ] valueOnUnwindDo:[ cg@682: dfMonitorProcess notNil ifTrue:[ cg@682: dfMonitorProcess terminate. cg@682: dfMonitorProcess := nil. cg@682: ]. cg@682: copyProcess notNil ifTrue:[ cg@682: copyProcess terminate. cg@682: copyProcess := nil. cg@682: ]. cg@682: ] cg@4: ] cg@0: ]. cg@0: cg@678: dfMonitorProcess notNil ifTrue:[ cg@682: dfMonitorProcess terminate. cg@682: dfMonitorProcess := nil. cg@678: ]. cg@678: copyProcess notNil ifTrue:[ cg@678: copyProcess terminate. cg@678: copyProcess := nil. cg@678: ]. cg@0: ^ ok cg@0: cg@678: " cg@678: STXInstaller open cg@678: " cg@678: cg@678: "Created: / 17.7.1996 / 15:11:27 / cg" cg@1134: "Modified: / 31.5.1999 / 14:45:12 / cg" cg@0: ! cg@0: cg@0: open cg@1: self askAndInstall. cg@0: cg@5: " cg@1119: LastLibDir := LastBinDir := LastLibBinDir := nil. cg@1139: LastPartialDir := LastFullDir := nil. cg@1119: cg@5: STXInstaller open cg@5: " cg@1119: cg@1139: "Modified: / 31.5.1999 / 18:28:10 / cg" cg@1: ! cg@1: cg@1: postInstall cg@1: "some messages at the end ..." cg@1: cg@4: |shInfo cshInfo msg havePath| cg@1: cg@678: resources isNil ifTrue:[ cg@678: resources := ResourcePack for:self class. cg@678: ]. cg@678: cg@11: msg := (resources string:'ST/X Installation complete.\\') withCRs. cg@1: shInfo := ''. cg@1: cshInfo := ''. cg@1: cg@1119: OperatingSystem isMSWINDOWSlike ifFalse:[ cg@1119: cg@1119: installWhat == #full ifTrue:[ cg@1119: msg := msg , 'You will now find a development directory hierarchy cg@678: in ''' , fullDir asText allBold , '''. cg@678: cg@678: To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk'' cg@678: and start smalltalk with the command: ''./smalltalk''. cg@678: cg@678: To perform a partial installation of your customized smalltalk later, cg@678: use the INSTALL script found in ''' , fullDir , ''''. cg@1: cg@1119: ] ifFalse:[ cg@1119: havePath := true. cg@1119: (((OperatingSystem getEnvironment:'PATH') cg@1119: asCollectionOfSubstringsSeparatedBy:$:) cg@1119: includes:stxBinDir) ifFalse:[ cg@1: cg@1119: havePath := false. cg@1119: shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. cg@1119: cshInfo := 'set path=($path ' , stxBinDir , ')\'. cg@1119: msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\' cg@1119: with:stxBinDir asText allBold) withCRs. cg@678: ]. cg@1: cg@1119: (stxLibDir ~= '/usr/local/lib/smalltalk' cg@1119: and:[stxLibDir ~= '/usr/lib/smalltalk' cg@1119: and:[stxLibDir ~= ('/opt/smalltalk/' , self smalltalkRelease , '/lib')]]) ifTrue:[ cg@1119: msg := msg , (resources string:'The library directory is not a standard ST/X library directory\("/opt/smalltalk/' , self smalltalkRelease , '/lib", "/usr/local/lib/smalltalk" or "/usr/lib/smalltalk"). cg@1119: You may have to define the %1 environment variable\as %2 if ST/X complains about not finding its files.\' cg@1119: with:'STX_LIBDIR' asText allBold cg@1119: with:stxLibDir asText allBold) withCRs. cg@1119: havePath ifFalse:[ cg@1119: msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs. cg@1119: ] ifTrue:[ cg@1119: msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs. cg@1119: ]. cg@678: cg@1119: shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. cg@1119: cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. cg@1119: ]. cg@1119: cg@1119: shInfo notEmpty ifTrue:[ cg@1119: '*********************************************************' errorPrintCR. cg@1119: (resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR. cg@1119: (resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR. cg@1119: '' errorPrintCR. cg@1119: shInfo withCRs errorPrintCR. cg@1119: '' errorPrintCR. cg@1119: (resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR. cg@1119: '' errorPrintCR. cg@1119: cshInfo withCRs errorPrintCR. cg@1119: '' errorPrintCR. cg@1119: '*********************************************************' errorPrintCR. cg@1119: ]. cg@678: ]. cg@1: ]. cg@73: msg := msg , '\\Have fun using ST/X !!'. cg@73: cg@73: self information:msg withCRs. cg@1: cg@1119: "Modified: / 30.4.1999 / 17:59:39 / cg" cg@25: ! cg@25: cg@25: preInstall cg@678: "clobber the doc directory, to avoid copying cyclic symbolic links. cg@678: Notice, the CD does not contain symlinks, but checking for them cg@678: allows installing from a development dir." cg@25: cg@25: |f| cg@25: cg@1119: OperatingSystem isMSWINDOWSlike ifFalse:[ cg@1119: f := '../../doc/online/english/german' asFilename. cg@1119: f exists ifTrue:[ cg@1119: f isSymbolicLink ifTrue:[ cg@1119: OperatingSystem executeCommand:'(cd ../../doc/online; make clobber) >/dev/null 2>/dev/null' cg@1119: ] cg@25: ] cg@25: ] cg@25: cg@25: " cg@25: STXInstaller new preInstall cg@25: " cg@25: cg@1119: "Modified: / 30.4.1999 / 17:54:38 / cg" cg@0: ! ! cg@0: cg@28: !STXInstaller class methodsFor:'documentation'! cg@0: cg@0: version cg@0: ^ '$Header$' cg@0: ! !