STXInstaller.st
changeset 1117 657dde1e749d
parent 1010 d744cc925443
child 1118 ebecbe5d4b6b
equal deleted inserted replaced
1116:710c9297a9fc 1117:657dde1e749d
    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     dirs add:'/usr/local/bin'.
    29     dirs add:'/usr/local/bin'.
    29     dirs add:'/usr/bin'.
    30     dirs add:'/usr/bin'.
    30     dirs add:(Filename homeDirectory constructString:'bin').
    31     dirs add:(Filename homeDirectory constructString:'bin').
    31     dirs add:((Filename homeDirectory 
    32     dirs add:((Filename homeDirectory 
    32 			    construct:'stx')
    33                             construct:'stx')
    33 			    constructString:'bin').
    34                             constructString:'bin').
    34     dirs add:'/tmp/stxbin'.
    35     dirs add:'/tmp/stxbin'.
    35     ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
    36     ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
    36         dirs add:'/home/stx/bin'.
    37         dirs add:'/home/stx/bin'.
    37     ].
    38     ].
    38     ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
    39     ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
    42 "/    dirs := dirs select:[:path | 
    43 "/    dirs := dirs select:[:path | 
    43 "/                            |f|
    44 "/                            |f|
    44 "/
    45 "/
    45 "/                            f := path asFilename.
    46 "/                            f := path asFilename.
    46 "/                            f exists and:[f isDirectory]].
    47 "/                            f exists and:[f isDirectory]].
    47     ^ dirs sort
    48     ^ dirs "sort"
    48 
    49 
    49     "Created: 18.7.1996 / 19:43:00 / cg"
    50     "Created: 18.7.1996 / 19:43:00 / cg"
    50     "Modified: 18.7.1996 / 19:45:08 / cg"
    51     "Modified: 18.7.1996 / 19:45:08 / cg"
    51 !
    52 !
    52 
    53 
    60                             constructString:'develop').
    61                             constructString:'develop').
    61     ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
    62     ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
    62         dirs add:'/home/stx/develop'.
    63         dirs add:'/home/stx/develop'.
    63     ].
    64     ].
    64 
    65 
    65     ^ dirs sort
    66     ^ dirs "sort"
    66 
    67 
    67     "Modified: / 18.7.1996 / 19:45:08 / cg"
    68     "Modified: / 18.7.1996 / 19:45:08 / cg"
    68     "Created: / 25.2.1998 / 17:14:43 / cg"
    69     "Created: / 25.2.1998 / 17:14:43 / cg"
    69 !
    70 !
    70 
    71 
    93 
    94 
    94 defaultLibDirs
    95 defaultLibDirs
    95     |dirs|
    96     |dirs|
    96 
    97 
    97     dirs := OrderedCollection new.
    98     dirs := OrderedCollection new.
       
    99     dirs add:'/opt/smalltalk/' , self smalltalkRelease , '/lib'.
    98     dirs add:'/usr/local/lib/smalltalk'.
   100     dirs add:'/usr/local/lib/smalltalk'.
    99     dirs add:'/usr/lib/smalltalk'.
   101     dirs add:'/usr/lib/smalltalk'.
   100     dirs add:((Filename homeDirectory 
   102     dirs add:((Filename homeDirectory 
   101                             construct:'lib')
   103                             construct:'lib')
   102                             constructString:'smalltalk').
   104                             constructString:'smalltalk').
   110 "/    dirs := dirs select:[:path | 
   112 "/    dirs := dirs select:[:path | 
   111 "/                            |f|
   113 "/                            |f|
   112 "/
   114 "/
   113 "/                            f := path asFilename.
   115 "/                            f := path asFilename.
   114 "/                            f exists and:[f isDirectory]].
   116 "/                            f exists and:[f isDirectory]].
   115     ^ dirs sort
   117     ^ dirs "sort"
   116 
   118 
   117     "Created: 18.7.1996 / 19:43:21 / cg"
   119     "Created: 18.7.1996 / 19:43:21 / cg"
   118     "Modified: 18.7.1996 / 19:46:04 / cg"
   120     "Modified: 18.7.1996 / 19:46:04 / cg"
   119 !
   121 !
   120 
   122 
   160         'doc/online/english/overview/icons'
   162         'doc/online/english/overview/icons'
   161       )
   163       )
   162 
   164 
   163     "Created: 2.3.1997 / 12:39:59 / cg"
   165     "Created: 2.3.1997 / 12:39:59 / cg"
   164     "Modified: 2.3.1997 / 13:24:41 / cg"
   166     "Modified: 2.3.1997 / 13:24:41 / cg"
       
   167 !
       
   168 
       
   169 smalltalkRelease
       
   170     ^ Smalltalk majorVersionNr printString 
       
   171                , '.' , Smalltalk minorVersionNr printString
       
   172                , '.' , Smalltalk revisionNr printString.
   165 !
   173 !
   166 
   174 
   167 specOfFilesToCopy
   175 specOfFilesToCopy
   168     |fileSpec|
   176     |fileSpec|
   169 
   177 
   676 
   684 
   677     |d cm l green dark img
   685     |d cm l green dark img
   678      stxLibDirHolder stxLibBinDirHolder stxBinDirHolder
   686      stxLibDirHolder stxLibBinDirHolder stxBinDirHolder
   679      installDocHolder installSourceHolder installSTCHolder installGoodiesHolder
   687      installDocHolder installSourceHolder installSTCHolder installGoodiesHolder
   680      binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes
   688      binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes
       
   689      goodyMegabytes
   681     |
   690     |
   682 
   691 
   683     binMegabytes := 12.
   692     binMegabytes := 12.
   684     libMegabytes := 30.
   693     libMegabytes := 30.
   685     docMegabytes := 15.
   694     docMegabytes := 15.
   686     stcMegabytes := 1.
   695     stcMegabytes := 2.
   687     srcMegabytes := 20.
   696     srcMegabytes := 25.
       
   697     goodyMegabytes := 2.
   688 
   698 
   689     LastLibDir isNil ifTrue:[
   699     LastLibDir isNil ifTrue:[
   690         LastLibDir := '/usr/local/lib/smalltalk'
   700         LastLibDir := '/opt/smalltalk/' , self smalltalkRelease , '/lib'
   691     ].
   701     ].
   692     LastLibBinDir isNil ifTrue:[
   702     LastLibBinDir isNil ifTrue:[
   693         LastLibBinDir := '/usr/local/lib'
   703         LastLibBinDir := '/opt/smalltalk/' , self smalltalkRelease , '/lib'
   694     ].
   704     ].
   695     LastBinDir isNil ifTrue:[
   705     LastBinDir isNil ifTrue:[
   696         LastBinDir := '/usr/local/bin'
   706         LastBinDir := '/opt/smalltalk/' , self smalltalkRelease , '/bin'
   697     ].
   707     ].
   698 
   708 
   699     stxLibDirHolder := LastLibDir asValue.
   709     stxLibDirHolder := LastLibDir asValue.
   700     stxLibBinDirHolder := LastLibBinDir asValue.
   710     stxLibBinDirHolder := LastLibBinDir asValue.
   701     stxBinDirHolder := LastBinDir asValue.
   711     stxBinDirHolder := LastBinDir asValue.
   803     (d addTextLabel:(resources string:'optional (but highly recommended):'))
   813     (d addTextLabel:(resources string:'optional (but highly recommended):'))
   804         adjust:#left; foregroundColor:Color white backgroundColor:dark.
   814         adjust:#left; foregroundColor:Color white backgroundColor:dark.
   805 
   815 
   806     (d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder)
   816     (d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder)
   807         labelView foregroundColor:Color white backgroundColor:dark.
   817         labelView foregroundColor:Color white backgroundColor:dark.
   808     (d addCheckBox:((resources string:'goodies (+0.5 Mb)')) on:installGoodiesHolder)
   818     (d addCheckBox:((resources string:'goodies (+%1 Mb)' with:goodyMegabytes)) on:installGoodiesHolder)
   809         labelView foregroundColor:Color white backgroundColor:dark.
   819         labelView foregroundColor:Color white backgroundColor:dark.
   810 
   820 
   811     d addVerticalSpace.
   821     d addVerticalSpace.
   812     d addHorizontalLine.
   822     d addHorizontalLine.
   813 
   823 
   876     d addVerticalSpace.
   886     d addVerticalSpace.
   877     d addHorizontalLine.
   887     d addHorizontalLine.
   878 
   888 
   879     d leftIndent:20.
   889     d leftIndent:20.
   880     l := d addTextLabel:(resources string:
   890     l := d addTextLabel:(resources string:
   881 'The full installation is required if you want to build your own
   891 'full:' asText allBold , '
   882 customized smalltalk executable. It allows you to include additional 
   892 The full installation is required if you want to build your own
   883 precompiled classes or classLibraries. 
   893 customized smalltalk executable. It allows you to create and include 
       
   894 additional precompiled binary classes or classLibraries. 
   884 This is also required if you want to link your own standalone executables.
   895 This is also required if you want to link your own standalone executables.
   885 
   896 
   886 It consists of a directory hierachy, including makefiles for a customizeable 
   897 It consists of a directory hierachy, including makefiles for a customizeable 
   887 rebuild of the whole smalltalk system.
   898 rebuild of the whole smalltalk system.
   888 (Actually, it simply copies the whole CD contents onto your disk).
   899 (Actually, it simply copies the whole CD contents onto your disk).
   891 
   902 
   892     d addVerticalSpace.
   903     d addVerticalSpace.
   893     d addHorizontalLine.
   904     d addHorizontalLine.
   894 
   905 
   895     l := d addTextLabel:(resources string:
   906     l := d addTextLabel:(resources string:
   896 'The partial installation requires less disk space and only copies the
   907 'partial:' asText allBold , '
       
   908 The partial (runTime) installation requires less disk space and only copies the
   897 smalltalk executable, shared libraries and support files onto your hard disk.
   909 smalltalk executable, shared libraries and support files onto your hard disk.
       
   910 This setup allows normal smalltalk development and is also useful as a runtime
       
   911 environment for smalltalk applications.
       
   912 However, it does not support recreation of a new smalltal executable and/or
       
   913 shared binary classLibraries.
   898 This requires roughly 70-90Mb of hard disk space.
   914 This requires roughly 70-90Mb of hard disk space.
   899 
   915 
   900 
   916 
   901  ').
   917  ').
   902     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
   918     l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
  1004 
  1020 
  1005 doInstall
  1021 doInstall
  1006     "install ST/X; return true if ok, false if not"
  1022     "install ST/X; return true if ok, false if not"
  1007 
  1023 
  1008     |progressView ok v textView p l 
  1024     |progressView ok v textView p l 
  1009      dirToMonitor doDfMonitoring dfMonitorProcess|
  1025      dirToMonitor doDfMonitoring dfMonitorProcess kB|
  1010 
  1026 
  1011     doDfMonitoring := false.
  1027     doDfMonitoring := false.
  1012 
  1028 
  1013     v := View new preferredExtent:(250 @ 350).
  1029     v := View new preferredExtent:(250 @ 350).
  1014 
  1030 
  1067                                                i := (keys indexOf:'Avail').
  1083                                                i := (keys indexOf:'Avail').
  1068                                            ].
  1084                                            ].
  1069                                        ].
  1085                                        ].
  1070                                    ].
  1086                                    ].
  1071                                    i ~~ 0 ifTrue:[
  1087                                    i ~~ 0 ifTrue:[
  1072                                         l := l , ' (' , (values at:i) withoutSeparators , 'k available)'.
  1088                                         kB := (values at:i) withoutSeparators.
       
  1089                                         l := l , ' (' , kB , 'k available)'.
  1073                                    ].
  1090                                    ].
  1074                                    dfHolder value:l.
  1091                                    dfHolder value:l.
  1075                                    ok := true.
  1092                                    ok := true.
  1076                                    Delay waitForSeconds:9.
  1093                                    Delay waitForSeconds:9.
  1077                                ]
  1094                                ]
  1112                       ].
  1129                       ].
  1113                       self changeWritability.
  1130                       self changeWritability.
  1114                       self createSymbolicLinks.
  1131                       self createSymbolicLinks.
  1115 
  1132 
  1116                       progressValue value:100.
  1133                       progressValue value:100.
       
  1134 
       
  1135                       progressView topView raise.
       
  1136                       commandTraceView showCR:'Installation finished.' asText allBold.
       
  1137                       commandTraceView endEntry. 
       
  1138                       textView flash.
  1117 
  1139 
  1118                       progressView topView abortButton label:(resources string:'continue').
  1140                       progressView topView abortButton label:(resources string:'continue').
  1119                       progressView topView abortButton action:[progressView topView hide].
  1141                       progressView topView abortButton action:[progressView topView hide].
  1120                       msg := (resources 
  1142                       msg := (resources 
  1121                                  array:#('ST/X Installation finished.' '' 'press continue ...' '' '' ''))
  1143                                  array:#('ST/X Installation finished.' '' 'press continue ...' '' '' ''))
  1196             msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\'
  1218             msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\'
  1197                                       with:stxBinDir asText allBold) withCRs.
  1219                                       with:stxBinDir asText allBold) withCRs.
  1198         ].
  1220         ].
  1199 
  1221 
  1200         (stxLibDir ~= '/usr/local/lib/smalltalk'
  1222         (stxLibDir ~= '/usr/local/lib/smalltalk'
  1201         and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[
  1223         and:[stxLibDir ~= '/usr/lib/smalltalk'
  1202             msg := msg , (resources string:'The library directory is not a standard ST/X library directory\("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk").\You have to define the %1 environment variable\as %2 before ST/X can be started.\'
  1224         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").
       
  1226 You may have to define the %1 environment variable\as %2 if ST/X complains about not finding its files.\'
  1203                                       with:'STX_LIBDIR' asText allBold 
  1227                                       with:'STX_LIBDIR' asText allBold 
  1204                                       with:stxLibDir asText allBold) withCRs.
  1228                                       with:stxLibDir asText allBold) withCRs.
  1205             havePath ifFalse:[
  1229             havePath ifFalse:[
  1206                 msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs.
  1230                 msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs.
  1207             ] ifTrue:[
  1231             ] ifTrue:[