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