--- a/STXInstaller.st Sat Mar 01 13:44:39 1997 +0100
+++ b/STXInstaller.st Sun Mar 02 13:47:11 1997 +0100
@@ -123,6 +123,26 @@
^ dirsToMake
!
+listOfOptionalPackages
+ ^ #(
+ 'libDB'
+ 'clients/CBrowser'
+ 'libtool2'
+ 'libcompat'
+ 'libui'
+ 'libxt'
+
+
+ "/ mhmh - these should not be needed here ...
+
+ 'projects/smalltalk/bitmaps/javaImages'
+ 'doc/online/english/overview/icons'
+ )
+
+ "Created: 2.3.1997 / 12:39:59 / cg"
+ "Modified: 2.3.1997 / 13:24:41 / cg"
+!
+
specOfFilesToCopy
|fileSpec|
@@ -258,34 +278,39 @@
actionTextHolder value:nil.
actionTextHolder value:msg.
- cmd := 'cp -r ../../' , fileName , ' ' , destDir.
- commandTraceView showCR:cmd , ' ...'.
-"/ cmd := 'sh -c "echo ; ' , cmd , ' 2>&1"' .
- cmd := cmd , ' 2>&1' .
+ ((fileName includes:$*) not
+ and:[('../../' , fileName) asFilename exists not]) ifTrue:[
+ (self listOfOptionalPackages includes:fileName) ifFalse:[
+ commandTraceView showCR:('cannot copy ' , fileName , ' - not included in distribution')
+ ]
+ ] ifFalse:[
+ cmd := 'cp -r ../../' , fileName , ' ' , destDir.
+ commandTraceView showCR:cmd , ' ...'.
+ cmd := cmd , ' 2>&1' .
- doneSemaphore := Semaphore new.
+ 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)).
+ 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)).
+ ]
]
- ]
+ ].
+ p close.
].
- p close.
- ].
- doneSemaphore signal.
- ] forkAt:4.
+ doneSemaphore signal.
+ ] forkAt:4.
- doneSemaphore wait.
-
+ doneSemaphore wait.
+ ]
].
nDone := nDone + 1
@@ -294,7 +319,7 @@
^ true
"Created: 17.7.1996 / 15:16:20 / cg"
- "Modified: 9.1.1997 / 03:15:23 / cg"
+ "Modified: 2.3.1997 / 12:43:47 / cg"
!
createDirectories
@@ -369,6 +394,48 @@
"Created: 17.7.1996 / 15:24:19 / cg"
"Modified: 18.7.1996 / 22:18:38 / cg"
+!
+
+outputInitialMessage
+ #(
+ 'Notice:'
+ ''
+ 'During the installation, you may get error messages'
+ 'complaining that some files where not found'
+ 'and could therefore not be copied.'
+ ) do:[:line |
+ commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)).
+ commandTraceView endEntry.
+ ].
+
+ Delay waitForSeconds:2.
+
+ #(
+ ''
+ 'This is normal behavior; since the CD may contain'
+ 'broken symbolic links to non-existing packages'
+ 'which are either not contained on your ordered'
+ 'package (i.e. non-commercial) or not yet published by eXept.'
+ ) do:[:line |
+ commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)).
+ commandTraceView endEntry.
+ ].
+
+ Delay waitForSeconds:2.
+
+ #(
+ ''
+ 'Please excuse this inconvenience.'
+ ''
+ ) do:[:line |
+ commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)).
+ commandTraceView endEntry.
+ ].
+
+ Delay waitForSeconds:2.
+
+ "Created: 2.3.1997 / 12:49:52 / cg"
+ "Modified: 2.3.1997 / 13:22:45 / cg"
! !
!STXInstaller methodsFor:'startup'!
@@ -384,21 +451,20 @@
].
[self askForDestination] whileTrue:[
- self checkForExistingInstallationAndConfirm ifFalse:[
- ^ self
- ].
- self preInstall.
- self doInstall ifTrue:[
- self postInstall.
- ^ self
- ].
- (self confirm:(resources string:'installation failed or aborted - retry ?'))
- ifFalse:[
- ^ self
+ self checkForExistingInstallationAndConfirm ifTrue:[
+ self preInstall.
+ self doInstall ifTrue:[
+ self postInstall.
+ ^ self
+ ].
+ (self confirm:(resources string:'installation failed or aborted - retry ?'))
+ ifFalse:[
+ ^ self
+ ]
]
].
- "Modified: 18.7.1996 / 21:20:56 / cg"
+ "Modified: 2.3.1997 / 13:46:23 / cg"
!
askForDestination
@@ -407,11 +473,14 @@
|d cm l green dark img
stxLibDirHolder stxLibBinDirHolder stxBinDirHolder
installDocHolder installSourceHolder installSTCHolder installGoodiesHolder
- binMegabytes libMegabytes
+ binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes
|
binMegabytes := 10.
- libMegabytes := 10.
+ libMegabytes := 30.
+ docMegabytes := 11.
+ stcMegabytes := 1.
+ srcMegabytes := 15.
LastLibDir isNil ifTrue:[
LastLibDir := '/usr/local/lib/smalltalk'
@@ -515,9 +584,9 @@
(d addTextLabel:(resources string:'optional:'))
adjust:#left; foregroundColor:Color white backgroundColor:dark.
- (d addCheckBox:((resources string:'doc files') , ' (+8 Mb)') on:installDocHolder)
+ (d addCheckBox:((resources string:'doc files (+%1 Mb)' with:docMegabytes)) on:installDocHolder)
labelView foregroundColor:Color white backgroundColor:dark.
- (d addCheckBox:((resources string:'stc & support files') , ' (+2 Mb)') on:installSTCHolder)
+ (d addCheckBox:((resources string:'stc & support files (+%1 Mb)' with:stcMegabytes)) on:installSTCHolder)
labelView foregroundColor:Color white backgroundColor:dark.
d addVerticalSpace.
@@ -527,9 +596,9 @@
(d addTextLabel:(resources string:'optional (but highly recommended):'))
adjust:#left; foregroundColor:Color white backgroundColor:dark.
- (d addCheckBox:((resources string:'smalltalk source files') , ' (+12 Mb)') on:installSourceHolder)
+ (d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder)
labelView foregroundColor:Color white backgroundColor:dark.
- (d addCheckBox:((resources string:'goodies') , ' (+0.5 Mb)') on:installGoodiesHolder)
+ (d addCheckBox:((resources string:'goodies (+0.5 Mb)')) on:installGoodiesHolder)
labelView foregroundColor:Color white backgroundColor:dark.
d addVerticalSpace.
@@ -538,7 +607,7 @@
d addHelpButtonFor:'STXInstaller/installHelp.html';
addAbortButton;
addOkButtonLabelled:(resources string:'install').
- d extent:400@300.
+ d extent:500@400.
d allViewBackground:dark.
@@ -557,7 +626,7 @@
d destroy.
^ false
- "Modified: 18.7.1996 / 19:43:38 / cg"
+ "Modified: 2.3.1997 / 13:40:44 / cg"
!
checkForExistingInstallationAndConfirm
@@ -575,6 +644,7 @@
labels:(resources array:#('remove first' 'overwrite' 'cancel'))
values:#(remove over nil)
default:nil.
+
whatToDo isNil ifTrue:[^false].
whatToDo == #remove ifTrue:[
((stxLibDir findString:'stx') == 0
@@ -582,9 +652,13 @@
"/ confirm again
(self confirm:(resources
string:'are you certain that the directory to remove
-is really an smalltalk directory ?
+(' , stxLibDir , ') is really a smalltalk directory ?
-Remove it now ?')) ifFalse:[ ^ true].
+Remove it now ?')) ifFalse:[
+ (self confirm:(resources
+ string:'overwrite ?')) ifTrue:[^ true].
+ ^ false
+ ]
].
(OperatingSystem recursiveRemoveDirectory:stxLibDir)
@@ -593,16 +667,10 @@
].
].
^ true
-"/ ^ DialogBox
-"/ confirm:('detected existing installation in '
-"/ , stxLibDir asText allBold
-"/ , '\\continue & overwrite ?') withCRs
-"/ yesLabel:'overwrite' noLabel:'cancel'
-
].
^ true
- "Modified: 18.7.1996 / 20:01:36 / cg"
+ "Modified: 2.3.1997 / 13:45:13 / cg"
!
doInstall
@@ -611,7 +679,7 @@
|progressView ok textView|
textView := HVScrollableView for:TextCollector.
- textView preferredExtent:(100 @ 250).
+ textView preferredExtent:(200 @ 300).
commandTraceView := textView scrolledView.
progressView := ProgressIndicator
@@ -620,7 +688,7 @@
abortable:true
view:textView
closeWhenDone:false.
- progressView topView extent:(500 min:Display width) @ 300.
+ progressView topView extent:(640 min:Display width) @ (500 min:Display height).
ok := false.
@@ -631,6 +699,8 @@
actionPercentageHolder := progressValue.
actionTextHolder := currentAction.
+ self outputInitialMessage.
+
(self createDirectories) ifTrue:[
ok := self copyFiles
].
@@ -651,7 +721,7 @@
^ ok
"Created: 17.7.1996 / 15:11:27 / cg"
- "Modified: 17.7.1996 / 15:24:27 / cg"
+ "Modified: 2.3.1997 / 12:59:47 / cg"
!
open
@@ -711,13 +781,16 @@
'' errorPrintCR.
'*********************************************************' errorPrintCR.
].
- self information:msg.
+
+ msg := msg , '\\Have fun using ST/X !!'.
+
+ self information:msg withCRs.
"
STXInstaller new postInstall
"
- "Modified: 18.7.1996 / 22:10:42 / cg"
+ "Modified: 2.3.1997 / 13:28:18 / cg"
!
preInstall