STXInstaller.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 1779 f3237e4844d9
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

- All source *.st files are now Unicode UTF8 without BOM
Files are in two groups (fileOut works this way in Smalltalk/X):
- containing a unicode character have "{ Encoding: utf8 }" at the header
- ASCII only are without the header
     1 "{ Package: 'stx:libtool2' }"
     2 
     3 Object subclass:#STXInstaller
     4 	instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir stxPkgDir stxDocDir stxTopDir
     5 		installDocFiles installSourceFiles installSTCFiles
     6 		installGoodyFiles fullDir actionPercentageHolder actionTextHolder
     7 		commandTraceView resources dfHolder copyProcess installWhat'
     8 	classVariableNames:'LastPartialDir LastFullDir'
     9 	poolDictionaries:''
    10 	category:'eXept-tools'
    11 !
    12 
    13 
    14 !STXInstaller class methodsFor:'startup'!
    15 
    16 open
    17     ^ self new open
    18 
    19     "
    20      STXInstaller open
    21     "
    22 ! !
    23 
    24 !STXInstaller methodsFor:'defaults'!
    25 
    26 defaultBinDirs
    27     |dirs stxRel|
    28 
    29     stxRel := self smalltalkRelease.
    30     dirs := OrderedCollection new.
    31 
    32     OperatingSystem isMSWINDOWSlike ifTrue:[
    33         dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel , '\bin'.
    34         dirs add:'c:\Programme\SmalltalkX\' , stxRel , '\bin'.
    35         dirs add:'c:\SmalltalkX\' , stxRel , '\bin'.
    36     ] ifFalse:[
    37         dirs add:'/opt/smalltalk/' , stxRel , '/bin'.
    38         dirs add:'/usr/local/bin'.
    39         dirs add:'/usr/bin'.
    40 
    41         dirs add:(Filename homeDirectory constructString:'bin').
    42         dirs add:((Filename homeDirectory construct:'stx') constructString:'bin').
    43         dirs add:'/tmp/stxbin'.
    44         ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
    45             dirs add:'/home/stx/bin'.
    46         ].
    47         ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
    48             dirs add:'/home2/stx/bin'.
    49         ].
    50     ].
    51 
    52 "/    dirs := dirs select:[:path | 
    53 "/                            |f|
    54 "/
    55 "/                            f := path asFilename.
    56 "/                            f exists and:[f isDirectory]].
    57     ^ dirs "sort"
    58 
    59     "Created: / 18.7.1996 / 19:43:00 / cg"
    60     "Modified: / 31.5.1999 / 12:11:48 / cg"
    61 !
    62 
    63 defaultFullDirs
    64     |dirs|
    65 
    66     dirs := OrderedCollection new.
    67 
    68     dirs add:((Filename homeDirectory constructString:'stxDevelop')).
    69     dirs add:((Filename homeDirectory constructString:'develop')).
    70     dirs add:((Filename homeDirectory constructString:'work')).
    71 
    72 "/    ('/home' asFilename exists 
    73 "/    and:['/home' asFilename isDirectory]) ifTrue:[
    74 "/        dirs add:'/home/work'.
    75 "/    ].
    76 
    77     ^ dirs "sort"
    78 
    79     "Modified: / 18.7.1996 / 19:45:08 / cg"
    80     "Created: / 25.2.1998 / 17:14:43 / cg"
    81 !
    82 
    83 defaultInstDirs
    84     |dirs d stxRel|
    85 
    86     stxRel := self smalltalkRelease.
    87     dirs := OrderedCollection new.
    88 
    89     OperatingSystem isMSWINDOWSlike ifTrue:[
    90         dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel.
    91         dirs add:'c:\Programme\SmalltalkX\' , stxRel.
    92         dirs add:'c:\SmalltalkX\' , stxRel.
    93     ] ifFalse:[
    94         dirs add:'/opt/smalltalk/' , stxRel.
    95         dirs add:'/usr/local/smalltalkX'.
    96 
    97         d := (Filename homeDirectory constructString:'smalltalkX').
    98         (dirs includes:d) ifFalse:[dirs add:d].
    99         d := (Filename homeDirectory constructString:'stx').
   100         (dirs includes:d) ifFalse:[dirs add:d].
   101         d := '/tmp/stx'.
   102         (dirs includes:d) ifFalse:[dirs add:d].
   103         ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
   104             d := '/home/stx'.
   105             (dirs includes:d) ifFalse:[dirs add:d].
   106         ].
   107         ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
   108             d := '/home2/stx'.
   109             (dirs includes:d) ifFalse:[dirs add:d].
   110         ].
   111     ].
   112 
   113 "/    dirs := dirs select:[:path | 
   114 "/                            |f|
   115 "/
   116 "/                            f := path asFilename.
   117 "/                            f exists and:[f isDirectory]].
   118     ^ dirs "sort"
   119 
   120     "Created: / 18.7.1996 / 19:43:00 / cg"
   121     "Modified: / 31.5.1999 / 18:32:17 / cg"
   122 !
   123 
   124 defaultLibBinDirs
   125     |dirs stxRel|
   126 
   127     stxRel := self smalltalkRelease.
   128     dirs := OrderedCollection new.
   129     OperatingSystem isMSWINDOWSlike ifTrue:[
   130         dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel , '\lib'.
   131         dirs add:'c:\Programme\SmalltalkX\' , stxRel , '\lib'.
   132         dirs add:'c:\SmalltalkX\' , stxRel , '\lib'.
   133     ] ifFalse:[
   134         dirs add:'/opt/smalltalk/' , stxRel , '/lib'.
   135         dirs add:'/usr/local/lib'.
   136         dirs add:'/usr/lib'.
   137         dirs add:'/lib'.
   138         dirs add:(Filename homeDirectory constructString:'lib').
   139 
   140         dirs add:((Filename homeDirectory construct:'stx') constructString:'lib').
   141         dirs add:'/tmp/stxlib'.
   142         dirs add:'/home/stx/lib'.
   143         dirs add:'/home2/stx/lib'.
   144     ].
   145     ^ dirs sort
   146 
   147     "Created: / 18.7.1996 / 19:43:21 / cg"
   148     "Modified: / 31.5.1999 / 12:12:17 / cg"
   149 !
   150 
   151 defaultLibDirs
   152     |dirs stxRel|
   153 
   154     stxRel := self smalltalkRelease.
   155     dirs := OrderedCollection new.
   156     OperatingSystem isMSWINDOWSlike ifTrue:[
   157         dirs add:'c:\Programme\eXept\SmalltalkX\' , stxRel , '\lib'.
   158         dirs add:'c:\Programme\SmalltalkX\' , stxRel , '\lib'.
   159         dirs add:'c:\SmalltalkX\' , stxRel , '\lib'.
   160     ] ifFalse:[
   161         dirs add:'/opt/smalltalk/' , stxRel , '/lib'.
   162         dirs add:'/usr/local/lib/smalltalk'.
   163         dirs add:'/usr/lib/smalltalk'.
   164         dirs add:((Filename homeDirectory construct:'lib') constructString:'smalltalk').
   165         dirs add:((Filename homeDirectory construct:'stx') constructString:'lib').
   166         dirs add:'/tmp/stxlib'.
   167         dirs add:'/home/stx/lib'.
   168         dirs add:'/home2/stx/lib'.
   169     ].
   170 
   171 "/    dirs := dirs select:[:path | 
   172 "/                            |f|
   173 "/
   174 "/                            f := path asFilename.
   175 "/                            f exists and:[f isDirectory]].
   176     ^ dirs "sort"
   177 
   178     "Created: / 18.7.1996 / 19:43:21 / cg"
   179     "Modified: / 31.5.1999 / 12:12:30 / cg"
   180 !
   181 
   182 directoriesToMake
   183     |dirsToMake docDir docOnlineDir|
   184 
   185     dirsToMake := OrderedCollection new.
   186     installWhat == #full ifTrue:[
   187         dirsToMake add:fullDir.
   188     ] ifFalse:[
   189         dirsToMake add:stxBinDir.
   190         dirsToMake add:stxLibDir.
   191         stxLibDir ~= stxLibBinDir ifTrue:[
   192             dirsToMake add:stxLibBinDir.
   193         ].
   194         dirsToMake add:stxDocDir.
   195         docOnlineDir := stxDocDir asFilename construct:'online'.
   196         dirsToMake add:docOnlineDir name.
   197         dirsToMake add:(docOnlineDir constructString:'english').
   198         dirsToMake add:(docOnlineDir constructString:'german').
   199         installDocFiles ifTrue:[
   200             dirsToMake add:(docOnlineDir constructString:'french').
   201             dirsToMake add:(docOnlineDir constructString:'italian').
   202         ]
   203     ].
   204     ^ dirsToMake
   205 
   206     "Modified: / 31.5.1999 / 17:52:03 / cg"
   207 !
   208 
   209 listOfOptionalPackages
   210     ^ #(
   211         'libDB'
   212         'clients/CBrowser'
   213         'libcompat'
   214         'libxt'
   215 
   216 
   217         "/ mhmh - these should not be needed here ...
   218 
   219         'projects/smalltalk/bitmaps/javaImages'
   220         'doc/online/english/overview/icons'
   221       )
   222 
   223     "Created: 2.3.1997 / 12:39:59 / cg"
   224     "Modified: 2.3.1997 / 13:24:41 / cg"
   225 !
   226 
   227 smalltalkRelease
   228     ^ Smalltalk majorVersionNr printString 
   229                , '.' , Smalltalk minorVersionNr printString
   230                , '.' , Smalltalk revisionNr printString.
   231 !
   232 
   233 specOfCommonFilesToCopy
   234     |fileSpec|
   235 
   236     fileSpec := #(
   237                 "/ name                             destination  subDir             required mode      
   238                 ( 'projects/smalltalk/include'          #lib     nil                  true  '644' )
   239                 ( 'projects/smalltalk/*.rc'             #lib     nil                  true  '644' )
   240                 ( 'projects/smalltalk/*.wsp'            #lib     nil                  true  '644' )
   241                 ( 'projects/smalltalk/banner*.xpm'      #lib     nil                  true  '644' )
   242                 ( 'projects/smalltalk/patches'          #lib     nil                  true  '644' )
   243                 ( 'COPYRIGHT'                           nil      nil                  true  '644' )
   244                 ( 'RELEASE'                             nil      nil                  true  '644' )
   245                 ( 'doc/online/german/LICENCE_STX.html'  nil           'doc/online/german'      true  '644' )
   246                 ( 'doc/online/english/LICENCE_STX.html' nil           'doc/online/english'     true  '644' )
   247                 ( 'doc/online/german/LICENCE_DEMO_STX.html'  nil      'doc/online/german'      true  '644' )
   248                 ( 'doc/online/english/LICENCE_DEMO_STX.html' nil      'doc/online/english'     true  '644' )
   249     ).
   250 
   251     installDocFiles ifTrue:[
   252         fileSpec := fileSpec , #(
   253                 ( 'doc'                                  nil     nil        false '644' )
   254         ).
   255     ].
   256 
   257     installSTCFiles ifTrue:[
   258         fileSpec := fileSpec , #(
   259                 ( 'include'                                  #lib        nil              false '644' )
   260                 ( 'configurations'                           #lib        nil              false '644' )
   261                 ( 'configurations/PACKS'                     #lib        'configurations' false '644' )
   262                 ( 'configurations/my*'                       #lib        'configurations' false '644' )
   263                 ( 'configurations/vendor*'                   #lib        'configurations' false '644' )
   264                 ( 'rules'                                    #lib        nil              false '644' )
   265         ).
   266     ].
   267 
   268     installGoodyFiles ifTrue:[
   269         fileSpec := fileSpec , #(
   270                 ( 'goodies/*.st'                  #pkg     'stx/goodies/source'       false '644' )
   271                 ( 'goodies/*.chg'                 #pkg     'stx/goodies/source'       false '644' )
   272         ).
   273     ].
   274 
   275 
   276     ^ fileSpec
   277 
   278     "Created: / 2.5.1999 / 13:17:37 / cg"
   279     "Modified: / 24.12.1999 / 01:16:42 / cg"
   280 !
   281 
   282 specOfFilesToCopy
   283     OperatingSystem isMSWINDOWSlike ifTrue:[
   284         ^ self specOfWindowsFilesToCopy
   285     ].
   286     ^ self specOfUnixFilesToCopy
   287 
   288     "Modified: / 2.5.1999 / 13:17:59 / cg"
   289 !
   290 
   291 specOfUnixFilesToCopy
   292     |fileSpec|
   293 
   294     fileSpec := self specOfCommonFilesToCopy.
   295 
   296     fileSpec := fileSpec , #(
   297                 "/ name                             destination  subDir             required mode      
   298                 ( 'projects/smalltalk/smalltalk'        #bin     nil                  true  '755' )
   299                 ( 'projects/smalltalk/stx'              #bin     nil                  true  '755' )
   300                 ( 'librun/librun.so'                    #lib     'lib'                true  '644' )
   301     ).
   302 
   303     installSTCFiles ifTrue:[
   304         fileSpec := fileSpec , #(
   305                 ( 'stc/stc'                                  #bin        nil              false '755' )
   306                 ( 'rules/stmkmp'                             #bin        nil              false '755' )
   307                 ( 'rules/stmkmf'                             #bin        nil              false '755' )
   308                 ( 'configurations/COMMON'                    #lib        'configurations' false '644' )
   309                 ( 'configurations/PACKS'                     #lib        'configurations' false '644' )
   310                 ( 'configurations/my*'                       #lib        'configurations' false '644' )
   311                 ( 'configurations/vendor*'                   #lib        'configurations' false '644' )
   312 
   313                 ( 'support/VGL/vogl/src/libvogl.*'           #lib        'lib'            false '644' )
   314                 ( 'support/VGL/vogl/src/*.h'                 #lib        'include'        false '644' )
   315                 ( 'support/DLD/dld-3.2.5/libdld.*'           #lib        'lib'            false '644' )
   316 
   317                 ( 'goodies/persistency/db-1.6/PORT/libdb.*'  #libBin     'lib'            false '644' )
   318 
   319 "/                ( 'librun/librun.o'                          #libBin     nil              false '644' )
   320 "/                ( 'librun/librun.a'                          #libBin     nil              false '644' )
   321         ).
   322     ].
   323 
   324     installGoodyFiles ifTrue:[
   325         fileSpec := fileSpec , #(
   326                 ( 'goodies/rdoit/rdoit'           #bin     nil        false '755' )
   327                 ( 'goodies/xml/indelv/abbrev.stc' #pkg     'stx/goodies/xml/indelv'   true  )
   328         ).
   329     ] ifFalse:[
   330         fileSpec := fileSpec , #(
   331                 ( 'goodies/persistency/libdbase.so'  #pkg     'stx/goodies/persistency' true '644' )
   332         ).
   333     ].
   334 
   335     ^ fileSpec
   336 
   337     "Modified: / 30.4.1999 / 18:02:22 / cg"
   338     "Created: / 2.5.1999 / 13:17:37 / cg"
   339 !
   340 
   341 specOfWindowsFilesToCopy
   342     |fileSpec|
   343 
   344     fileSpec := self specOfCommonFilesToCopy.
   345 
   346     fileSpec := fileSpec , #(
   347                 "/ name                             destination  subDir             required       
   348                 ( 'projects\smalltalk\smalltalk.bat'    #bin     nil                  true   )
   349                 ( 'projects\smalltalk\stx.exe'          #bin     nil                  true   )
   350                 ( 'projects\smalltalk\winstx.exe'       #bin     nil                  true   )
   351                 ( 'projects\smalltalk\stxspawn.exe'     #bin     nil                  true   )
   352                 ( 'projects\smalltalk\*.dll'            #bin     nil                  true   )
   353     ).
   354 
   355     installSTCFiles ifTrue:[
   356         fileSpec := fileSpec , #(
   357                 ( 'projects\smalltalk\stc.exe'           #bin        nil              false  )
   358                 ( 'libbc\*.lib'                          #lib        nil              false  )
   359                 ( 'rules'                                #lib        nil              false  )
   360         ).
   361     ].
   362 
   363     installGoodyFiles ifTrue:[
   364         fileSpec := fileSpec , #(
   365                 ( 'goodies/rdoit/rdoit.exe'              #bin     nil                 false )
   366         ).
   367     ].
   368 
   369     ^ fileSpec
   370 
   371     "Created: / 2.5.1999 / 13:23:06 / cg"
   372     "Modified: / 16.10.2001 / 12:25:58 / cg"
   373 ! !
   374 
   375 !STXInstaller methodsFor:'installing'!
   376 
   377 add:specEntry toFileSpec:fileSpec
   378     (specEntry first startsWith:'./') ifTrue:[
   379         specEntry at:1 put:(specEntry first copyFrom:3).
   380     ].
   381     (specEntry first startsWith:'.\') ifTrue:[
   382         specEntry at:1 put:(specEntry first copyFrom:3).
   383     ].
   384     (fileSpec includes:specEntry) ifFalse:[
   385         fileSpec add:specEntry
   386     ] ifTrue:[
   387         "/ self halt
   388     ]
   389 !
   390 
   391 addFilesToSpec:fileSpec relativeTo:rel fromINSTALLSpec:f
   392     |s entry t cond dst|
   393 
   394     s := f asFilename readStream.
   395     s isNil ifTrue:[^  self].
   396     [s atEnd] whileFalse:[
   397         entry := s nextLine.
   398         (entry startsWith:$#) ifFalse:[
   399             t := entry asCollectionOfWords.
   400             t size >= 2 ifTrue:[
   401                 cond := t at:3 ifAbsent:nil.
   402                 (cond ~= 'optionalSource' 
   403                  or:[installSourceFiles]) ifTrue:[
   404                     ((rel startsWith:'goodies/') not
   405                     or:[installGoodyFiles]) ifTrue:[
   406                         dst := t at:2.
   407                         (dst startsWith:'packages/stx/') ifTrue:[
   408                             self add:(Array 
   409                                             with:(rel asFilename constructString:(t at:1))
   410                                             with:#pkg
   411                                             with:('stx' asFilename constructString:(dst copyFrom:'packages/stx/' size+1))
   412                                             with:true)
   413                                  toFileSpec:fileSpec.
   414                         ] ifFalse:[
   415                             ((dst = 'bin') or:[dst startsWith:'bin/']) ifTrue:[
   416                                 (dst = 'bin') ifTrue:[
   417                                     self add:(Array 
   418                                                     with:(rel asFilename constructString:(t at:1))
   419                                                     with:#bin
   420                                                     with:nil
   421                                                     with:true)
   422                                          toFileSpec:fileSpec.
   423                                 ] ifFalse:[
   424                                     self add:(Array 
   425                                                     with:(rel asFilename constructString:(t at:1))
   426                                                     with:#bin
   427                                                     with:(dst copyFrom:'bin/' size+1)
   428                                                     with:true)
   429                                          toFileSpec:fileSpec.
   430                                 ].
   431                             ] ifFalse:[
   432                                 ((dst = 'lib') or:[dst startsWith:'lib/']) ifTrue:[
   433                                     (dst = 'lib') ifTrue:[
   434                                         self add:(Array 
   435                                                         with:(rel asFilename constructString:(t at:1))
   436                                                         with:#lib
   437                                                         with:nil
   438                                                         with:true)
   439                                              toFileSpec:fileSpec.
   440                                     ] ifFalse:[
   441                                         self add:(Array 
   442                                                         with:(rel asFilename constructString:(t at:1))
   443                                                         with:#lib
   444                                                         with:(dst copyFrom:'lib/' size+1)
   445                                                         with:true)
   446                                              toFileSpec:fileSpec.
   447                                     ]
   448                                 ] ifFalse:[
   449                                     self halt:'unhandled destination: ' , dst.
   450                                 ]
   451                             ]
   452                         ]
   453                     ]
   454                 ].
   455             ].
   456         ].
   457     ].
   458     s close.
   459 !
   460 
   461 changeWritability
   462     |msg|
   463 
   464     installWhat == #full ifTrue:[
   465         msg := (resources array:#('ST/X Installation' '' 'making target dir writable' '' '' '')) asStringCollection.
   466 
   467         commandTraceView showCR:(resources string:'making target dir writable ...').
   468         commandTraceView endEntry.
   469         OperatingSystem executeCommand:('(cd ' , fullDir , ' ; find . -exec chmod u+w {} \;)').
   470     ].
   471 
   472     "Created: / 17.7.1996 / 15:24:19 / cg"
   473     "Modified: / 20.4.1998 / 15:40:00 / cg"
   474 !
   475 
   476 copyFiles
   477     |msg fileSpec filesToCopy numFiles nDone cmd topDir topDirPrefix|
   478 
   479     msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection.
   480 
   481     OperatingSystem isUNIXlike ifTrue:[
   482         topDir := '../..'.
   483         topDirPrefix := '../../'.
   484     ] ifFalse:[
   485         topDir := '..\..'.
   486         topDirPrefix := '..\..\'.
   487     ].
   488 
   489     installWhat == #full ifTrue:[
   490         "/ MUST be under stx (for packagePath stuff)
   491         fullDir asFilename baseName ~= 'stx' ifTrue:[
   492             fullDir := fullDir asFilename constructString:'stx'.
   493         ].
   494         fullDir asFilename recursiveMakeDirectory.
   495         fullDir asFilename exists ifFalse:[
   496             self warn:'Oops - failed to create directory: ' , fullDir.
   497             ^ false
   498         ].
   499 
   500         msg at:4 put:('    all from CD' asText allBold).
   501         msg at:6 put:'    ' , (fullDir asText allBold).
   502         actionTextHolder value:nil.
   503         actionTextHolder value:msg.
   504 
   505         actionPercentageHolder value:-1.
   506         OperatingSystem isUNIXlike ifTrue:[
   507             cmd := '(cd ' , topDir , '/doc/online ; find . -type s -exec rm {} \; )'.
   508             commandTraceView showCR:'removing symbolic links ...'.
   509             commandTraceView endEntry.
   510             self executeCommandAndShowOutput:cmd emphasize:false.
   511 
   512             cmd := '(cd ' , topDir , ' ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'.
   513             commandTraceView showCR:'copying ...'.
   514             commandTraceView endEntry.
   515             cmd := cmd , ' 2>&1' .
   516 
   517             self executeCommandAndShowOutput:cmd emphasize:false.
   518 
   519             cmd := '(cd ' , fullDir , '/doc/online ; make )'.
   520             commandTraceView showCR:'creating symbolic links ...'.
   521             commandTraceView endEntry.
   522             self executeCommandAndShowOutput:cmd emphasize:false.
   523 
   524         ] ifFalse:[
   525             fullDir asFilename exists ifFalse:[
   526                 commandTraceView showCR:(resources string:'creating %1 ...' with:fullDir asFilename pathName).
   527                 commandTraceView endEntry.
   528                 OperatingSystem recursiveCreateDirectory:fullDir asFilename pathName
   529             ].
   530             self recursiveCopy:(topDir , '\*') to:fullDir.
   531         ].
   532         actionPercentageHolder value:100.
   533         ^ true
   534     ].
   535 
   536     fileSpec := self specOfFilesToCopy asOrderedCollection.
   537 
   538     actionPercentageHolder value:0.
   539     "/ search for INSTALL.files specs, and add to list ...
   540     actionTextHolder value:nil.
   541     actionTextHolder value:(resources array:#('ST/X Installation' '' 'searching for packages to install...' '' '' '')) asStringCollection.
   542 
   543     topDir asFilename recursiveDirectoryContentsDo:[:f |
   544         f asFilename baseName = 'INSTALL.files' ifTrue:[
   545             self addFilesToSpec:fileSpec relativeTo:f asFilename directoryName fromINSTALLSpec:(topDir asFilename construct:f).
   546         ]
   547     ].
   548 
   549     filesToCopy := OrderedCollection new.
   550 
   551     fileSpec do:[:entry |
   552         |fileNames dest subDir required destDir|
   553 
   554         fileNames := entry at:1.
   555         dest := entry at:2.
   556         subDir := entry at:3.
   557         required := entry at:4.
   558 
   559         dest == #bin ifTrue:[
   560             destDir := stxBinDir
   561         ] ifFalse:[
   562             dest == #libBin ifTrue:[
   563                 destDir := stxLibBinDir
   564             ] ifFalse:[
   565                 dest == #pkg ifTrue:[
   566                     destDir := stxPkgDir
   567                 ] ifFalse:[
   568                     dest == nil ifTrue:[
   569                         destDir := stxTopDir
   570                     ] ifFalse:[
   571                         destDir := stxLibDir
   572                     ]
   573                 ]
   574             ]
   575         ].
   576         
   577         destDir := destDir asFilename.
   578         subDir notNil ifTrue:[
   579             destDir := destDir construct:subDir
   580         ].
   581 
   582         filesToCopy add:(fileNames -> destDir pathName)
   583     ].
   584 
   585     numFiles := filesToCopy size.
   586     nDone := 0.
   587 
   588     filesToCopy do:[:entry |
   589         |fileName destDir cmd|
   590 
   591         fileName := entry key.
   592         destDir := entry value.
   593 
   594         ((fileName includes:$*)
   595         or:[(topDirPrefix , fileName) asFilename exists])ifTrue:[
   596             actionPercentageHolder value:(nDone / numFiles * 100) rounded.
   597 
   598             msg at:4 put:'    ' , (fileName asText allBold).
   599             msg at:6 put:'    ' , (destDir asText allBold).
   600             actionTextHolder value:nil.
   601             actionTextHolder value:msg.
   602 
   603             ((fileName includes:$*) not
   604             and:[(topDirPrefix , fileName) asFilename exists not]) ifTrue:[
   605                 (self listOfOptionalPackages includes:fileName) ifFalse:[
   606                     commandTraceView showCR:('cannot copy ' , fileName , ' - not included in distribution').
   607                     commandTraceView endEntry.
   608                 ]
   609             ] ifFalse:[
   610                 destDir asFilename exists ifFalse:[
   611                     commandTraceView showCR:(resources string:'creating %1 ...' with:destDir asFilename pathName).
   612                     commandTraceView endEntry.
   613                     OperatingSystem recursiveCreateDirectory:destDir asFilename pathName
   614                 ].
   615                 self recursiveCopy:(topDirPrefix , fileName) to:destDir.
   616             ]
   617         ].
   618 
   619         nDone := nDone + 1
   620     ].
   621 
   622     ^ true
   623 
   624     "
   625      STXInstaller open
   626     "
   627 
   628     "Created: / 17.7.1996 / 15:16:20 / cg"
   629     "Modified: / 31.5.1999 / 18:07:33 / cg"
   630 !
   631 
   632 createDirectories
   633     |msg dirsToMake numDirs nDone|
   634 
   635     msg := (resources array:#('ST/X Installation' '' 'creating directory:' '' '' '')) asStringCollection.
   636 
   637     dirsToMake := self directoriesToMake.
   638 
   639     numDirs := dirsToMake size.
   640     nDone := 0.
   641 
   642     dirsToMake do:[:dirName |
   643         |d errMsg stop box|
   644 
   645         actionPercentageHolder value:(nDone / numDirs * 100) rounded.
   646 
   647         msg at:4 put:'    ' , (dirName asText allBold).
   648         actionTextHolder value:nil.
   649         actionTextHolder value:msg.
   650 
   651         d := dirName asFilename.
   652 
   653         commandTraceView showCR:(resources string:'creating %1 ...' with:d pathName).
   654         commandTraceView endEntry.
   655 
   656         d exists ifFalse:[
   657             OperatingSystem recursiveCreateDirectory:d pathName
   658         ].
   659 
   660         d exists ifFalse:[
   661             errMsg := (resources string:'failed to create directory: %1\\Please check your permissions.' with:dirName) withCRs.
   662             stop := true
   663         ] ifTrue:[
   664             d isDirectory ifFalse:[
   665                 errMsg := resources string:'not a directory: %1' with:dirName.
   666                 stop := true
   667             ] ifTrue:[
   668                 (d isReadable
   669                 and:[d isWritable]) ifFalse:[
   670                     errMsg := resources string:'no read/write access to directory: %1' with:dirName.
   671                     stop := false
   672                 ] ifTrue:[
   673                     errMsg := nil
   674                 ]
   675             ]
   676         ].
   677 
   678         errMsg notNil ifTrue:[
   679             box := WarningBox new.
   680             box title:errMsg.
   681             box showAtPointerNotCovering:(WindowGroup activeGroup topViews first).
   682             stop ifTrue:[^ false].
   683         ].
   684 
   685         Delay waitForSeconds:0.25.
   686         nDone := nDone + 1.
   687     ].
   688     ^ true
   689 
   690     "Created: 17.7.1996 / 15:24:19 / cg"
   691     "Modified: 22.5.1997 / 15:06:41 / cg"
   692 !
   693 
   694 createRegistryEntries
   695     |release msg k|
   696 
   697     msg := (resources array:#('ST/X Installation' '' 'creating registry entries' '' '' '')) asStringCollection.
   698     actionTextHolder value:nil.
   699     actionTextHolder value:msg.
   700 
   701     commandTraceView showCR:(resources string:'creating registry entries...').
   702     commandTraceView endEntry.
   703 
   704     release := self smalltalkRelease.
   705 
   706     k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'.
   707     k isNil ifTrue:[
   708         self warn:'cannot update registry under HKEY_LOCAL_MACHINE\Software\eXept'.
   709         ^ self.
   710     ].
   711 
   712     k := k createSubKeyNamed:'eXept'.
   713     k := k createSubKeyNamed:'Smalltalk/X'.
   714     k valueNamed:'CurrentVersion' put:release.
   715 
   716     k := k createSubKeyNamed:release.
   717     k valueNamed:'LibDir' put:stxLibDir.
   718     k valueNamed:'BinDir' put:stxBinDir.
   719     k valueNamed:'DocDir' put:stxDocDir.
   720     k valueNamed:'PackageDirPath' put:stxPkgDir.
   721 
   722     "Modified: / 23.12.1999 / 22:21:18 / cg"
   723 !
   724 
   725 createSymbolicLinks
   726     |msg dirsToMake numDirs nDone languages cmd|
   727 
   728     OperatingSystem isUNIXlike ifFalse:[^ self].
   729 
   730     msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection.
   731     actionTextHolder value:nil.
   732     actionTextHolder value:msg.
   733 
   734     installWhat == #full ifTrue:[
   735         commandTraceView showCR:(resources string:'setting up symbolic links in doc...'); endEntry.
   736         OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)').
   737 
   738         commandTraceView showCR:(resources string:'setting up symbolic links in projects/smalltalk...'); endEntry.
   739         OperatingSystem executeCommand:('(cd ' , fullDir , '/projects/smalltalk ; ln -s ../../lib*/*.so .)').
   740         OperatingSystem executeCommand:('(cd ' , fullDir , '/projects/smalltalk ; ln -s ../../goodies/*/*.so .)').
   741         ^ self.
   742     ].
   743 "/        OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)').
   744 
   745     commandTraceView showCR:(resources string:'setting up symbolic links in lib...'); endEntry.
   746 
   747     #(
   748         'libbasic/libbasic.so'
   749         'libbasic2/libbasic2.so'
   750         'libbasic3/libbasic3.so'
   751         'libcomp/libcomp.so'
   752         'libboss/libboss.so'
   753         'libview/*.so'
   754         'libview2/libview2.so'
   755         'libwidg/libwidg.so'
   756         'libwidg2/libwidg2.so'
   757         'libwidg3/libwidg3.so'
   758         'libhtml/libhtml.so'
   759         'libui/libui.so'
   760         'libtool/libtool.so'
   761         'libtool2/libtool2.so'
   762         'goodies/persistency/libdbase.so'
   763     ) do:[:src |  |cmd|
   764         cmd := '(cd ' , stxLibDir , '/lib ; ln -s ../../packages/stx/' , src , ' . )'.
   765         commandTraceView showCR:cmd; endEntry.
   766         OperatingSystem executeCommand:cmd.
   767     ].
   768 
   769     installDocFiles ifTrue:[
   770         msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection.
   771         actionTextHolder value:nil.
   772         actionTextHolder value:msg.
   773 
   774         commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...'); endEntry.
   775 
   776         languages := #(
   777                         'english'
   778                         'german'
   779                         'french'
   780                         'italian'
   781                         'spanish'
   782                         'japanese'
   783                       ).
   784         languages := languages select:[:l | (stxDocDir , '/online/' , l) asFilename exists].
   785 
   786         languages do:[:thisLang |
   787             |langDir|
   788 
   789             langDir := stxDocDir , '/online/' , thisLang.
   790             languages do:[:otherLang |
   791                 otherLang ~= thisLang ifTrue:[
   792                     cmd := '(cd ' , langDir , ' ; ln -s ../' , otherLang , ' .)'.
   793                     commandTraceView showCR:cmd; endEntry.
   794                     OperatingSystem executeCommand:cmd.
   795                 ]
   796             ].
   797 
   798             cmd := '(cd ' , langDir , ' ; ln -s ../icons .)'.
   799             commandTraceView showCR:cmd; endEntry.
   800              OperatingSystem executeCommand:cmd.
   801 
   802             cmd := '(cd ' , langDir , ' ; ln -s ../pictures .)'.
   803             commandTraceView showCR:cmd; endEntry.
   804              OperatingSystem executeCommand:cmd.
   805         ]
   806     ]
   807     "Created: / 17.7.1996 / 15:24:19 / cg"
   808     "Modified: / 31.5.1999 / 14:46:36 / cg"
   809 !
   810 
   811 executeCommandAndShowOutput:cmd
   812     ^ self executeCommandAndShowOutput:cmd emphasize:true
   813 !
   814 
   815 executeCommandAndShowOutput:cmd emphasize:doEmphasize
   816     |doneSemaphore line p|
   817 
   818     OperatingSystem isMSWINDOWSlike ifTrue:[
   819         ^ self
   820     ].
   821 
   822     doneSemaphore := Semaphore new.
   823 
   824     copyProcess := [   
   825 
   826         p := PipeStream readingFrom:cmd.
   827         p isNil ifTrue:[
   828             self warn:('command error. Could not execute:\\' , cmd) withCRs.
   829         ] ifFalse:[
   830             [
   831                 [p atEnd] whileFalse:[
   832                     (p readWaitWithTimeout:0.1) ifFalse:[
   833                         line := p nextLine.
   834                         (line notNil and:[line notEmpty]) ifTrue:[
   835                             doEmphasize ifTrue:[
   836                                 line := line asText emphasizeAllWith:(#color->Color red).
   837                             ].
   838                             commandTraceView showCR:('  ' , line).
   839                             commandTraceView endEntry.
   840                         ]
   841                     ]
   842                 ].
   843                 p close.
   844             ] valueOnUnwindDo:[
   845                 p shutDown
   846             ]
   847         ].
   848         doneSemaphore signal.
   849         copyProcess := nil.
   850     ] forkAt:4.
   851 
   852     doneSemaphore wait.
   853 
   854     "Created: / 25.2.1998 / 17:46:06 / cg"
   855     "Modified: / 30.4.1999 / 18:00:43 / cg"
   856 !
   857 
   858 outputInitialMessage
   859 ^ self.
   860 
   861     #(
   862     'Notice:'
   863     ''
   864     'During the installation, you may get error messages'
   865     'complaining that some files where not found'
   866     'and could therefore not be copied.'
   867     ) do:[:line |
   868         commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)).
   869         commandTraceView endEntry. 
   870     ].
   871 
   872     Delay waitForSeconds:2.
   873 
   874     #(
   875     ''
   876     'This is normal behavior; since the CD may contain'
   877     'broken symbolic links to non-existing packages'
   878     'which are either not contained on your ordered'
   879     'package (i.e. non-commercial) or are not required'
   880     'for your architecture (and therefore not contained'
   881     'on the CD).'
   882     ''
   883     ) do:[:line |
   884         commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)).
   885         commandTraceView endEntry.
   886     ].
   887 
   888     Delay waitForSeconds:2.
   889 
   890     #(
   891     ''
   892     'Please excuse this inconvenience.'
   893     ''
   894     ) do:[:line |
   895         commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)).
   896         commandTraceView endEntry.
   897     ].
   898 
   899     Delay waitForSeconds:2.
   900 
   901     "Created: 2.3.1997 / 12:49:52 / cg"
   902     "Modified: 8.8.1997 / 17:47:06 / cg"
   903 !
   904 
   905 recursiveCopy:src to:dst
   906     self recursiveCopy:src to:dst print:true
   907 !
   908 
   909 recursiveCopy:src to:dst print:doPrint
   910     |cmd srcBaseName srcF dstF d|
   911 
   912     srcF := src asFilename.
   913     dstF := dst asFilename.
   914 
   915     srcF directory exists ifFalse:[
   916         ^ self
   917     ].
   918 
   919     srcBaseName := srcF baseName.
   920     (srcBaseName startsWith:'.#') ifTrue:[^ self].
   921 
   922     (#(
   923         'CVS'
   924         'not_delivered'
   925         '.cvsignore'
   926         '.dir.info'
   927     ) includes:srcBaseName) ifTrue:[
   928         ^ self
   929     ].
   930 
   931     srcBaseName includesMatchCharacters ifTrue:[
   932         doPrint ifTrue:[
   933             OperatingSystem isUNIXlike ifTrue:[
   934                 commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName).
   935             ] ifFalse:[
   936                 commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName).
   937             ].
   938             commandTraceView endEntry.
   939         ].
   940 
   941         (srcF directory directoryContents ? #()) do:[:fileName |
   942             (srcBaseName match:fileName) ifTrue:[
   943                 (#(
   944                     'CVS'
   945                     'not_delivered'
   946                 ) includes:fileName) ifFalse:[
   947                     self 
   948                         recursiveCopy:(srcF directory construct:fileName) 
   949                         to:dstF
   950                         print:doPrint
   951                 ]
   952             ]
   953         ]
   954     ] ifFalse:[
   955         srcF isDirectory ifFalse:[
   956             (dstF exists and:[dstF isDirectory]) ifTrue:[
   957                 dstF := dstF construct:srcBaseName.
   958             ].
   959             "/ special check for windows bug
   960             "/ (lists trans.tbl files, but wont find it later)
   961             srcF exists ifTrue:[
   962                 Object errorSignal handle:[:ex |
   963                     commandTraceView showCR:('*** Error: ' , ex errorString)
   964                 ] do:[
   965                     srcF copyTo:dstF.
   966                 ]
   967             ].
   968             OperatingSystem isUNIXlike ifTrue:[
   969                 srcF isExecutable ifTrue:[
   970                     dstF makeExecutableForAll
   971                 ]
   972             ]
   973         ] ifTrue:[
   974             doPrint ifTrue:[
   975                 OperatingSystem isUNIXlike ifTrue:[
   976                     commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName).
   977                 ] ifFalse:[
   978                     commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName).
   979                 ].
   980                 commandTraceView endEntry.
   981             ].
   982             d := dstF asFilename construct:srcBaseName.
   983             (d exists) ifFalse:[
   984                 d makeDirectory.
   985             ].
   986             (srcF directoryContents ? #()) do:[:fileName |
   987                 self recursiveCopy:(srcF construct:fileName) 
   988                      to:d
   989                      print:doPrint
   990             ]
   991         ]
   992     ]
   993 
   994     "Created: / 31.5.1999 / 13:05:09 / cg"
   995     "Modified: / 3.3.2000 / 01:51:54 / cg"
   996 !
   997 
   998 removeMakefilesInDoc
   999     |cmd msg|
  1000 
  1001     OperatingSystem isUNIXlike ifFalse:[ ^ self ].
  1002     installWhat == #full ifTrue:[^ self].
  1003 
  1004     installDocFiles ifTrue:[
  1005         msg := (resources array:#('ST/X Installation' '' 'removing useless makefiles in doc' '' '' '')) asStringCollection.
  1006         actionTextHolder value:nil.
  1007         actionTextHolder value:msg.
  1008 
  1009         commandTraceView showCR:(resources string:'removing useless makefiles in doc ...'); endEntry.
  1010 
  1011         #(
  1012             'Make.proto'
  1013             'nt.mak'
  1014             'vms.mak'
  1015             'Makefile'
  1016         ) do:[:toRemove |
  1017             cmd := '(cd ' , stxDocDir , ' ; find . -name ''' , toRemove , ''' -exec rm {} \; )'.
  1018 
  1019             commandTraceView showCR:cmd; endEntry.
  1020              OperatingSystem executeCommand:cmd.
  1021         ]
  1022     ]
  1023 ! !
  1024 
  1025 !STXInstaller methodsFor:'startup'!
  1026 
  1027 askAndInstall
  1028     "/ check, if we are in the projects/smalltalk directory
  1029 
  1030     |answer here|
  1031 
  1032     resources := ResourcePack for:self class.
  1033 
  1034     (((here := Filename currentDirectory pathName) endsWith:'projects/smalltalk') not
  1035     and:[(here asLowercase endsWith:'stx\binbc') not
  1036     and:[(here asLowercase endsWith:'projects\smalltalk') not
  1037     ]]) ifTrue:[
  1038         "/ double - check if some of my expected files exists here ...
  1039         ('../../libbasic' asFilename exists
  1040         and:['../../libbasic' asFilename isDirectory]) ifTrue:[
  1041             self warn:(resources string:'Oops - current directories name seems to not end with ''/projects/smalltalk''\\Assume its OK.' withCRs).
  1042         ] ifFalse:[
  1043             self warn:(resources string:'must be in the ''projects/smalltalk'' directory').
  1044             ^ self
  1045         ]
  1046     ].
  1047 
  1048     answer := self askForFullInstallation.
  1049     answer ifFalse:[^ self].
  1050 
  1051     [self askForDestination] whileTrue:[
  1052         self checkForExistingInstallationAndConfirm ifTrue:[
  1053             self preInstall.
  1054             self doInstall ifTrue:[
  1055                 self postInstall.
  1056                 ^ self
  1057             ].
  1058             (self confirm:(resources string:'installation failed or aborted - retry ?'))
  1059             ifFalse:[
  1060                 ^ self
  1061             ]
  1062         ]
  1063     ].
  1064 
  1065     "Modified: / 31.5.1999 / 12:04:14 / cg"
  1066 !
  1067 
  1068 askForDestination
  1069     "open a dialog to enter destination directories"
  1070 
  1071     installWhat == #full ifTrue:[
  1072         ^ self askForDestinationForFullInstallation
  1073     ] ifFalse:[
  1074         ^ self askForDestinationForPartialInstallation
  1075     ]
  1076 
  1077     "
  1078      STXInstaller open
  1079     "
  1080 
  1081     "Modified: / 25.2.1998 / 17:12:45 / cg"
  1082 !
  1083 
  1084 askForDestinationForFullInstallation
  1085     "open a dialog to enter destination directories"
  1086 
  1087     |d cm l green dark img
  1088      fullDirHolder|
  1089 
  1090     LastFullDir isNil ifTrue:[
  1091         LastFullDir := (Filename homeDirectory construct:'work') constructString:'stx'
  1092     ].
  1093 
  1094     fullDirHolder := LastFullDir asValue.
  1095 
  1096     Screen current hasColors ifTrue:[
  1097         green := (Color red:0 green:80 blue:20) "darkened".
  1098         dark := Color grey:10.
  1099     ] ifFalse:[
  1100         green := Color white.
  1101         dark := Color black.
  1102     ].
  1103 
  1104     d := DialogBox new.
  1105 
  1106     d label:(resources string:'ST/X Full Installation').
  1107     img := Image fromFile:'SmalltalkX.xbm'.
  1108 
  1109     l := d addTextLabel:img.
  1110     l adjust:#left; foregroundColor:green backgroundColor:dark.
  1111 
  1112     l := d addTextLabel:(resources string:'Smalltalk/X CD installation (full).').
  1113     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1114 
  1115     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.
  1116     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1117 
  1118     d addVerticalSpace.
  1119     d addVerticalSpace.
  1120 
  1121     d addHorizontalLine.
  1122 
  1123     l := d addTextLabel:(resources string:'ST/X development directory:').
  1124     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1125 
  1126     cm := ComboBoxView on:fullDirHolder.
  1127     cm list:self defaultFullDirs.
  1128     d 
  1129         addLabelledField:cm 
  1130         label:(resources string:'stx develop')
  1131         adjust:#left 
  1132         tabable:true 
  1133         from:0.0 to:1.0 separateAtX:0.25
  1134         nameAs:'fullBox'.
  1135 
  1136     (d componentAt:'fullBox.label') backgroundColor:dark; foregroundColor:Color white.
  1137 
  1138     d addVerticalSpace.
  1139     d addHorizontalLine.
  1140 
  1141     d addHelpButtonFor:'STXInstaller/installHelp.html';
  1142       addAbortButton; 
  1143       addOkButtonLabelled:(resources string:'install').
  1144     d extent:500@400.
  1145     d resize. "/ compute best size
  1146 
  1147     d allViewBackground:dark.
  1148 
  1149     d openAtCenter.
  1150     d accepted ifTrue:[
  1151         fullDir := LastFullDir := fullDirHolder value.
  1152         d destroy.
  1153         ^ true
  1154     ].
  1155     d destroy.
  1156     ^ false
  1157 
  1158     "
  1159      STXInstaller open
  1160     "
  1161 
  1162     "Created: / 25.2.1998 / 17:11:37 / cg"
  1163     "Modified: / 25.2.1998 / 17:29:07 / cg"
  1164 !
  1165 
  1166 askForDestinationForPartialInstallation
  1167     "open a dialog to enter destination directories"
  1168 
  1169     |d cm l green dark img
  1170      stxInstDirHolder stxLibDirHolder stxLibBinDirHolder stxBinDirHolder
  1171      installDocHolder installSourceHolder installSTCHolder installGoodiesHolder
  1172      binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes
  1173      goodyMegabytes stxRel list stxInstDir
  1174     |
  1175 
  1176     binMegabytes := 20.
  1177     libMegabytes := 30.
  1178     docMegabytes := 12.
  1179     stcMegabytes := 2.
  1180     srcMegabytes := 20.
  1181     goodyMegabytes := 10.
  1182 
  1183     stxRel := self smalltalkRelease.
  1184 
  1185     OperatingSystem isMSWINDOWSlike ifTrue:[
  1186         LastPartialDir isNil ifTrue:[
  1187             LastPartialDir := 'c:\Programme\eXept\SmalltalkX\' , stxRel 
  1188         ].
  1189 "/        LastLibDir isNil ifTrue:[
  1190 "/            LastLibDir := 'c:\Programme\SmalltalkX\' , stxRel , '\lib'
  1191 "/        ].
  1192 "/        LastLibBinDir isNil ifTrue:[
  1193 "/            LastLibBinDir := 'c:\Programme\SmalltalkX\' , stxRel , '\lib'
  1194 "/        ].
  1195 "/        LastBinDir isNil ifTrue:[
  1196 "/            LastBinDir := 'c:\Programme\SmalltalkX\' , stxRel , '\bin'
  1197 "/        ].
  1198     ] ifFalse:[
  1199         LastPartialDir isNil ifTrue:[
  1200             LastPartialDir := '/opt/smalltalk/' , stxRel
  1201         ].
  1202 "/        LastLibDir isNil ifTrue:[
  1203 "/            LastLibDir := '/opt/smalltalk/' , stxRel , '/lib'
  1204 "/        ].
  1205 "/        LastLibBinDir isNil ifTrue:[
  1206 "/            LastLibBinDir := '/opt/smalltalk/' , stxRel , '/lib'
  1207 "/        ].
  1208 "/        LastBinDir isNil ifTrue:[
  1209 "/            LastBinDir := '/opt/smalltalk/' , stxRel , '/bin'
  1210 "/        ].
  1211     ].
  1212 
  1213     stxInstDirHolder := LastPartialDir asValue.
  1214 "/    stxLibDirHolder := LastLibDir asValue.
  1215 "/    stxLibBinDirHolder := LastLibBinDir asValue.
  1216 "/    stxBinDirHolder := LastBinDir asValue.
  1217 
  1218     installDocHolder := true asValue.
  1219     installSourceHolder := true asValue.
  1220     installSTCHolder := true asValue.
  1221     installGoodiesHolder := true asValue.
  1222 
  1223     Screen current hasColors ifTrue:[
  1224         green := (Color red:0 green:80 blue:20) "darkened".
  1225         dark := Color grey:10.
  1226     ] ifFalse:[
  1227         green := Color white.
  1228         dark := Color black.
  1229     ].
  1230 
  1231     d := DialogBox new.
  1232 
  1233     d label:(resources string:'ST/X Standard Installation').
  1234     img := Image fromFile:'SmalltalkX.xbm'.
  1235 
  1236     l := d addTextLabel:img.
  1237     l adjust:#left; foregroundColor:green backgroundColor:dark.
  1238 
  1239     l := d addTextLabel:(resources string:'Smalltalk/X Standard installation (partial).').
  1240     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1241     d addVerticalSpace.
  1242     d addVerticalSpace.
  1243 
  1244     d addHorizontalLine.
  1245 
  1246     l := d addTextLabel:(resources string:'Destination directories:').
  1247     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1248 
  1249     l := d addTextLabel:(resources string:'(the default below is recommended)').
  1250     l adjust:#right; backgroundColor:dark; foregroundColor:Color white.
  1251 
  1252     cm := ComboBoxView on:stxInstDirHolder.
  1253     list := self defaultInstDirs collect:[:line |
  1254                 line replChar:$\ withString:'\\'
  1255             ].
  1256     cm list:list.
  1257     d 
  1258         addLabelledField:cm 
  1259         label:(resources string:'install into:')
  1260         adjust:#left 
  1261         tabable:true 
  1262         from:0.0 to:1.0 separateAtX:0.25
  1263         nameAs:'instDirBox'.
  1264 
  1265     (d componentAt:'instDirBox.label') backgroundColor:dark; foregroundColor:Color white.
  1266 
  1267 "/    cm := ComboBoxView on:stxBinDirHolder.
  1268 "/    list := self defaultBinDirs collect:[:line |
  1269 "/                line replChar:$\ withString:'\\'
  1270 "/            ].
  1271 "/    cm list:list.
  1272 "/    d 
  1273 "/        addLabelledField:cm 
  1274 "/        label:(resources string:'binaries')
  1275 "/        adjust:#left 
  1276 "/        tabable:true 
  1277 "/        from:0.0 to:1.0 separateAtX:0.25
  1278 "/        nameAs:'binaryBox'.
  1279 "/
  1280 "/    (d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white.
  1281 "/
  1282 "/    cm := ComboBoxView on:stxLibBinDirHolder.
  1283 "/    cm list:self defaultLibBinDirs.
  1284 "/    d 
  1285 "/        addLabelledField:cm 
  1286 "/        label:(resources string:'libraries') 
  1287 "/        adjust:#left 
  1288 "/        tabable:true 
  1289 "/        from:0.0 to:1.0 separateAtX:0.25
  1290 "/        nameAs:'libraryBinBox'.
  1291 "/
  1292 "/    (d componentAt:'libraryBinBox.label') backgroundColor:dark; foregroundColor:Color white.
  1293 "/
  1294 "/    cm := ComboBoxView on:stxLibDirHolder.
  1295 "/    cm list:self defaultLibDirs.
  1296 "/    d 
  1297 "/        addLabelledField:cm 
  1298 "/        label:(resources string:'other files') 
  1299 "/        adjust:#left 
  1300 "/        tabable:true 
  1301 "/        from:0.0 to:1.0 separateAtX:0.25
  1302 "/        nameAs:'libraryBox'.
  1303 "/
  1304 "/    (d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white.
  1305 
  1306     d addVerticalSpace.
  1307     d addHorizontalLine.
  1308     d addVerticalSpace.
  1309 
  1310     (d addTextLabel:(resources string:'required:'))
  1311         adjust:#left; foregroundColor:Color white backgroundColor:dark.
  1312 
  1313     d leftIndent:35.
  1314     (d addTextLabel:(resources string:'binaries (approx. %1 Mb)' with:binMegabytes printString))
  1315         adjust:#left; foregroundColor:Color white backgroundColor:dark.
  1316     (d addTextLabel:(resources string:'libraries (approx. %1 Mb)' with:libMegabytes printString))
  1317         adjust:#left; foregroundColor:Color white backgroundColor:dark.
  1318     d leftIndent:0.
  1319 
  1320     d addVerticalSpace.
  1321     d addHorizontalLine.
  1322     d addVerticalSpace.
  1323 
  1324     (d addTextLabel:(resources string:'optional:'))
  1325         adjust:#left; foregroundColor:Color white backgroundColor:dark.
  1326 
  1327     (d addCheckBox:((resources string:'doc files (+%1 Mb)' with:docMegabytes)) on:installDocHolder)
  1328         labelView foregroundColor:Color white backgroundColor:dark.
  1329     (d addCheckBox:((resources string:'stc & support files (+%1 Mb)' with:stcMegabytes)) on:installSTCHolder)
  1330         labelView foregroundColor:Color white backgroundColor:dark.
  1331 
  1332     d addVerticalSpace.
  1333     d addHorizontalLine.
  1334     d addVerticalSpace.
  1335 
  1336     (d addTextLabel:(resources string:'optional (but highly recommended):'))
  1337         adjust:#left; foregroundColor:Color white backgroundColor:dark.
  1338 
  1339     (d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder)
  1340         labelView foregroundColor:Color white backgroundColor:dark.
  1341     (d addCheckBox:((resources string:'goodies (+%1 Mb)' with:goodyMegabytes)) on:installGoodiesHolder)
  1342         labelView foregroundColor:Color white backgroundColor:dark.
  1343 
  1344     d addVerticalSpace.
  1345     d addHorizontalLine.
  1346 
  1347     d addHelpButtonFor:'STXInstaller/installHelp.html';
  1348       addAbortButton; 
  1349       addOkButtonLabelled:(resources string:'install').
  1350     d extent:500@400.
  1351     d resize. "/ compute best size
  1352 
  1353     d allViewBackground:dark.
  1354 
  1355     d openAtCenter.
  1356     d accepted ifTrue:[
  1357         stxInstDir := LastPartialDir := stxTopDir := stxInstDirHolder value.
  1358         stxDocDir := stxInstDir asFilename constructString:'doc'.
  1359         stxLibDir := stxInstDir asFilename constructString:'lib'.
  1360         stxLibBinDir := stxInstDir asFilename constructString:'lib'.
  1361         stxBinDir := stxInstDir asFilename constructString:'bin'.
  1362         stxPkgDir := stxInstDir asFilename constructString:'packages'.
  1363 
  1364 "/        stxLibDir := LastLibDir := stxLibDirHolder value.
  1365 "/        stxLibBinDir := LastLibBinDir := stxLibBinDirHolder value.
  1366 "/        stxBinDir := LastBinDir := stxBinDirHolder value.
  1367         installDocFiles := installDocHolder value.
  1368         installSourceFiles := installSourceHolder value.
  1369         installSTCFiles := installSTCHolder value.
  1370         installGoodyFiles := installGoodiesHolder value.
  1371         d destroy.
  1372         ^ true
  1373     ].
  1374     d destroy.
  1375     ^ false
  1376 
  1377     "
  1378      STXInstaller open
  1379     "
  1380 
  1381     "Created: / 25.2.1998 / 17:11:26 / cg"
  1382     "Modified: / 31.5.1999 / 18:37:50 / cg"
  1383 !
  1384 
  1385 askForFullInstallation
  1386     "open a dialog to ask if a full installation is wanted;
  1387      Leave the result in installWhat (a symbol, either #full or #partial)."
  1388 
  1389     |d cm l green dark img|
  1390 
  1391     Screen current hasColors ifTrue:[
  1392         green := (Color red:0 green:80 blue:20) "darkened".
  1393         dark := Color grey:10.
  1394     ] ifFalse:[
  1395         green := Color white.
  1396         dark := Color black.
  1397     ].
  1398 
  1399     d := DialogBox new.
  1400 
  1401     d label:(resources string:'ST/X CD Installation').
  1402     img := Image fromFile:'SmalltalkX.xbm'.
  1403 
  1404     l := d addTextLabel:img.
  1405     l adjust:#left; foregroundColor:green backgroundColor:dark.
  1406 
  1407     l := d addTextLabel:(resources string:'Smalltalk/X CD installation.').
  1408     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1409     d addVerticalSpace.
  1410     d addVerticalSpace.
  1411 
  1412     d addHorizontalLine.
  1413 
  1414     l := d addTextLabel:(resources string:
  1415 'You can either perform a ' , 'full' asText allBold , ' installation, or a ' , 'standard' asText allBold ,' (partial) installation.').
  1416     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1417 
  1418     d addVerticalSpace.
  1419     d addHorizontalLine.
  1420 
  1421     d leftIndent:20.
  1422     l := d addTextLabel:(resources string:
  1423 'full:' asText allBold , '
  1424 The full installation is required if you want to build your own
  1425 customized smalltalk executable. It allows you to create and include 
  1426 additional precompiled binary classes or classLibraries. 
  1427 This is also required if you want to link your own standalone executables.
  1428 
  1429 It consists of a directory hierachy, including makefiles for a customizeable 
  1430 rebuild of the whole smalltalk system.
  1431 (Actually, it simply copies the whole CD contents onto your disk).
  1432 This requires roughly 200-300Mb of hard disk space (dep. upon architecture).').
  1433     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1434 
  1435     d addVerticalSpace.
  1436     d addHorizontalLine.
  1437 
  1438     l := d addTextLabel:(resources string:
  1439 'standard:' asText allBold , '
  1440 The standard (runTime) installation requires less disk space and only copies the
  1441 smalltalk executable, shared libraries and support files onto your hard disk.
  1442 This setup allows normal smalltalk development and is also useful as a runtime
  1443 environment for smalltalk applications.
  1444 However, it does not support recreation of a new smalltalk executable and/or
  1445 shared binary classLibraries.
  1446 This setup also saves a lot of disk space, if multiple users are going to
  1447 use smalltalk, since most of the code is shared (both on disk and in memory).
  1448 This requires roughly 70-120Mb of hard disk space (dep. upon architecture).
  1449 
  1450 
  1451  ').
  1452     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1453 
  1454 
  1455     d leftIndent:0.
  1456     d addVerticalSpace.
  1457     d addHorizontalLine.
  1458 
  1459 
  1460     d addHelpButtonFor:'STXInstaller/installHelp.html';
  1461       addAbortButton; 
  1462       addOkButton:(Button label:(resources string:'full') action:[installWhat := #full]);
  1463       addOkButtonLabelled:(resources string:'standard').
  1464     d extent:500@500.
  1465     d resize.    "/ compute best size ...
  1466 
  1467     d allViewBackground:dark.
  1468 
  1469     installWhat := #partial.
  1470     d openAtCenter.
  1471     d accepted ifTrue:[
  1472         d destroy.
  1473         ^ true
  1474     ].
  1475     d destroy.
  1476     ^ false
  1477 
  1478     "
  1479      STXInstaller open
  1480     "
  1481 
  1482     "Created: / 25.2.1998 / 16:50:16 / cg"
  1483     "Modified: / 25.2.1998 / 19:42:31 / cg"
  1484 !
  1485 
  1486 checkForExistingInstallationAndConfirm
  1487     "look if there is another installation and confirm
  1488      reinstalling; return true if ok, false if not"
  1489 
  1490     |whichDir canOverWrite whatToDo box|
  1491 
  1492     installWhat == #full ifTrue:[
  1493         whichDir := fullDir.
  1494         canOverWrite := false.
  1495     ] ifFalse:[
  1496         whichDir := stxLibDir.
  1497         canOverWrite := true.
  1498     ].
  1499 
  1500     whichDir asFilename exists ifTrue:[
  1501             whatToDo := Dialog 
  1502                             choose:(resources 
  1503                                         string:'detected existing ST/X installation in %1' 
  1504                                           with:whichDir asText allBold)
  1505                             label:(resources string:'Attention')
  1506                             labels:(resources array:(canOverWrite 
  1507                                                     ifFalse:[#('remove first' 'cancel')] 
  1508                                                     ifTrue:[#('remove first' 'overwrite' 'cancel')] )) 
  1509                             values:(canOverWrite ifFalse:[#(remove nil)] ifTrue:[#(remove over nil)])
  1510                             default:nil.     
  1511 
  1512             whatToDo isNil ifTrue:[^false].
  1513             whatToDo == #remove ifTrue:[
  1514                 ((whichDir findString:'stx') == 0
  1515                 and:[(whichDir findString:'smalltalk') == 0]) ifTrue:[
  1516                     "/ confirm again
  1517                     (self confirm:(resources 
  1518                                     string:'are you certain that the directory to remove
  1519 (' , whichDir , ') is really a smalltalk directory ?
  1520 
  1521 Remove it now ?')) ifFalse:[ 
  1522                         ^ false
  1523                     ]
  1524                 ].
  1525 
  1526                 [
  1527                     box := DialogBox new label:'please wait'.
  1528                     box addTextLabel:'removing ' , whichDir , ' ...'.
  1529                     box showAtPointer.
  1530                 ] forkAt:(Processor activePriority+1).
  1531                 box waitUntilVisible.
  1532 
  1533                 (OperatingSystem recursiveRemoveDirectory:whichDir)
  1534                 ifFalse:[
  1535                     OperatingSystem removeDirectory:whichDir.
  1536                     whichDir asFilename exists ifTrue:[
  1537                         self warn:(resources string:'mhmh - could not remove old installation.
  1538 
  1539 Please remove it manually (using administrator privileges if required) 
  1540 and try again.').
  1541                         box destroy.
  1542                         ^ false
  1543                     ]
  1544                 ].
  1545 
  1546                 box destroy
  1547             ].
  1548     ].
  1549 
  1550     ^ true
  1551 
  1552     "
  1553      STXInstaller open
  1554     "
  1555 
  1556     "Modified: / 31.5.1999 / 13:23:03 / cg"
  1557 !
  1558 
  1559 doInstall
  1560     "install ST/X; return true if ok, false if not"
  1561 
  1562     |progressView ok v textView p l 
  1563      dirToMonitor doDfMonitoring dfMonitorProcess kB drive|
  1564 
  1565     doDfMonitoring := false.
  1566 
  1567     v := View new preferredExtent:(250 @ 350).
  1568 
  1569     textView := HVScrollableView for:TextCollector in:v.
  1570     textView origin:0.0@0.0 corner:1.0@1.0.
  1571     textView bottomInset:30.
  1572     textView lineLimit:10000.
  1573     commandTraceView := textView scrolledView.
  1574 
  1575     installWhat == #full ifTrue:[
  1576         dirToMonitor := fullDir.
  1577     ] ifFalse:[
  1578         dirToMonitor := stxLibDir
  1579     ].
  1580 
  1581     OperatingSystem isMSWINDOWSlike ifTrue:[
  1582         drive := Filename rootDirectoryOnVolume:(dirToMonitor asFilename volume)
  1583     ] ifFalse:[
  1584         drive := dirToMonitor
  1585     ].
  1586     drive := drive asFilename.
  1587 
  1588     p := HorizontalPanelView in:v.
  1589     p origin:0.0@1.0 corner:1.0@1.0.
  1590     p topInset:-30.
  1591     p horizontalLayout:#fit.
  1592 
  1593     l := Label label:'' in:p.
  1594     l labelChannel:(dfHolder := '' asValue).
  1595     l adjust:#left.
  1596     dfMonitorProcess := [
  1597         |ok info free kB i l|
  1598 
  1599         ok := true.
  1600         [ok] whileTrue:[
  1601             doDfMonitoring ifTrue:[
  1602                 ok := false.
  1603                 info := OperatingSystem getDiskInfoOf:drive pathName.
  1604                 info notNil ifTrue:[
  1605                     free := info at:#freeBytes ifAbsent:nil.
  1606                     free notNil ifTrue:[
  1607                         kB := free / 1024.
  1608                         kB > 10000 ifTrue:[
  1609                             l := (kB // 1024) printString, 'Mb available.'.
  1610                         ] ifFalse:[
  1611                             l := kB printString , 'Kb available.'.
  1612                         ].
  1613                         dfHolder value:l.
  1614                         ok := true.
  1615                         Delay waitForSeconds:9.
  1616                     ].
  1617                 ].
  1618             ].
  1619             Delay waitForSeconds:1.
  1620         ]
  1621     ] forkAt:(Processor activePriority+3).
  1622 
  1623     progressView := ProgressIndicator
  1624                         inBoxWithLabel:'ST/X Installation' icon:(Icon stxIcon)
  1625                         text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection
  1626                         abortable:true
  1627                         view:v
  1628                         closeWhenDone:false.
  1629     progressView topView extent:(640 min:Display width) @ (500 min:Display height).
  1630 
  1631     ok := false.
  1632 
  1633     progressView showProgressOf:
  1634             [:progressValue :currentAction| |msg|
  1635 
  1636               Processor activeProcess withPriority:7 do:[
  1637                   [
  1638                       actionPercentageHolder := progressValue.
  1639                       actionTextHolder := currentAction.
  1640 
  1641                       installWhat == #full ifFalse:[
  1642                             self outputInitialMessage.
  1643                       ].
  1644 
  1645                       (self createDirectories) ifTrue:[
  1646                           doDfMonitoring := true.
  1647                           ok := self copyFiles
  1648                       ].
  1649                       self changeWritability.
  1650                       self createSymbolicLinks.
  1651                       self removeMakefilesInDoc.
  1652 
  1653                       OperatingSystem isMSWINDOWSlike ifTrue:[
  1654                           self createRegistryEntries.
  1655                       ].
  1656 
  1657                       progressValue value:100.
  1658 
  1659                       progressView topView raise.
  1660                       commandTraceView showCR:'Installation finished.' asText allBold.
  1661                       commandTraceView endEntry. 
  1662                       textView flash.
  1663 
  1664                       progressView topView abortButton label:(resources string:'continue').
  1665                       progressView topView abortButton action:[progressView topView hide].
  1666                       msg := (resources 
  1667                                  array:#('ST/X Installation finished.' '' 'press continue ...' '' '' ''))
  1668                                      asStringCollection.
  1669                       actionTextHolder value:nil.
  1670                       actionTextHolder value:msg.
  1671                  ] valueOnUnwindDo:[
  1672                     dfMonitorProcess notNil ifTrue:[
  1673                         dfMonitorProcess terminate.
  1674                         dfMonitorProcess := nil.
  1675                     ].
  1676                     copyProcess notNil ifTrue:[
  1677                         copyProcess terminate.
  1678                         copyProcess := nil.
  1679                     ].
  1680                  ]
  1681               ] 
  1682             ].
  1683 
  1684     dfMonitorProcess notNil ifTrue:[
  1685         dfMonitorProcess terminate.
  1686         dfMonitorProcess := nil.
  1687     ].
  1688     copyProcess notNil ifTrue:[
  1689         copyProcess terminate.
  1690         copyProcess := nil.
  1691     ].
  1692     ^ ok
  1693 
  1694     "
  1695      STXInstaller open
  1696     "
  1697 
  1698     "Created: / 17.7.1996 / 15:11:27 / cg"
  1699     "Modified: / 31.5.1999 / 14:45:12 / cg"
  1700 !
  1701 
  1702 open
  1703     self askAndInstall.
  1704 
  1705     "
  1706      LastLibDir := LastBinDir := LastLibBinDir := nil.
  1707      LastPartialDir := LastFullDir := nil.
  1708 
  1709      STXInstaller open
  1710     "
  1711 
  1712     "Modified: / 31.5.1999 / 18:28:10 / cg"
  1713 !
  1714 
  1715 postInstall
  1716     "some messages at the end ..."
  1717 
  1718     |shInfo cshInfo msg havePath|
  1719 
  1720     resources isNil ifTrue:[
  1721         resources := ResourcePack for:self class.
  1722     ].
  1723 
  1724     msg := (resources string:'ST/X Installation complete.\\') withCRs.
  1725     shInfo := ''.
  1726     cshInfo := ''.
  1727 
  1728     OperatingSystem isMSWINDOWSlike ifFalse:[
  1729 
  1730         installWhat == #full ifTrue:[
  1731             msg := msg , 'You will now find a development directory hierarchy
  1732 in ''' , fullDir asText allBold , '''.
  1733 
  1734 To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk''
  1735 and start smalltalk with the command: ''./smalltalk''.
  1736 
  1737 To perform a partial installation of your customized smalltalk later,
  1738 use the INSTALL script found in ''' , fullDir , ''''.
  1739 
  1740         ] ifFalse:[
  1741             havePath := true.
  1742             (((OperatingSystem getEnvironment:'PATH')
  1743                 asCollectionOfSubstringsSeparatedBy:$:)
  1744                     includes:stxBinDir) ifFalse:[
  1745 
  1746                 havePath := false.
  1747                 shInfo  := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'.
  1748                 cshInfo := 'set path=($path ' , stxBinDir , ')\'.
  1749                 msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\'
  1750                                           with:stxBinDir asText allBold) withCRs.
  1751             ].
  1752 
  1753             (stxLibDir ~= '/usr/local/lib/smalltalk'
  1754             and:[stxLibDir ~= '/usr/lib/smalltalk'
  1755             and:[stxLibDir ~= ('/opt/smalltalk/' , self smalltalkRelease , '/lib')]]) ifTrue:[
  1756                 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").
  1757 You may have to define the %1 environment variable\as %2 if ST/X complains about not finding its files.\'
  1758                                           with:'STX_LIBDIR' asText allBold 
  1759                                           with:stxLibDir asText allBold) withCRs.
  1760                 havePath ifFalse:[
  1761                     msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs.
  1762                 ] ifTrue:[
  1763                     msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs.
  1764                 ].
  1765 
  1766                 shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'.
  1767                 cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'.
  1768             ].
  1769 
  1770             shInfo notEmpty ifTrue:[
  1771                 '*********************************************************' errorPrintCR.
  1772                 (resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR.
  1773                 (resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR.
  1774                 '' errorPrintCR.
  1775                 shInfo withCRs errorPrintCR.
  1776                 '' errorPrintCR.
  1777                 (resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR.
  1778                 '' errorPrintCR.
  1779                 cshInfo withCRs errorPrintCR.
  1780                 '' errorPrintCR.
  1781                 '*********************************************************' errorPrintCR.
  1782             ].
  1783         ].
  1784     ].
  1785     msg := msg , '\\Have fun using ST/X !!'.
  1786 
  1787     self information:msg withCRs.
  1788 
  1789     "Modified: / 30.4.1999 / 17:59:39 / cg"
  1790 !
  1791 
  1792 preInstall
  1793     "clobber the doc directory, to avoid copying cyclic symbolic links.
  1794      Notice, the CD does not contain symlinks, but checking for them
  1795      allows installing from a development dir."
  1796 
  1797     |f|
  1798 
  1799     OperatingSystem isMSWINDOWSlike ifFalse:[
  1800         f := '../../doc/online/english/german' asFilename.
  1801         f exists ifTrue:[
  1802             f isSymbolicLink ifTrue:[
  1803                 OperatingSystem executeCommand:'(cd ../../doc/online; make clobber) >/dev/null 2>/dev/null'
  1804             ]
  1805         ]
  1806     ]
  1807 
  1808     "
  1809      STXInstaller new preInstall
  1810     "
  1811 
  1812     "Modified: / 30.4.1999 / 17:54:38 / cg"
  1813 ! !
  1814 
  1815 !STXInstaller class methodsFor:'documentation'!
  1816 
  1817 version
  1818     ^ '$Header$'
  1819 ! !