STXInstaller.st
changeset 1119 556bb6c9e36c
parent 1118 ebecbe5d4b6b
child 1132 ef8fb42803b0
equal deleted inserted replaced
1118:ebecbe5d4b6b 1119:556bb6c9e36c
    23 
    23 
    24 defaultBinDirs
    24 defaultBinDirs
    25     |dirs|
    25     |dirs|
    26 
    26 
    27     dirs := OrderedCollection new.
    27     dirs := OrderedCollection new.
    28     dirs add:'/opt/smalltalk/' , self smalltalkRelease , '/bin'.
    28 
    29     dirs add:'/usr/local/bin'.
    29     OperatingSystem isMSWINDOWSlike ifTrue:[
    30     dirs add:'/usr/bin'.
    30         dirs add:'\Programme\eXept\SmalltalkX\' , self smalltalkRelease , '\bin'.
    31     dirs add:(Filename homeDirectory constructString:'bin').
    31         dirs add:'\Programme\SmalltalkX\' , self smalltalkRelease , '\bin'.
    32     dirs add:((Filename homeDirectory 
    32         dirs add:'\SmalltalkX\' , self smalltalkRelease , '\bin'.
    33                             construct:'stx')
    33     ] ifFalse:[
    34                             constructString:'bin').
    34         dirs add:'/opt/smalltalk/' , self smalltalkRelease , '/bin'.
    35     dirs add:'/tmp/stxbin'.
    35         dirs add:'/usr/local/bin'.
    36     ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
    36         dirs add:'/usr/bin'.
    37         dirs add:'/home/stx/bin'.
    37 
    38     ].
    38         dirs add:(Filename homeDirectory constructString:'bin').
    39     ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
    39         dirs add:((Filename homeDirectory 
    40         dirs add:'/home2/stx/bin'.
    40                                 construct:'stx')
       
    41                                 constructString:'bin').
       
    42         dirs add:'/tmp/stxbin'.
       
    43         ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
       
    44             dirs add:'/home/stx/bin'.
       
    45         ].
       
    46         ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
       
    47             dirs add:'/home2/stx/bin'.
       
    48         ].
    41     ].
    49     ].
    42 
    50 
    43 "/    dirs := dirs select:[:path | 
    51 "/    dirs := dirs select:[:path | 
    44 "/                            |f|
    52 "/                            |f|
    45 "/
    53 "/
    46 "/                            f := path asFilename.
    54 "/                            f := path asFilename.
    47 "/                            f exists and:[f isDirectory]].
    55 "/                            f exists and:[f isDirectory]].
    48     ^ dirs "sort"
    56     ^ dirs "sort"
    49 
    57 
    50     "Created: 18.7.1996 / 19:43:00 / cg"
    58     "Created: / 18.7.1996 / 19:43:00 / cg"
    51     "Modified: 18.7.1996 / 19:45:08 / cg"
    59     "Modified: / 30.4.1999 / 11:56:03 / cg"
    52 !
    60 !
    53 
    61 
    54 defaultFullDirs
    62 defaultFullDirs
    55     |dirs|
    63     |dirs|
    56 
    64 
    71 
    79 
    72 defaultLibBinDirs
    80 defaultLibBinDirs
    73     |dirs|
    81     |dirs|
    74 
    82 
    75     dirs := OrderedCollection new.
    83     dirs := OrderedCollection new.
    76     dirs add:'/usr/local/lib'.
    84     OperatingSystem isMSWINDOWSlike ifTrue:[
    77     dirs add:'/usr/lib'.
    85         dirs add:'\Programme\eXept\SmalltalkX\' , self smalltalkRelease , '\lib'.
    78     dirs add:'/lib'.
    86         dirs add:'\Programme\SmalltalkX\' , self smalltalkRelease , '\lib'.
    79     dirs add:(Filename homeDirectory 
    87         dirs add:'\SmalltalkX\' , self smalltalkRelease , '\lib'.
    80                             constructString:'lib').
    88     ] ifFalse:[
    81 
    89         dirs add:'/usr/local/lib'.
    82     dirs add:((Filename homeDirectory 
    90         dirs add:'/usr/lib'.
    83                             construct:'stx')
    91         dirs add:'/lib'.
    84                             constructString:'lib').
    92         dirs add:(Filename homeDirectory 
    85     dirs add:'/tmp/stxlib'.
    93                                 constructString:'lib').
    86     dirs add:'/home/stx/lib'.
    94 
    87     dirs add:'/home2/stx/lib'.
    95         dirs add:((Filename homeDirectory 
    88 
    96                                 construct:'stx')
       
    97                                 constructString:'lib').
       
    98         dirs add:'/tmp/stxlib'.
       
    99         dirs add:'/home/stx/lib'.
       
   100         dirs add:'/home2/stx/lib'.
       
   101     ].
    89     ^ dirs sort
   102     ^ dirs sort
    90 
   103 
    91     "Created: 18.7.1996 / 19:43:21 / cg"
   104     "Created: / 18.7.1996 / 19:43:21 / cg"
    92     "Modified: 18.7.1996 / 19:46:04 / cg"
   105     "Modified: / 30.4.1999 / 11:56:48 / cg"
    93 !
   106 !
    94 
   107 
    95 defaultLibDirs
   108 defaultLibDirs
    96     |dirs|
   109     |dirs|
    97 
   110 
    98     dirs := OrderedCollection new.
   111     dirs := OrderedCollection new.
    99     dirs add:'/opt/smalltalk/' , self smalltalkRelease , '/lib'.
   112     OperatingSystem isMSWINDOWSlike ifTrue:[
   100     dirs add:'/usr/local/lib/smalltalk'.
   113         dirs add:'\Programme\eXept\SmalltalkX\' , self smalltalkRelease , '\lib'.
   101     dirs add:'/usr/lib/smalltalk'.
   114         dirs add:'\Programme\SmalltalkX\' , self smalltalkRelease , '\lib'.
   102     dirs add:((Filename homeDirectory 
   115         dirs add:'\SmalltalkX\' , self smalltalkRelease , '\lib'.
   103                             construct:'lib')
   116     ] ifFalse:[
   104                             constructString:'smalltalk').
   117         dirs add:'/opt/smalltalk/' , self smalltalkRelease , '/lib'.
   105     dirs add:((Filename homeDirectory 
   118         dirs add:'/usr/local/lib/smalltalk'.
   106                             construct:'stx')
   119         dirs add:'/usr/lib/smalltalk'.
   107                             constructString:'lib').
   120         dirs add:((Filename homeDirectory 
   108     dirs add:'/tmp/stxlib'.
   121                                 construct:'lib')
   109     dirs add:'/home/stx/lib'.
   122                                 constructString:'smalltalk').
   110     dirs add:'/home2/stx/lib'.
   123         dirs add:((Filename homeDirectory 
       
   124                                 construct:'stx')
       
   125                                 constructString:'lib').
       
   126         dirs add:'/tmp/stxlib'.
       
   127         dirs add:'/home/stx/lib'.
       
   128         dirs add:'/home2/stx/lib'.
       
   129     ].
   111 
   130 
   112 "/    dirs := dirs select:[:path | 
   131 "/    dirs := dirs select:[:path | 
   113 "/                            |f|
   132 "/                            |f|
   114 "/
   133 "/
   115 "/                            f := path asFilename.
   134 "/                            f := path asFilename.
   116 "/                            f exists and:[f isDirectory]].
   135 "/                            f exists and:[f isDirectory]].
   117     ^ dirs "sort"
   136     ^ dirs "sort"
   118 
   137 
   119     "Created: 18.7.1996 / 19:43:21 / cg"
   138     "Created: / 18.7.1996 / 19:43:21 / cg"
   120     "Modified: 18.7.1996 / 19:46:04 / cg"
   139     "Modified: / 30.4.1999 / 11:57:02 / cg"
   121 !
   140 !
   122 
   141 
   123 directoriesToMake
   142 directoriesToMake
   124     |dirsToMake|
   143     |dirsToMake|
   125 
   144 
   171                , '.' , Smalltalk minorVersionNr printString
   190                , '.' , Smalltalk minorVersionNr printString
   172                , '.' , Smalltalk revisionNr printString.
   191                , '.' , Smalltalk revisionNr printString.
   173 !
   192 !
   174 
   193 
   175 specOfFilesToCopy
   194 specOfFilesToCopy
       
   195     OperatingSystem isMSWINDOWSlike ifTrue:[
       
   196         ^ self specOfWindowsFilesToCopy
       
   197     ].
       
   198     ^ self specOfUnixFilesToCopy
       
   199 
       
   200     "Modified: / 2.5.1999 / 13:17:59 / cg"
       
   201 !
       
   202 
       
   203 specOfUnixFilesToCopy
   176     |fileSpec|
   204     |fileSpec|
   177 
   205 
   178     fileSpec := #(
   206     fileSpec := #(
   179                 "/ name                             destination  subDir             required mode      
   207                 "/ name                             destination  subDir             required mode      
   180                 ( 'projects/smalltalk/smalltalk'        #bin     nil                  true  '755' )
   208                 ( 'projects/smalltalk/smalltalk'        #bin     nil                  true  '755' )
   263     ].
   291     ].
   264 
   292 
   265 
   293 
   266     ^ fileSpec
   294     ^ fileSpec
   267 
   295 
   268     "Modified: 8.8.1997 / 18:39:06 / cg"
   296     "Modified: / 30.4.1999 / 18:02:22 / cg"
       
   297     "Created: / 2.5.1999 / 13:17:37 / cg"
       
   298 !
       
   299 
       
   300 specOfWindowsFilesToCopy
       
   301     |fileSpec|
       
   302 
       
   303     fileSpec := #(
       
   304                 "/ name                             destination  subDir             required       
       
   305 "/                ( 'binbc\smalltalk'                     #bin     nil                  true   )
       
   306                 ( 'binbc\stx'                           #bin     nil                  true   )
       
   307                 ( 'binbc\include'                       #lib     nil                  true   )
       
   308                 ( 'binbc\lib*.dll'                      #bin     nil                  true   )
       
   309                 ( 'COPYRIGHT'                           #lib     nil                  true   )
       
   310                 ( 'binbc\*.rc'                          #lib     nil                  true   )
       
   311                 ( 'binbc\patches'                       #lib     nil                  true   )
       
   312                 ( 'binbc\bitmaps'                       #lib     nil                  true   )
       
   313                 ( 'binbc\resources'                     #lib     nil                  true   )
       
   314                 ( 'doc\online\german\LICENCE.STX.html'  #lib     'doc\online\german'  true   )
       
   315                 ( 'doc\online\english\LICENCE.STX.html' #lib     'doc\online\english' true   )
       
   316     ).
       
   317 
       
   318     installDocFiles ifTrue:[
       
   319         fileSpec := fileSpec , #(
       
   320                 ( 'doc'                                  #lib     nil        false  )
       
   321         ).
       
   322     ].
       
   323 
       
   324     installSourceFiles ifTrue:[
       
   325         fileSpec := fileSpec , #(
       
   326                 ( 'binbc\source'                         #lib     nil        false  )
       
   327         ).
       
   328     ].
       
   329 
       
   330     installSTCFiles ifTrue:[
       
   331         fileSpec := fileSpec , #(
       
   332                 ( 'binbc\stc'                            #bin        nil              false  )
       
   333                 ( 'include'                              #lib        nil              false  )
       
   334 
       
   335                 ( 'binbc\*.lib'                          #libBin     nil              false  )
       
   336         ).
       
   337     ].
       
   338 
       
   339     installGoodyFiles ifTrue:[
       
   340         fileSpec := fileSpec , #(
       
   341                 ( 'goodies\*.st'                             #lib     'goodies'  false  )
       
   342                 ( 'goodies\*.chg'                            #lib     'goodies'  false  )
       
   343         ).
       
   344     ].
       
   345 
       
   346 
       
   347     ^ fileSpec
       
   348 
       
   349     "Modified: / 30.4.1999 / 18:02:22 / cg"
       
   350     "Created: / 2.5.1999 / 13:23:06 / cg"
       
   351 !
       
   352 
       
   353 xxspecOfFilesToCopy
       
   354     |fileSpec|
       
   355 
       
   356     OperatingSystem isMSWINDOWSlike ifTrue:[
       
   357         ^self specOfWindowsFilesToCopy
       
   358 
       
   359     ].
       
   360 
       
   361     fileSpec := #(
       
   362                 "/ name                             destination  subDir             required mode      
       
   363                 ( 'projects/smalltalk/smalltalk'        #bin     nil                  true  '755' )
       
   364                 ( 'projects/smalltalk/stx'              #bin     nil                  true  '755' )
       
   365                 ( 'projects/smalltalk/include'          #lib     nil                  true  '644' )
       
   366                 ( 'COPYRIGHT'                           #lib     nil                  true  '644' )
       
   367                 ( 'projects/smalltalk/*.rc'             #lib     nil                  true  '644' )
       
   368                 ( 'projects/smalltalk/patches'          #lib     nil                  true  '644' )
       
   369                 ( 'projects/smalltalk/bitmaps'          #lib     nil                  true  '644' )
       
   370                 ( 'projects/smalltalk/resources'        #lib     nil                  true  '644' )
       
   371                 ( 'projects/smalltalk/lib'              #lib     nil                  true  '644' )
       
   372                 ( 'doc/online/german/LICENCE.STX.html'  #lib     'doc/online/german'  true  '644' )
       
   373                 ( 'doc/online/english/LICENCE.STX.html' #lib     'doc/online/english' true  '644' )
       
   374     ).
       
   375 
       
   376     installDocFiles ifTrue:[
       
   377         fileSpec := fileSpec , #(
       
   378                 ( 'doc'                                  #lib     nil        false '644' )
       
   379         ).
       
   380     ].
       
   381 
       
   382     installSourceFiles ifTrue:[
       
   383         fileSpec := fileSpec , #(
       
   384                 ( 'projects/smalltalk/source'                #lib        nil        false '644' )
       
   385         ).
       
   386     ].
       
   387 
       
   388     installSTCFiles ifTrue:[
       
   389         fileSpec := fileSpec , #(
       
   390                 ( 'stc/stc'                                  #bin        nil              false '755' )
       
   391                 ( 'rules/stmkmp'                             #bin        nil              false '755' )
       
   392                 ( 'rules/stmkmf'                             #bin        nil              false '755' )
       
   393                 ( 'include'                                  #lib        nil              false '644' )
       
   394                 ( 'configurations'                           #lib        nil              false '644' )
       
   395                 ( 'configurations/PACKS'                     #lib        'configurations' false '644' )
       
   396                 ( 'configurations/my*'                       #lib        'configurations' false '644' )
       
   397                 ( 'configurations/vendor*'                   #lib        'configurations' false '644' )
       
   398                 ( 'rules'                                    #lib        nil              false '644' )
       
   399 
       
   400                 ( 'support/VGL/vogl/src/libvogl.*'           #lib        'lib'            false '644' )
       
   401                 ( 'support/VGL/vogl/src/*.h'                 #lib        'include'        false '644' )
       
   402                 ( 'support/DLD/dld-3.2.5/libdld.*'           #lib        'lib'            false '644' )
       
   403 
       
   404                 ( 'goodies/persistency/db-1.6/PORT/libdb.*'  #lib        'lib'            false '644' )
       
   405 
       
   406                 ( 'librun/librun.*'                          #libBin     nil              false '644' )
       
   407                 ( 'libbasic/libbasic.*'                      #libBin     nil              false '644' )
       
   408                 ( 'libbasic2/libbasic2.*'                    #libBin     nil              false '644' )
       
   409                 ( 'libbasic3/libbasic3.*'                    #libBin     nil              false '644' )
       
   410                 ( 'libhtml/libhtml.*'                        #libBin     nil              false '644' )
       
   411                 ( 'libcomp/libcomp.*'                        #libBin     nil              false '644' )
       
   412                 ( 'libcomp/ObjFL*.o'                         #libBin     nil              false '644' )
       
   413                 ( 'libcomp/ObjFL*.obj'                       #libBin     nil              false '644' )
       
   414                 ( 'libcomp/ObjFL*.so'                        #libBin     nil              false '644' )
       
   415                 ( 'libview/libview.*'                        #libBin     nil              false '644' )
       
   416                 ( 'libview/GLX*.o'                           #libBin     nil              false '644' )
       
   417                 ( 'libview/GLX*.obj'                         #libBin     nil              false '644' )
       
   418                 ( 'libview/GLX*.so'                          #libBin     nil              false '644' )
       
   419                 ( 'libview/XW*.o'                            #libBin     nil              false '644' )
       
   420                 ( 'libview/XW*.obj'                          #libBin     nil              false '644' )
       
   421                 ( 'libview/XW*.so'                           #libBin     nil              false '644' )
       
   422                 ( 'libview2/libview2.*'                      #libBin     nil              false '644' )
       
   423                 ( 'libwidg/libwidg.*'                        #libBin     nil              false '644' )
       
   424                 ( 'libwidg2/libwidg2.*'                      #libBin     nil              false '644' )
       
   425                 ( 'libwidg3/libwidg3.*'                      #libBin     nil              false '644' )
       
   426                 ( 'libui/libui.*'                            #libBin     nil              false '644' )
       
   427 
       
   428 "/                ( 'libsnmp/libsnmp.*'                        #libBin     nil      false '644' )
       
   429 "/                ( 'contrib/libPVM/libPVM.*'                  #libBin     nil      false '644' )
       
   430                 ( 'goodies/persistency/libdbase.*'           #libBin     nil      false '644' )
       
   431 "/                ( 'libtable/libtable.*'                      #libBin     nil      false '644' )
       
   432                 ( 'libtool/libtool.*'                        #libBin     nil      false '644' )
       
   433                 ( 'libtool2/libtool2.*'                      #libBin     nil      false '644' )
       
   434 "/                ( 'libxt/libxt.*'                            #libBin     nil      false '644' )
       
   435 "/                ( 'librt/librt.*'                            #libBin     nil      false '644' )
       
   436         ).
       
   437     ].
       
   438 
       
   439     installGoodyFiles ifTrue:[
       
   440         fileSpec := fileSpec , #(
       
   441                 ( 'goodies/*.st'                             #lib     'goodies'  false '644' )
       
   442                 ( 'goodies/*.chg'                            #lib     'goodies'  false '644' )
       
   443                 ( 'goodies/rdoit/rdoit'                      #bin     nil        false '755' )
       
   444                 ( 'goodies/bitmaps/rdoit'                    #lib     'goodies/bitmaps'  false '755' )
       
   445         ).
       
   446     ].
       
   447 
       
   448 
       
   449     ^ fileSpec
       
   450 
       
   451     "Modified: / 8.8.1997 / 18:39:06 / cg"
       
   452     "Created: / 2.5.1999 / 13:17:27 / cg"
   269 ! !
   453 ! !
   270 
   454 
   271 !STXInstaller methodsFor:'installing'!
   455 !STXInstaller methodsFor:'installing'!
   272 
   456 
   273 changeWritability
   457 changeWritability
   469     "Modified: / 20.4.1998 / 15:40:11 / cg"
   653     "Modified: / 20.4.1998 / 15:40:11 / cg"
   470 !
   654 !
   471 
   655 
   472 executeCommandAndShowOutput:cmd
   656 executeCommandAndShowOutput:cmd
   473     |doneSemaphore line p|
   657     |doneSemaphore line p|
       
   658 
       
   659     OperatingSystem isMSWINDOWSlike ifTrue:[
       
   660         ^ self
       
   661     ].
   474 
   662 
   475     doneSemaphore := Semaphore new.
   663     doneSemaphore := Semaphore new.
   476 
   664 
   477     copyProcess := [   
   665     copyProcess := [   
   478 
   666 
   500     ] forkAt:4.
   688     ] forkAt:4.
   501 
   689 
   502     doneSemaphore wait.
   690     doneSemaphore wait.
   503 
   691 
   504     "Created: / 25.2.1998 / 17:46:06 / cg"
   692     "Created: / 25.2.1998 / 17:46:06 / cg"
   505     "Modified: / 25.2.1998 / 18:36:50 / cg"
   693     "Modified: / 30.4.1999 / 18:00:43 / cg"
   506 !
   694 !
   507 
   695 
   508 outputInitialMessage
   696 outputInitialMessage
   509     #(
   697     #(
   510     'Notice:'
   698     'Notice:'
   553 !STXInstaller methodsFor:'startup'!
   741 !STXInstaller methodsFor:'startup'!
   554 
   742 
   555 askAndInstall
   743 askAndInstall
   556     "/ check, if we are in the projects/smalltalk directory
   744     "/ check, if we are in the projects/smalltalk directory
   557 
   745 
   558     |answer|
   746     |answer here|
   559 
   747 
   560     resources := ResourcePack for:self class.
   748     resources := ResourcePack for:self class.
   561 
   749 
   562     (Filename currentDirectory pathName endsWith:'projects/smalltalk') ifFalse:[
   750     ((here := Filename currentDirectory pathName) endsWith:'projects/smalltalk') ifFalse:[
   563         self warn:(resources string:'must be in the ''projects/smalltalk'' directory').
   751         (here endsWith:'stx\binbc') ifFalse:[
   564         ^ self
   752             self warn:(resources string:'must be in the ''projects/smalltalk'' directory').
       
   753             ^ self
       
   754         ]
   565     ].
   755     ].
   566 
   756 
   567     answer := self askForFullInstallation.
   757     answer := self askForFullInstallation.
   568     answer ifFalse:[^ self].
   758     answer ifFalse:[^ self].
   569 
   759 
   579                 ^ self
   769                 ^ self
   580             ]
   770             ]
   581         ]
   771         ]
   582     ].
   772     ].
   583 
   773 
   584     "Modified: / 25.2.1998 / 16:54:51 / cg"
   774     "Modified: / 30.4.1999 / 11:53:35 / cg"
   585 !
   775 !
   586 
   776 
   587 askForDestination
   777 askForDestination
   588     "open a dialog to enter destination directories"
   778     "open a dialog to enter destination directories"
   589 
   779 
   694     docMegabytes := 15.
   884     docMegabytes := 15.
   695     stcMegabytes := 2.
   885     stcMegabytes := 2.
   696     srcMegabytes := 25.
   886     srcMegabytes := 25.
   697     goodyMegabytes := 2.
   887     goodyMegabytes := 2.
   698 
   888 
   699     LastLibDir isNil ifTrue:[
   889     OperatingSystem isMSWINDOWSlike ifTrue:[
   700         LastLibDir := '/opt/smalltalk/' , self smalltalkRelease , '/lib'
   890         LastLibDir isNil ifTrue:[
   701     ].
   891             LastLibDir := '\Programme\SmalltalkX\' , self smalltalkRelease , '\lib'
   702     LastLibBinDir isNil ifTrue:[
   892         ].
   703         LastLibBinDir := '/opt/smalltalk/' , self smalltalkRelease , '/lib'
   893         LastLibBinDir isNil ifTrue:[
   704     ].
   894             LastLibBinDir := '\Programme\SmalltalkX\' , self smalltalkRelease , '\lib'
   705     LastBinDir isNil ifTrue:[
   895         ].
   706         LastBinDir := '/opt/smalltalk/' , self smalltalkRelease , '/bin'
   896         LastBinDir isNil ifTrue:[
       
   897             LastBinDir := '\Programme\SmalltalkX\' , self smalltalkRelease , '\lib'
       
   898         ].
       
   899     ] ifFalse:[
       
   900         LastLibDir isNil ifTrue:[
       
   901             LastLibDir := '/opt/smalltalk/' , self smalltalkRelease , '/lib'
       
   902         ].
       
   903         LastLibBinDir isNil ifTrue:[
       
   904             LastLibBinDir := '/opt/smalltalk/' , self smalltalkRelease , '/lib'
       
   905         ].
       
   906         LastBinDir isNil ifTrue:[
       
   907             LastBinDir := '/opt/smalltalk/' , self smalltalkRelease , '/bin'
       
   908         ].
   707     ].
   909     ].
   708 
   910 
   709     stxLibDirHolder := LastLibDir asValue.
   911     stxLibDirHolder := LastLibDir asValue.
   710     stxLibBinDirHolder := LastLibBinDir asValue.
   912     stxLibBinDirHolder := LastLibBinDir asValue.
   711     stxBinDirHolder := LastBinDir asValue.
   913     stxBinDirHolder := LastBinDir asValue.
   846     "
  1048     "
   847      STXInstaller open
  1049      STXInstaller open
   848     "
  1050     "
   849 
  1051 
   850     "Created: / 25.2.1998 / 17:11:26 / cg"
  1052     "Created: / 25.2.1998 / 17:11:26 / cg"
   851     "Modified: / 25.2.1998 / 19:43:30 / cg"
  1053     "Modified: / 30.4.1999 / 11:58:33 / cg"
   852 !
  1054 !
   853 
  1055 
   854 askForFullInstallation
  1056 askForFullInstallation
   855     "open a dialog to enter destination directories"
  1057     "open a dialog to enter destination directories"
   856 
  1058 
  1037         dirToMonitor := fullDir.
  1239         dirToMonitor := fullDir.
  1038     ] ifFalse:[
  1240     ] ifFalse:[
  1039         dirToMonitor := stxLibDir
  1241         dirToMonitor := stxLibDir
  1040     ].
  1242     ].
  1041 
  1243 
  1042     (OperatingSystem canExecuteCommand:'df ' , dirToMonitor) ifTrue:[
  1244     (OperatingSystem isMSWINDOWSlike not
       
  1245     and:[OperatingSystem canExecuteCommand:'df ' , dirToMonitor]) ifTrue:[
  1043         p := HorizontalPanelView in:v.
  1246         p := HorizontalPanelView in:v.
  1044         p origin:0.0@1.0 corner:1.0@1.0.
  1247         p origin:0.0@1.0 corner:1.0@1.0.
  1045         p topInset:-30.
  1248         p topInset:-30.
  1046         p horizontalLayout:#fit.
  1249         p horizontalLayout:#fit.
  1047 
  1250 
  1170     "
  1373     "
  1171      STXInstaller open
  1374      STXInstaller open
  1172     "
  1375     "
  1173 
  1376 
  1174     "Created: / 17.7.1996 / 15:11:27 / cg"
  1377     "Created: / 17.7.1996 / 15:11:27 / cg"
  1175     "Modified: / 20.4.1998 / 15:36:40 / cg"
  1378     "Modified: / 30.4.1999 / 17:53:53 / cg"
  1176 !
  1379 !
  1177 
  1380 
  1178 open
  1381 open
  1179     self askAndInstall.
  1382     self askAndInstall.
  1180 
  1383 
  1181     "
  1384     "
       
  1385      LastLibDir := LastBinDir := LastLibBinDir := nil.
       
  1386 
  1182      STXInstaller open
  1387      STXInstaller open
  1183     "
  1388     "
       
  1389 
       
  1390     "Modified: / 30.4.1999 / 11:59:00 / cg"
  1184 !
  1391 !
  1185 
  1392 
  1186 postInstall
  1393 postInstall
  1187     "some messages at the end ..."
  1394     "some messages at the end ..."
  1188 
  1395 
  1194 
  1401 
  1195     msg := (resources string:'ST/X Installation complete.\\') withCRs.
  1402     msg := (resources string:'ST/X Installation complete.\\') withCRs.
  1196     shInfo := ''.
  1403     shInfo := ''.
  1197     cshInfo := ''.
  1404     cshInfo := ''.
  1198 
  1405 
  1199     installWhat == #full ifTrue:[
  1406     OperatingSystem isMSWINDOWSlike ifFalse:[
  1200         msg := msg , 'You will now find a development directory hierarchy
  1407 
       
  1408         installWhat == #full ifTrue:[
       
  1409             msg := msg , 'You will now find a development directory hierarchy
  1201 in ''' , fullDir asText allBold , '''.
  1410 in ''' , fullDir asText allBold , '''.
  1202 
  1411 
  1203 To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk''
  1412 To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk''
  1204 and start smalltalk with the command: ''./smalltalk''.
  1413 and start smalltalk with the command: ''./smalltalk''.
  1205 
  1414 
  1206 To perform a partial installation of your customized smalltalk later,
  1415 To perform a partial installation of your customized smalltalk later,
  1207 use the INSTALL script found in ''' , fullDir , ''''.
  1416 use the INSTALL script found in ''' , fullDir , ''''.
  1208 
  1417 
  1209     ] ifFalse:[
  1418         ] ifFalse:[
  1210         havePath := true.
  1419             havePath := true.
  1211         (((OperatingSystem getEnvironment:'PATH')
  1420             (((OperatingSystem getEnvironment:'PATH')
  1212             asCollectionOfSubstringsSeparatedBy:$:)
  1421                 asCollectionOfSubstringsSeparatedBy:$:)
  1213                 includes:stxBinDir) ifFalse:[
  1422                     includes:stxBinDir) ifFalse:[
  1214 
  1423 
  1215             havePath := false.
  1424                 havePath := false.
  1216             shInfo  := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'.
  1425                 shInfo  := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'.
  1217             cshInfo := 'set path=($path ' , stxBinDir , ')\'.
  1426                 cshInfo := 'set path=($path ' , stxBinDir , ')\'.
  1218             msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\'
  1427                 msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\'
  1219                                       with:stxBinDir asText allBold) withCRs.
  1428                                           with:stxBinDir asText allBold) withCRs.
  1220         ].
  1429             ].
  1221 
  1430 
  1222         (stxLibDir ~= '/usr/local/lib/smalltalk'
  1431             (stxLibDir ~= '/usr/local/lib/smalltalk'
  1223         and:[stxLibDir ~= '/usr/lib/smalltalk'
  1432             and:[stxLibDir ~= '/usr/lib/smalltalk'
  1224         and:[stxLibDir ~= ('/opt/smalltalk/' , self smalltalkRelease , '/lib')]]) ifTrue:[
  1433             and:[stxLibDir ~= ('/opt/smalltalk/' , self smalltalkRelease , '/lib')]]) ifTrue:[
  1225             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").
  1434                 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").
  1226 You may have to define the %1 environment variable\as %2 if ST/X complains about not finding its files.\'
  1435 You may have to define the %1 environment variable\as %2 if ST/X complains about not finding its files.\'
  1227                                       with:'STX_LIBDIR' asText allBold 
  1436                                           with:'STX_LIBDIR' asText allBold 
  1228                                       with:stxLibDir asText allBold) withCRs.
  1437                                           with:stxLibDir asText allBold) withCRs.
  1229             havePath ifFalse:[
  1438                 havePath ifFalse:[
  1230                 msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs.
  1439                     msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs.
  1231             ] ifTrue:[
  1440                 ] ifTrue:[
  1232                 msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs.
  1441                     msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs.
       
  1442                 ].
       
  1443 
       
  1444                 shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'.
       
  1445                 cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'.
  1233             ].
  1446             ].
  1234 
  1447 
  1235             shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'.
  1448             shInfo notEmpty ifTrue:[
  1236             cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'.
  1449                 '*********************************************************' errorPrintCR.
  1237         ].
  1450                 (resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR.
  1238 
  1451                 (resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR.
  1239         shInfo notEmpty ifTrue:[
  1452                 '' errorPrintCR.
  1240             '*********************************************************' errorPrintCR.
  1453                 shInfo withCRs errorPrintCR.
  1241             (resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR.
  1454                 '' errorPrintCR.
  1242             (resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR.
  1455                 (resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR.
  1243             '' errorPrintCR.
  1456                 '' errorPrintCR.
  1244             shInfo withCRs errorPrintCR.
  1457                 cshInfo withCRs errorPrintCR.
  1245             '' errorPrintCR.
  1458                 '' errorPrintCR.
  1246             (resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR.
  1459                 '*********************************************************' errorPrintCR.
  1247             '' errorPrintCR.
  1460             ].
  1248             cshInfo withCRs errorPrintCR.
  1461         ].
  1249             '' errorPrintCR.
  1462     ].
  1250             '*********************************************************' errorPrintCR.
       
  1251         ].
       
  1252     ].
       
  1253 
       
  1254     msg := msg , '\\Have fun using ST/X !!'.
  1463     msg := msg , '\\Have fun using ST/X !!'.
  1255 
  1464 
  1256     self information:msg withCRs.
  1465     self information:msg withCRs.
  1257 
  1466 
  1258     "Modified: / 25.2.1998 / 19:29:04 / cg"
  1467     "Modified: / 30.4.1999 / 17:59:39 / cg"
  1259 !
  1468 !
  1260 
  1469 
  1261 preInstall
  1470 preInstall
  1262     "clobber the doc directory, to avoid copying cyclic symbolic links.
  1471     "clobber the doc directory, to avoid copying cyclic symbolic links.
  1263      Notice, the CD does not contain symlinks, but checking for them
  1472      Notice, the CD does not contain symlinks, but checking for them
  1264      allows installing from a development dir."
  1473      allows installing from a development dir."
  1265 
  1474 
  1266     |f|
  1475     |f|
  1267 
  1476 
  1268     f := '../../doc/online/english/german' asFilename.
  1477     OperatingSystem isMSWINDOWSlike ifFalse:[
  1269     f exists ifTrue:[
  1478         f := '../../doc/online/english/german' asFilename.
  1270         f isSymbolicLink ifTrue:[
  1479         f exists ifTrue:[
  1271             OperatingSystem executeCommand:'(cd ../../doc/online; make clobber) >/dev/null 2>/dev/null'
  1480             f isSymbolicLink ifTrue:[
       
  1481                 OperatingSystem executeCommand:'(cd ../../doc/online; make clobber) >/dev/null 2>/dev/null'
       
  1482             ]
  1272         ]
  1483         ]
  1273     ]
  1484     ]
  1274 
  1485 
  1275     "
  1486     "
  1276      STXInstaller new preInstall
  1487      STXInstaller new preInstall
  1277     "
  1488     "
  1278 
  1489 
  1279     "Modified: / 25.2.1998 / 17:39:55 / cg"
  1490     "Modified: / 30.4.1999 / 17:54:38 / cg"
  1280 ! !
  1491 ! !
  1281 
  1492 
  1282 !STXInstaller class methodsFor:'documentation'!
  1493 !STXInstaller class methodsFor:'documentation'!
  1283 
  1494 
  1284 version
  1495 version