STXInstaller.st
changeset 1010 d744cc925443
parent 793 43a9a195b0f3
child 1117 657dde1e749d
equal deleted inserted replaced
1009:b153d1426731 1010:d744cc925443
     1 Object subclass:#STXInstaller
     1 Object subclass:#STXInstaller
     2 	instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir installDocFiles
     2 	instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir installDocFiles
     3 		installSourceFiles installSTCFiles installGoodyFiles fullDir
     3 		installSourceFiles installSTCFiles installGoodyFiles fullDir
     4 		actionPercentageHolder actionTextHolder commandTraceView
     4 		actionPercentageHolder actionTextHolder commandTraceView
     5 		resources fullInstallation dfHolder copyProcess'
     5 		resources dfHolder copyProcess installWhat'
     6 	classVariableNames:'LastBinDir LastLibBinDir LastLibDir LastFullDir'
     6 	classVariableNames:'LastBinDir LastLibBinDir LastLibDir LastFullDir'
     7 	poolDictionaries:''
     7 	poolDictionaries:''
     8 	category:'eXept-tools'
     8 	category:'eXept-tools'
     9 !
     9 !
    10 
    10 
   120 
   120 
   121 directoriesToMake
   121 directoriesToMake
   122     |dirsToMake|
   122     |dirsToMake|
   123 
   123 
   124     dirsToMake := OrderedCollection new.
   124     dirsToMake := OrderedCollection new.
   125     fullInstallation ifTrue:[
   125     installWhat == #full ifTrue:[
   126         dirsToMake add:fullDir.
   126         dirsToMake add:fullDir.
   127     ] ifFalse:[
   127     ] ifFalse:[
   128         dirsToMake add:stxBinDir.
   128         dirsToMake add:stxBinDir.
   129         dirsToMake add:stxLibDir.
   129         dirsToMake add:stxLibDir.
   130         dirsToMake add:stxLibBinDir.
   130         dirsToMake add:stxLibBinDir.
   263 !STXInstaller methodsFor:'installing'!
   263 !STXInstaller methodsFor:'installing'!
   264 
   264 
   265 changeWritability
   265 changeWritability
   266     |msg|
   266     |msg|
   267 
   267 
   268     fullInstallation ifTrue:[
   268     installWhat == #full ifTrue:[
   269         msg := (resources array:#('ST/X Installation' '' 'making target dir writable' '' '' '')) asStringCollection.
   269         msg := (resources array:#('ST/X Installation' '' 'making target dir writable' '' '' '')) asStringCollection.
   270 
   270 
   271         commandTraceView showCR:(resources string:'making target dir writable ...').
   271         commandTraceView showCR:(resources string:'making target dir writable ...').
   272         commandTraceView endEntry.
   272         commandTraceView endEntry.
   273         OperatingSystem executeCommand:('(cd ' , fullDir , ' ; find . -exec chmod u+w {} \;)').
   273         OperatingSystem executeCommand:('(cd ' , fullDir , ' ; find . -exec chmod u+w {} \;)').
   280 copyFiles
   280 copyFiles
   281     |msg fileSpec filesToCopy numFiles nDone cmd|
   281     |msg fileSpec filesToCopy numFiles nDone cmd|
   282 
   282 
   283      msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection.
   283      msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection.
   284 
   284 
   285     fullInstallation ifTrue:[
   285     installWhat == #full ifTrue:[
   286         msg at:4 put:('    all from CD' asText allBold).
   286         msg at:4 put:('    all from CD' asText allBold).
   287         msg at:6 put:'    ' , (fullDir asText allBold).
   287         msg at:6 put:'    ' , (fullDir asText allBold).
   288         actionTextHolder value:nil.
   288         actionTextHolder value:nil.
   289         actionTextHolder value:msg.
   289         actionTextHolder value:msg.
   290 
   290 
   449 
   449 
   450     msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection.
   450     msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection.
   451 
   451 
   452     commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...').
   452     commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...').
   453     commandTraceView endEntry.
   453     commandTraceView endEntry.
   454     fullInstallation ifTrue:[
   454     installWhat == #full ifTrue:[
   455         OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)').
   455         OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)').
   456     ] ifFalse:[
   456     ] ifFalse:[
   457         OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)').
   457         OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)').
   458     ].
   458     ].
   459 
   459 
   577 !
   577 !
   578 
   578 
   579 askForDestination
   579 askForDestination
   580     "open a dialog to enter destination directories"
   580     "open a dialog to enter destination directories"
   581 
   581 
   582     fullInstallation ifTrue:[
   582     installWhat == #full ifTrue:[
   583         ^ self askForDestinationForFullInstallation
   583         ^ self askForDestinationForFullInstallation
   584     ] ifFalse:[
   584     ] ifFalse:[
   585         ^ self askForDestinationForPartialInstallation
   585         ^ self askForDestinationForPartialInstallation
   586     ]
   586     ]
   587 
   587 
   907     d addHorizontalLine.
   907     d addHorizontalLine.
   908 
   908 
   909 
   909 
   910     d addHelpButtonFor:'STXInstaller/installHelp.html';
   910     d addHelpButtonFor:'STXInstaller/installHelp.html';
   911       addAbortButton; 
   911       addAbortButton; 
   912       addOkButton:(Button label:(resources string:'install full') action:[fullInstallation:=true]);
   912       addOkButton:(Button label:(resources string:'full') action:[installWhat := #full]);
   913       addOkButtonLabelled:(resources string:'install partial').
   913       addOkButtonLabelled:(resources string:'partial').
   914     d extent:500@400.
   914     d extent:500@400.
   915 
   915 
   916     d allViewBackground:dark.
   916     d allViewBackground:dark.
   917 
   917 
   918     fullInstallation := false.
   918     installWhat := #partial.
   919     d openAtCenter.
   919     d openAtCenter.
   920     d accepted ifTrue:[
   920     d accepted ifTrue:[
   921         d destroy.
   921         d destroy.
   922         ^ true
   922         ^ true
   923     ].
   923     ].
   936     "look if there is another installation and confirm
   936     "look if there is another installation and confirm
   937      reinstalling; return true if ok, false if not"
   937      reinstalling; return true if ok, false if not"
   938 
   938 
   939     |whichDir canOverWrite whatToDo box|
   939     |whichDir canOverWrite whatToDo box|
   940 
   940 
   941     fullInstallation ifTrue:[
   941     installWhat == #full ifTrue:[
   942         whichDir := fullDir.
   942         whichDir := fullDir.
   943         canOverWrite := false.
   943         canOverWrite := false.
   944     ] ifFalse:[
   944     ] ifFalse:[
   945         whichDir := stxLibDir.
   945         whichDir := stxLibDir.
   946         canOverWrite := true.
   946         canOverWrite := true.
  1015     textView := HVScrollableView for:TextCollector in:v.
  1015     textView := HVScrollableView for:TextCollector in:v.
  1016     textView origin:0.0@0.0 corner:1.0@1.0.
  1016     textView origin:0.0@0.0 corner:1.0@1.0.
  1017     textView bottomInset:30.
  1017     textView bottomInset:30.
  1018     commandTraceView := textView scrolledView.
  1018     commandTraceView := textView scrolledView.
  1019 
  1019 
  1020     fullInstallation ifTrue:[
  1020     installWhat == #full ifTrue:[
  1021         dirToMonitor := fullDir.
  1021         dirToMonitor := fullDir.
  1022     ] ifFalse:[
  1022     ] ifFalse:[
  1023         dirToMonitor := stxLibDir
  1023         dirToMonitor := stxLibDir
  1024     ].
  1024     ].
  1025 
  1025 
  1100               Processor activeProcess withPriority:7 do:[
  1100               Processor activeProcess withPriority:7 do:[
  1101                   [
  1101                   [
  1102                       actionPercentageHolder := progressValue.
  1102                       actionPercentageHolder := progressValue.
  1103                       actionTextHolder := currentAction.
  1103                       actionTextHolder := currentAction.
  1104 
  1104 
  1105                       fullInstallation ifFalse:[
  1105                       installWhat == #full ifFalse:[
  1106                             self outputInitialMessage.
  1106                             self outputInitialMessage.
  1107                       ].
  1107                       ].
  1108 
  1108 
  1109                       (self createDirectories) ifTrue:[
  1109                       (self createDirectories) ifTrue:[
  1110                           doDfMonitoring := true.
  1110                           doDfMonitoring := true.
  1172 
  1172 
  1173     msg := (resources string:'ST/X Installation complete.\\') withCRs.
  1173     msg := (resources string:'ST/X Installation complete.\\') withCRs.
  1174     shInfo := ''.
  1174     shInfo := ''.
  1175     cshInfo := ''.
  1175     cshInfo := ''.
  1176 
  1176 
  1177     fullInstallation ifTrue:[
  1177     installWhat == #full ifTrue:[
  1178         msg := msg , 'You will now find a development directory hierarchy
  1178         msg := msg , 'You will now find a development directory hierarchy
  1179 in ''' , fullDir asText allBold , '''.
  1179 in ''' , fullDir asText allBold , '''.
  1180 
  1180 
  1181 To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk''
  1181 To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk''
  1182 and start smalltalk with the command: ''./smalltalk''.
  1182 and start smalltalk with the command: ''./smalltalk''.