STXInstaller.st
author Claus Gittinger <cg@exept.de>
Tue, 03 Sep 1996 15:16:32 +0200
changeset 4 8b68fdf7c870
parent 3 7b048cdcc856
child 5 16cff74f42b0
permissions -rw-r--r--
better looking; show command output
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
Object subclass:#STXInstaller
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
     2
	instanceVariableNames:'stxLibDir stxBinDir actionPercentageHolder actionTextHolder
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
     3
		commandTraceView'
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	classVariableNames:'LastBinDir LastLibDir'
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	poolDictionaries:''
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	category:'eXept-tools'
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!STXInstaller  class methodsFor:'startup'!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
open
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
    ^ self new open
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
    "Created: 17.7.1996 / 14:36:22 / cg"
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    16
    "Modified: 18.7.1996 / 21:20:22 / cg"
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    17
! !
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    18
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    19
!STXInstaller methodsFor:'defaults'!
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    20
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    21
defaultBinDirs
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    22
    |dirs|
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    23
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    24
    dirs := OrderedCollection new.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    25
    dirs add:'/usr/local/bin'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    26
    dirs add:'/usr/bin'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    27
    dirs add:(Filename homeDirectory constructString:'bin').
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    28
    dirs add:'/tmp/stxbin'.
3
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    29
    ('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    30
        dirs add:'/home/stx/bin'.
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    31
    ].
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    32
    ('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    33
        dirs add:'/home2/stx/bin'.
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    34
    ].
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    35
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    36
"/    dirs := dirs select:[:path | 
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    37
"/                            |f|
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    38
"/
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    39
"/                            f := path asFilename.
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    40
"/                            f exists and:[f isDirectory]].
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    41
    ^ dirs sort
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    42
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    43
    "Created: 18.7.1996 / 19:43:00 / cg"
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    44
    "Modified: 18.7.1996 / 19:45:08 / cg"
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    45
!
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    46
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    47
defaultLibDirs
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    48
    |dirs|
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    49
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    50
    dirs := OrderedCollection new.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    51
    dirs add:'/usr/local/lib/smalltalk'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    52
    dirs add:'/usr/lib/smalltalk'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    53
    dirs add:((Filename homeDirectory 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    54
                            construct:'lib')
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    55
                            constructString:'smalltalk').
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    56
    dirs add:'/tmp/stxlib'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    57
    dirs add:'/home/stx/lib'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    58
    dirs add:'/home2/stx/lib'.
3
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    59
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    60
"/    dirs := dirs select:[:path | 
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    61
"/                            |f|
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    62
"/
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    63
"/                            f := path asFilename.
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    64
"/                            f exists and:[f isDirectory]].
7b048cdcc856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
    65
    ^ dirs sort
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    66
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    67
    "Created: 18.7.1996 / 19:43:21 / cg"
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    68
    "Modified: 18.7.1996 / 19:46:04 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
! !
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
!STXInstaller methodsFor:'installing'!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
copyFiles
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    |msg fileSpec filesToCopy numFiles nDone|
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    msg := #('ST/X Installation' '' 'copying:' '' 'to:' '') asStringCollection.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    fileSpec := #(
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
    79
                "/ name                        destination   subDir  required mode      
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    81
                ( 'stc/stc'                         #bin     nil  false '755' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    82
                ( 'rules/stmkmp'                    #bin     nil  false '755' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    83
                ( 'rules/stmkmf'                    #bin     nil  false '755' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    84
                ( 'projects/smalltalk/smalltalk'    #bin     nil  true  '755' )
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    86
                ( 'librun/librun.a'                 #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    87
                ( 'libbasic/libbasic.o'             #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    88
                ( 'libbasic2/libbasic2.o'           #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    89
                ( 'libbasic3/libbasic3.o'           #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    90
                ( 'libcomp/libcomp.o'               #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    91
                ( 'libview/libview.o'               #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    92
                ( 'libview2/libview2.o'             #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    93
                ( 'libwidg/libwidg.o'               #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    94
                ( 'libwidg2/libwidg2.o'             #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    95
                ( 'libwidg3/libwidg3.o'             #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    96
                ( 'libsnmp/libsnmp.o'               #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    97
                ( 'libtable/libtable.o'             #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    98
                ( 'libtool/libtool.o'               #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
    99
                ( 'libxt/libxt.o'                   #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   100
                ( 'librt/librt.o'                   #lib     'lib'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   101
                ( 'support/VGL/vogl/src/libvogl.a'  #lib     'lib'        false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   102
                ( 'support/VGL/vogl/src/*.h'        #lib     'include'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   103
                ( 'support/DLD/dld-3.2.5/libdld.a'  #lib     'lib'        false '644' )
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   105
                ( 'projects/smalltalk/*.rc'         #lib   nil    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   106
                ( 'projects/smalltalk/patches'      #lib   nil    true  '644' )
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   108
                ( 'projects/smalltalk/bitmaps'      #lib nil    true  '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   109
                ( 'doc'                             #lib nil    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   110
                ( 'projects/smalltalk/include'      #lib nil    true  '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   111
                ( 'projects/smalltalk/resources'    #lib nil    true  '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   112
                ( 'projects/smalltalk/source'       #lib nil    true  '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   113
                ( 'configurations'                  #lib nil    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   114
                ( 'rules'                           #lib nil    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   115
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   116
                ( 'goodies/*.st'                    #lib 'goodies'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   117
                ( 'goodies/*.chg'                   #lib 'goodies'    false '644' )
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   118
                ( 'goodies/rdoit/rdoit'             #bin nil          false '755' )
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
              ).
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    filesToCopy := OrderedCollection new.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    fileSpec do:[:entry |
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
        |fileName dest subDir required destDir|
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
        fileName := entry at:1.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
        dest := entry at:2.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
        subDir := entry at:3.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
        required := entry at:4.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
        dest == #bin ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
            destDir := stxBinDir
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
        ] ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
            destDir := stxLibDir
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
        
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
        destDir := destDir asFilename.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
        subDir notNil ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
            destDir := destDir construct:subDir
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        filesToCopy add:(fileName -> destDir pathName)
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    numFiles := filesToCopy size.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    nDone := 0.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    filesToCopy do:[:entry |
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   149
        |fileName destDir cmd p text line|
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
        fileName := entry key.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
        destDir := entry value.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   154
        ('../../' , fileName) asFilename exists ifTrue:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   155
            actionPercentageHolder value:(nDone / numFiles * 100) rounded.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   157
            msg at:4 put:'    ' , (fileName asText allBold).
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   158
            msg at:6 put:'    ' , (destDir asText allBold).
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   159
            actionTextHolder value:nil.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   160
            actionTextHolder value:msg.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   161
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   162
            cmd := 'cp -r ../../' , fileName , ' ' , destDir.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   163
            commandTraceView showCR:cmd , ' ...'.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   164
            cmd := 'sh -c "echo ; ' , cmd , ' 2>&1"' .
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   165
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   166
            p := PipeStream readingFrom:cmd.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   167
            p isNil ifTrue:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   168
                self warn:('command error. Could not execute:\\' , cmd) withCRs.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   169
            ] ifFalse:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   170
    "/            text := OrderedCollection new.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   171
                [p atEnd] whileFalse:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   172
                    p readWaitWithTimeout:0.1.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   173
                    line := p nextLine.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   174
                    (line notNil and:[line notEmpty]) ifTrue:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   175
                        commandTraceView showCR:(('  ' , line) asText emphasizeAllWith:(#color->Color red)).
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   176
    "/                text add:line
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   177
                    ]
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   178
                ].
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   179
                p close.
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   180
            ].
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   181
    "/        (OperatingSystem executeCommand:('cp -r ../../' , fileName , ' ' , destDir))
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   182
    "/        ifFalse:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   183
    "/            self warn:('error while copying ' , fileName , '\\Please check manually.') withCRs.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   184
    "/        ].        
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   185
        ].
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
        nDone := nDone + 1
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    ^ true
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    "Created: 17.7.1996 / 15:16:20 / cg"
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   193
    "Modified: 18.7.1996 / 22:20:24 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
createDirectories
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    |msg dirsToMake numDirs nDone|
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    msg := #('ST/X Installation' '' 'creating directory:' '' '' '') asStringCollection.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    dirsToMake := OrderedCollection new.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    dirsToMake add:stxBinDir.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    dirsToMake add:stxLibDir.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    dirsToMake add:(stxLibDir asFilename constructString:'lib').
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    dirsToMake add:(stxLibDir asFilename constructString:'doc').
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    dirsToMake add:(stxLibDir asFilename constructString:'include').
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    dirsToMake add:(stxLibDir asFilename constructString:'resources').
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    dirsToMake add:(stxLibDir asFilename constructString:'binary').
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    dirsToMake add:(stxLibDir asFilename constructString:'bitmaps').
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   210
    dirsToMake add:(stxLibDir asFilename constructString:'goodies').
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    numDirs := dirsToMake size.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    nDone := 0.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
    dirsToMake do:[:dirName |
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
        |d errMsg stop box|
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
        actionPercentageHolder value:(nDone / numDirs * 100) rounded.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   220
        msg at:4 put:'    ' , (dirName asText allBold).
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
        actionTextHolder value:nil.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
        actionTextHolder value:msg.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
        d := dirName asFilename.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   226
        commandTraceView showCR:'creating ' , d pathName , ' ...'.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   227
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
        d exists ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
            OperatingSystem recursiveCreateDirectory:d pathName
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
        d exists ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
            errMsg := 'failed to create directory: ' , dirName.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
            stop := true
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
        ] ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
            d isDirectory ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
                errMsg := 'not a directory: ' , dirName.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
                stop := true
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
            ] ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
                (d isReadable
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
                and:[d isWritable]) ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
                    errMsg := 'no R/W access to directory: ' , dirName.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
                    stop := false
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
                ] ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
                    errMsg := nil
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
                ]
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
            ]
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
        errMsg notNil ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
            box := WarningBox new.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
            box title:errMsg.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
            box showAtPointerNotCovering:(WindowGroup activeGroup topViews first).
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   254
            stop ifTrue:[^ false].
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
        Delay waitForSeconds:0.25.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
        nDone := nDone + 1.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    ^ true
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
    "Created: 17.7.1996 / 15:24:19 / cg"
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   263
    "Modified: 18.7.1996 / 22:18:38 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
! !
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
!STXInstaller methodsFor:'startup'!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
askAndInstall
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    "/ check, if we are in the projects/smalltalk directory
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
    (Filename currentDirectory pathName endsWith:'projects/smalltalk') ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
        self warn:'must be in the projects/smalltalk directory'.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
        ^ self
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    [self askForDestination] whileTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
        self checkForExistingInstallationAndConfirm ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
            ^ self
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
        self doInstall ifTrue:[
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   281
            self postInstall.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
            ^ self
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
        ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
        (self confirm:'installation failed or aborted - retry ?')
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
        ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
            ^ self
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
        ]
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   290
    "Modified: 18.7.1996 / 21:20:56 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
askForDestination
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    "open a dialog to enter destination directories"
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
2
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   296
    |d cm l green dark img
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
     stxLibDirHolder stxBinDirHolder
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    |
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    LastLibDir isNil ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
        LastLibDir := '/usr/local/lib/smalltalk'
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    LastBinDir isNil ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
        LastBinDir := '/usr/local/bin'
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    stxLibDirHolder := LastLibDir asValue.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
    stxBinDirHolder := LastBinDir asValue.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    Screen current hasColors ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
        green := (Color red:0 green:80 blue:20) "darkened".
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
        dark := Color grey:10.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
    ] ifFalse:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
        green := Color white.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
        dark := Color black.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    d := DialogBox new.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    d label:'ST/X CD Installation'.
2
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   321
    img := Image fromFile:'SmalltalkX.xbm'.
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   322
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   323
    l := d addTextLabel:img.
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   324
    l adjust:#left; foregroundColor:green backgroundColor:dark.
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   325
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
    l := d addTextLabel:'Smalltalk/X CD installation.'.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
    d addVerticalSpace.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    d addVerticalSpace.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
    d addHorizontalLine.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
    l := d addTextLabel:'Destination directories:'.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
    l adjust:#left; backgroundColor:dark; foregroundColor:Color white.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
    cm := ComboBoxView on:stxBinDirHolder.
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   337
    cm list:self defaultBinDirs.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
    d 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
        addLabelledField:cm 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
        label:'binaries' 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
        adjust:#left 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
        tabable:true 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
        from:0.0 to:1.0 separateAtX:0.25
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
        nameAs:'binaryBox'.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    (d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    cm := ComboBoxView on:stxLibDirHolder.
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   349
    cm list:self defaultLibDirs.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
    d 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
        addLabelledField:cm 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
        label:'libraries' 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
        adjust:#left 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
        tabable:true 
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
        from:0.0 to:1.0 separateAtX:0.25
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
        nameAs:'libraryBox'.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
    (d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
    d addAbortButton; addOkButtonLabelled:'install'.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
    d extent:400@300.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
    d allViewBackground:dark.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
    d openAtCenter.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
    d accepted ifTrue:[
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
        stxLibDir := LastLibDir := stxLibDirHolder value.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
        stxBinDir := LastBinDir := stxBinDirHolder value.
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   369
        d destroy.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
        ^ true
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
    ].
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   372
    d destroy.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    ^ false
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   375
    "Modified: 18.7.1996 / 19:43:38 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
checkForExistingInstallationAndConfirm
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
    "look if there is another installation and confirm
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
     reinstalling; return true if ok, false if not"
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   382
    |whatToDo|
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   383
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
    stxLibDir asFilename exists ifTrue:[
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   385
        whatToDo := Dialog 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   386
                        choose:('detected existing installation in ' 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   387
                                 , stxLibDir asText allBold)
2
936a4407697b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   388
                        label:'Attention'
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   389
                        labels:#('remove first' 'overwrite' 'cancel') 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   390
                        values:#(remove over nil) 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   391
                        default:nil.     
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   392
        whatToDo isNil ifTrue:[^false].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   393
        whatToDo == #remove ifTrue:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   394
            (OperatingSystem recursiveRemoveDirectory:stxLibDir)
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   395
            ifFalse:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   396
                self warn:'mhmh - could not remove old installation.'
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   397
            ].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   398
        ].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   399
        ^ true
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   400
"/        ^ DialogBox
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   401
"/            confirm:('detected existing installation in ' 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   402
"/                     , stxLibDir asText allBold
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   403
"/                     , '\\continue & overwrite ?') withCRs 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   404
"/           yesLabel:'overwrite' noLabel:'cancel'
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
        
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
    ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
    ^ true
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   409
    "Modified: 18.7.1996 / 20:01:36 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
doInstall
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
    "install ST/X; return true if ok, false if not"
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   415
    |progressView ok textView|
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   416
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   417
    textView := HVScrollableView for:TextCollector.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   418
    textView preferredExtent:(100 @ 250).
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   419
    commandTraceView := textView scrolledView.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
    progressView := ProgressIndicator
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   422
                        inBoxWithLabel:'ST/X Installation' icon:(Depth8Image fromImage:NewLauncher aboutIcon)
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
                        text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   424
                        abortable:true
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   425
                        view:textView
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   426
                        closeWhenDone:false.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   427
    progressView topView extent:(500 min:Display width) @ 300.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
    ok := false.
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
    progressView showProgressOf:
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   432
            [:progressValue :currentAction| |msg|
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   433
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   434
              Processor activeProcess withPriority:7 do:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   435
                  actionPercentageHolder := progressValue.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   436
                  actionTextHolder := currentAction.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   438
                  (self createDirectories) ifTrue:[
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   439
                      ok := self copyFiles
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   440
                  ].
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   441
                  progressView topView abortButton label:'continue'.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   442
                  progressView topView abortButton action:[progressView topView hide].
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   443
                  msg := #('ST/X Installation finished.' '' 'press continue ...' '' '' '') asStringCollection.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   444
                  actionTextHolder value:nil.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   445
                  actionTextHolder value:msg.
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   446
              ] 
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
            ].
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    ^ ok
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
    "Created: 17.7.1996 / 15:11:27 / cg"
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    "Modified: 17.7.1996 / 15:24:27 / cg"
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
open
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   456
    self askAndInstall.
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
    "Created: 17.7.1996 / 14:37:14 / cg"
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   459
    "Modified: 18.7.1996 / 18:26:20 / cg"
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   460
!
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   461
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   462
postInstall
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   463
    "some messages at the end ..."
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   464
4
8b68fdf7c870 better looking; show command output
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   465
    |shInfo cshInfo msg havePath|
1
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   466
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   467
    msg := 'ST/X Installation complete.\\' withCRs.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   468
    shInfo := ''.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   469
    cshInfo := ''.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   470
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   471
    havePath := true.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   472
    (((OperatingSystem getEnvironment:'PATH')
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   473
        asCollectionOfSubstringsSeparatedBy:$:)
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   474
            includes:stxBinDir) ifFalse:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   475
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   476
        havePath := false.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   477
        shInfo  := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   478
        cshInfo := 'set path=($path ' , stxBinDir , ')\'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   479
        msg := msg , stxBinDir asText allBold , ' is not in your PATH.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   480
You should change your ".login" and/or ".profile" files to include it.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   481
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   482
'
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   483
    ].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   484
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   485
    (stxLibDir ~= '/usr/local/lib/smalltalk'
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   486
    and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   487
        msg := msg ,
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   488
'The library directory is not a standard ST/X library directory
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   489
("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk"). 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   490
You have to define the ' , 'STX_LIBDIR' asText allBold ,' environment variable 
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   491
as ' , stxLibDir asText allBold , ' before ST/X can be started.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   492
'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   493
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   494
        havePath ifFalse:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   495
            msg := msg , 'The above mentioned files are also a good place to do this.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   496
'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   497
        ] ifTrue:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   498
            msg := msg , 'The ".login" and/or ".profile" files are a good place to do this.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   499
'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   500
        ].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   501
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   502
        shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   503
        cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   504
    ].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   505
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   506
    shInfo notEmpty ifTrue:[
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   507
        'Please add the following to your ".profile" file:' errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   508
        '' errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   509
        shInfo withCRs errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   510
        '' errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   511
        'or (if you use csh/tcsh), add to your ".login" file:' errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   512
        '' errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   513
        cshInfo withCRs errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   514
        '' errorPrintCR.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   515
    ].
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   516
    self information:msg.
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   517
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   518
    "
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   519
     STXInstaller new postInstall
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   520
    "
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   521
7ebb34d8f3df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   522
    "Modified: 18.7.1996 / 22:10:42 / cg"
0
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
! !
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
!STXInstaller  class methodsFor:'documentation'!
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
version
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    ^ '$Header$'
ce9f4417b660 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
! !