author | Claus Gittinger <cg@exept.de> |
Mon, 27 Jul 1998 17:44:14 +0200 | |
changeset 917 | 43e80afe8222 |
parent 793 | 43a9a195b0f3 |
child 1010 | d744cc925443 |
permissions | -rw-r--r-- |
0 | 1 |
Object subclass:#STXInstaller |
24 | 2 |
instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir installDocFiles |
678 | 3 |
installSourceFiles installSTCFiles installGoodyFiles fullDir |
24 | 4 |
actionPercentageHolder actionTextHolder commandTraceView |
678 | 5 |
resources fullInstallation dfHolder copyProcess' |
6 |
classVariableNames:'LastBinDir LastLibBinDir LastLibDir LastFullDir' |
|
0 | 7 |
poolDictionaries:'' |
8 |
category:'eXept-tools' |
|
9 |
! |
|
10 |
||
11 |
||
28 | 12 |
!STXInstaller class methodsFor:'startup'! |
0 | 13 |
|
14 |
open |
|
15 |
^ self new open |
|
16 |
||
11 | 17 |
" |
18 |
STXInstaller open |
|
19 |
" |
|
1 | 20 |
! ! |
21 |
||
22 |
!STXInstaller methodsFor:'defaults'! |
|
23 |
||
24 |
defaultBinDirs |
|
25 |
|dirs| |
|
26 |
||
27 |
dirs := OrderedCollection new. |
|
28 |
dirs add:'/usr/local/bin'. |
|
29 |
dirs add:'/usr/bin'. |
|
30 |
dirs add:(Filename homeDirectory constructString:'bin'). |
|
14 | 31 |
dirs add:((Filename homeDirectory |
32 |
construct:'stx') |
|
33 |
constructString:'bin'). |
|
1 | 34 |
dirs add:'/tmp/stxbin'. |
3 | 35 |
('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[ |
36 |
dirs add:'/home/stx/bin'. |
|
37 |
]. |
|
38 |
('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[ |
|
39 |
dirs add:'/home2/stx/bin'. |
|
40 |
]. |
|
41 |
||
42 |
"/ dirs := dirs select:[:path | |
|
43 |
"/ |f| |
|
44 |
"/ |
|
45 |
"/ f := path asFilename. |
|
46 |
"/ f exists and:[f isDirectory]]. |
|
47 |
^ dirs sort |
|
1 | 48 |
|
49 |
"Created: 18.7.1996 / 19:43:00 / cg" |
|
50 |
"Modified: 18.7.1996 / 19:45:08 / cg" |
|
51 |
! |
|
52 |
||
678 | 53 |
defaultFullDirs |
54 |
|dirs| |
|
55 |
||
56 |
dirs := OrderedCollection new. |
|
57 |
dirs add:(Filename homeDirectory constructString:'stxDevelop'). |
|
58 |
dirs add:((Filename homeDirectory |
|
59 |
construct:'stx') |
|
60 |
constructString:'develop'). |
|
61 |
('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[ |
|
62 |
dirs add:'/home/stx/develop'. |
|
63 |
]. |
|
64 |
||
65 |
^ dirs sort |
|
66 |
||
67 |
"Modified: / 18.7.1996 / 19:45:08 / cg" |
|
68 |
"Created: / 25.2.1998 / 17:14:43 / cg" |
|
69 |
! |
|
70 |
||
24 | 71 |
defaultLibBinDirs |
72 |
|dirs| |
|
73 |
||
74 |
dirs := OrderedCollection new. |
|
75 |
dirs add:'/usr/local/lib'. |
|
76 |
dirs add:'/usr/lib'. |
|
77 |
dirs add:'/lib'. |
|
78 |
dirs add:(Filename homeDirectory |
|
79 |
constructString:'lib'). |
|
80 |
||
81 |
dirs add:((Filename homeDirectory |
|
82 |
construct:'stx') |
|
83 |
constructString:'lib'). |
|
84 |
dirs add:'/tmp/stxlib'. |
|
85 |
dirs add:'/home/stx/lib'. |
|
86 |
dirs add:'/home2/stx/lib'. |
|
87 |
||
88 |
^ dirs sort |
|
89 |
||
90 |
"Created: 18.7.1996 / 19:43:21 / cg" |
|
91 |
"Modified: 18.7.1996 / 19:46:04 / cg" |
|
92 |
! |
|
93 |
||
1 | 94 |
defaultLibDirs |
95 |
|dirs| |
|
96 |
||
97 |
dirs := OrderedCollection new. |
|
98 |
dirs add:'/usr/local/lib/smalltalk'. |
|
99 |
dirs add:'/usr/lib/smalltalk'. |
|
100 |
dirs add:((Filename homeDirectory |
|
101 |
construct:'lib') |
|
102 |
constructString:'smalltalk'). |
|
15 | 103 |
dirs add:((Filename homeDirectory |
104 |
construct:'stx') |
|
105 |
constructString:'lib'). |
|
1 | 106 |
dirs add:'/tmp/stxlib'. |
107 |
dirs add:'/home/stx/lib'. |
|
108 |
dirs add:'/home2/stx/lib'. |
|
3 | 109 |
|
110 |
"/ dirs := dirs select:[:path | |
|
111 |
"/ |f| |
|
112 |
"/ |
|
113 |
"/ f := path asFilename. |
|
114 |
"/ f exists and:[f isDirectory]]. |
|
115 |
^ dirs sort |
|
1 | 116 |
|
117 |
"Created: 18.7.1996 / 19:43:21 / cg" |
|
118 |
"Modified: 18.7.1996 / 19:46:04 / cg" |
|
11 | 119 |
! |
0 | 120 |
|
11 | 121 |
directoriesToMake |
122 |
|dirsToMake| |
|
0 | 123 |
|
11 | 124 |
dirsToMake := OrderedCollection new. |
678 | 125 |
fullInstallation ifTrue:[ |
126 |
dirsToMake add:fullDir. |
|
127 |
] ifFalse:[ |
|
128 |
dirsToMake add:stxBinDir. |
|
129 |
dirsToMake add:stxLibDir. |
|
130 |
dirsToMake add:stxLibBinDir. |
|
131 |
dirsToMake add:(stxLibDir asFilename constructString:'configurations'). |
|
132 |
dirsToMake add:(stxLibDir asFilename constructString:'doc'). |
|
133 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online'). |
|
134 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/english'). |
|
135 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/german'). |
|
136 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/french'). |
|
137 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/italian'). |
|
138 |
dirsToMake add:(stxLibDir asFilename constructString:'include'). |
|
139 |
dirsToMake add:(stxLibDir asFilename constructString:'resources'). |
|
140 |
dirsToMake add:(stxLibDir asFilename constructString:'binary'). |
|
141 |
dirsToMake add:(stxLibDir asFilename constructString:'bitmaps'). |
|
142 |
dirsToMake add:(stxLibDir asFilename constructString:'goodies'). |
|
143 |
]. |
|
144 |
^ dirsToMake |
|
0 | 145 |
|
678 | 146 |
"Modified: / 25.2.1998 / 17:15:19 / cg" |
11 | 147 |
! |
148 |
||
73 | 149 |
listOfOptionalPackages |
150 |
^ #( |
|
151 |
'libDB' |
|
152 |
'clients/CBrowser' |
|
153 |
'libcompat' |
|
154 |
'libxt' |
|
155 |
||
156 |
||
157 |
"/ mhmh - these should not be needed here ... |
|
158 |
||
159 |
'projects/smalltalk/bitmaps/javaImages' |
|
160 |
'doc/online/english/overview/icons' |
|
161 |
) |
|
162 |
||
163 |
"Created: 2.3.1997 / 12:39:59 / cg" |
|
164 |
"Modified: 2.3.1997 / 13:24:41 / cg" |
|
165 |
! |
|
166 |
||
11 | 167 |
specOfFilesToCopy |
168 |
|fileSpec| |
|
0 | 169 |
|
170 |
fileSpec := #( |
|
27 | 171 |
"/ name destination subDir required mode |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
172 |
( 'projects/smalltalk/smalltalk' #bin nil true '755' ) |
27 | 173 |
( 'projects/smalltalk/stx' #bin nil true '755' ) |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
174 |
( 'projects/smalltalk/include' #lib nil true '644' ) |
277 | 175 |
( 'COPYRIGHT' #lib nil true '644' ) |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
176 |
( 'projects/smalltalk/*.rc' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
177 |
( 'projects/smalltalk/patches' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
178 |
( 'projects/smalltalk/bitmaps' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
179 |
( 'projects/smalltalk/resources' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
180 |
( 'projects/smalltalk/lib' #lib nil true '644' ) |
16 | 181 |
( 'doc/online/german/LICENCE.STX.html' #lib 'doc/online/german' true '644' ) |
277 | 182 |
( 'doc/online/english/LICENCE.STX.html' #lib 'doc/online/english' true '644' ) |
5 | 183 |
). |
0 | 184 |
|
5 | 185 |
installDocFiles ifTrue:[ |
186 |
fileSpec := fileSpec , #( |
|
24 | 187 |
( 'doc' #lib nil false '644' ) |
5 | 188 |
). |
189 |
]. |
|
190 |
||
9 | 191 |
installSourceFiles ifTrue:[ |
192 |
fileSpec := fileSpec , #( |
|
24 | 193 |
( 'projects/smalltalk/source' #lib nil false '644' ) |
9 | 194 |
). |
195 |
]. |
|
196 |
||
5 | 197 |
installSTCFiles ifTrue:[ |
198 |
fileSpec := fileSpec , #( |
|
24 | 199 |
( 'stc/stc' #bin nil false '755' ) |
200 |
( 'rules/stmkmp' #bin nil false '755' ) |
|
201 |
( 'rules/stmkmf' #bin nil false '755' ) |
|
202 |
( 'include' #lib nil false '644' ) |
|
203 |
( 'configurations' #lib nil false '644' ) |
|
204 |
( 'configurations/PACKS' #lib 'configurations' false '644' ) |
|
205 |
( 'configurations/my*' #lib 'configurations' false '644' ) |
|
206 |
( 'configurations/vendor*' #lib 'configurations' false '644' ) |
|
207 |
( 'rules' #lib nil false '644' ) |
|
5 | 208 |
|
276 | 209 |
( 'support/VGL/vogl/src/libvogl.*' #lib 'lib' false '644' ) |
210 |
( 'support/VGL/vogl/src/*.h' #lib 'include' false '644' ) |
|
211 |
( 'support/DLD/dld-3.2.5/libdld.*' #lib 'lib' false '644' ) |
|
212 |
||
213 |
( 'goodies/persistency/db-1.6/PORT/libdb.*' #lib 'lib' false '644' ) |
|
0 | 214 |
|
276 | 215 |
( 'librun/librun.*' #libBin nil false '644' ) |
216 |
( 'libbasic/libbasic.*' #libBin nil false '644' ) |
|
217 |
( 'libbasic2/libbasic2.*' #libBin nil false '644' ) |
|
218 |
( 'libbasic3/libbasic3.*' #libBin nil false '644' ) |
|
219 |
( 'libhtml/libhtml.*' #libBin nil false '644' ) |
|
220 |
( 'libcomp/libcomp.*' #libBin nil false '644' ) |
|
221 |
( 'libcomp/ObjFL*.o' #libBin nil false '644' ) |
|
222 |
( 'libcomp/ObjFL*.obj' #libBin nil false '644' ) |
|
223 |
( 'libcomp/ObjFL*.so' #libBin nil false '644' ) |
|
224 |
( 'libview/libview.*' #libBin nil false '644' ) |
|
225 |
( 'libview/GLX*.o' #libBin nil false '644' ) |
|
226 |
( 'libview/GLX*.obj' #libBin nil false '644' ) |
|
227 |
( 'libview/GLX*.so' #libBin nil false '644' ) |
|
228 |
( 'libview/XW*.o' #libBin nil false '644' ) |
|
229 |
( 'libview/XW*.obj' #libBin nil false '644' ) |
|
230 |
( 'libview/XW*.so' #libBin nil false '644' ) |
|
231 |
( 'libview2/libview2.*' #libBin nil false '644' ) |
|
232 |
( 'libwidg/libwidg.*' #libBin nil false '644' ) |
|
233 |
( 'libwidg2/libwidg2.*' #libBin nil false '644' ) |
|
234 |
( 'libwidg3/libwidg3.*' #libBin nil false '644' ) |
|
235 |
( 'libui/libui.*' #libBin nil false '644' ) |
|
236 |
||
27 | 237 |
"/ ( 'libsnmp/libsnmp.*' #libBin nil false '644' ) |
238 |
"/ ( 'contrib/libPVM/libPVM.*' #libBin nil false '644' ) |
|
24 | 239 |
( 'goodies/persistency/libdbase.*' #libBin nil false '644' ) |
27 | 240 |
"/ ( 'libtable/libtable.*' #libBin nil false '644' ) |
24 | 241 |
( 'libtool/libtool.*' #libBin nil false '644' ) |
214
e5aaf5e3bbf9
also install libtool2 & libui
Claus Gittinger <cg@exept.de>
parents:
117
diff
changeset
|
242 |
( 'libtool2/libtool2.*' #libBin nil false '644' ) |
27 | 243 |
"/ ( 'libxt/libxt.*' #libBin nil false '644' ) |
244 |
"/ ( 'librt/librt.*' #libBin nil false '644' ) |
|
5 | 245 |
). |
246 |
]. |
|
0 | 247 |
|
5 | 248 |
installGoodyFiles ifTrue:[ |
249 |
fileSpec := fileSpec , #( |
|
250 |
( 'goodies/*.st' #lib 'goodies' false '644' ) |
|
251 |
( 'goodies/*.chg' #lib 'goodies' false '644' ) |
|
252 |
( 'goodies/rdoit/rdoit' #bin nil false '755' ) |
|
236 | 253 |
( 'goodies/bitmaps/rdoit' #lib 'goodies/bitmaps' false '755' ) |
5 | 254 |
). |
255 |
]. |
|
0 | 256 |
|
11 | 257 |
|
258 |
^ fileSpec |
|
259 |
||
277 | 260 |
"Modified: 8.8.1997 / 18:39:06 / cg" |
11 | 261 |
! ! |
262 |
||
263 |
!STXInstaller methodsFor:'installing'! |
|
264 |
||
790 | 265 |
changeWritability |
791 | 266 |
|msg| |
790 | 267 |
|
792 | 268 |
fullInstallation ifTrue:[ |
269 |
msg := (resources array:#('ST/X Installation' '' 'making target dir writable' '' '' '')) asStringCollection. |
|
790 | 270 |
|
792 | 271 |
commandTraceView showCR:(resources string:'making target dir writable ...'). |
272 |
commandTraceView endEntry. |
|
790 | 273 |
OperatingSystem executeCommand:('(cd ' , fullDir , ' ; find . -exec chmod u+w {} \;)'). |
274 |
]. |
|
275 |
||
791 | 276 |
"Created: / 17.7.1996 / 15:24:19 / cg" |
792 | 277 |
"Modified: / 20.4.1998 / 15:40:00 / cg" |
790 | 278 |
! |
279 |
||
11 | 280 |
copyFiles |
678 | 281 |
|msg fileSpec filesToCopy numFiles nDone cmd| |
282 |
||
283 |
msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection. |
|
284 |
||
285 |
fullInstallation ifTrue:[ |
|
286 |
msg at:4 put:(' all from CD' asText allBold). |
|
287 |
msg at:6 put:' ' , (fullDir asText allBold). |
|
288 |
actionTextHolder value:nil. |
|
289 |
actionTextHolder value:msg. |
|
11 | 290 |
|
793
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
291 |
cmd := '(cd ../.. ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
292 |
"/ "/ |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
293 |
"/ "/ not all systems have cp -rv |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
294 |
"/ "/ |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
295 |
"/ OperatingSystem getOSType = 'linux' ifTrue:[ |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
296 |
"/ cmd := 'cp -rv ../../* ' , fullDir. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
297 |
"/ ]. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
298 |
"/ commandTraceView showCR:cmd , ' ...'. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
299 |
commandTraceView showCR:'copying ...'. |
678 | 300 |
commandTraceView endEntry. |
301 |
cmd := cmd , ' 2>&1' . |
|
302 |
||
303 |
self executeCommandAndShowOutput:cmd. |
|
304 |
||
305 |
^ true |
|
306 |
]. |
|
11 | 307 |
|
308 |
fileSpec := self specOfFilesToCopy. |
|
309 |
||
0 | 310 |
filesToCopy := OrderedCollection new. |
311 |
||
312 |
fileSpec do:[:entry | |
|
8 | 313 |
|fileNames dest subDir required destDir| |
0 | 314 |
|
8 | 315 |
fileNames := entry at:1. |
0 | 316 |
dest := entry at:2. |
317 |
subDir := entry at:3. |
|
318 |
required := entry at:4. |
|
319 |
||
320 |
dest == #bin ifTrue:[ |
|
321 |
destDir := stxBinDir |
|
322 |
] ifFalse:[ |
|
24 | 323 |
dest == #libBin ifTrue:[ |
324 |
destDir := stxLibBinDir |
|
325 |
] ifFalse:[ |
|
326 |
destDir := stxLibDir |
|
327 |
] |
|
0 | 328 |
]. |
329 |
||
330 |
destDir := destDir asFilename. |
|
331 |
subDir notNil ifTrue:[ |
|
332 |
destDir := destDir construct:subDir |
|
333 |
]. |
|
334 |
||
8 | 335 |
filesToCopy add:(fileNames -> destDir pathName) |
0 | 336 |
]. |
337 |
||
338 |
numFiles := filesToCopy size. |
|
339 |
nDone := 0. |
|
340 |
||
341 |
filesToCopy do:[:entry | |
|
678 | 342 |
|fileName destDir cmd| |
0 | 343 |
|
344 |
fileName := entry key. |
|
345 |
destDir := entry value. |
|
346 |
||
8 | 347 |
((fileName includes:$*) |
348 |
or:[('../../' , fileName) asFilename exists])ifTrue:[ |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
349 |
actionPercentageHolder value:(nDone / numFiles * 100) rounded. |
0 | 350 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
351 |
msg at:4 put:' ' , (fileName asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
352 |
msg at:6 put:' ' , (destDir asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
353 |
actionTextHolder value:nil. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
354 |
actionTextHolder value:msg. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
355 |
|
73 | 356 |
((fileName includes:$*) not |
357 |
and:[('../../' , fileName) asFilename exists not]) ifTrue:[ |
|
358 |
(self listOfOptionalPackages includes:fileName) ifFalse:[ |
|
117 | 359 |
commandTraceView showCR:('cannot copy ' , fileName , ' - not included in distribution'). |
360 |
commandTraceView endEntry. |
|
73 | 361 |
] |
362 |
] ifFalse:[ |
|
363 |
cmd := 'cp -r ../../' , fileName , ' ' , destDir. |
|
364 |
commandTraceView showCR:cmd , ' ...'. |
|
117 | 365 |
commandTraceView endEntry. |
73 | 366 |
cmd := cmd , ' 2>&1' . |
1 | 367 |
|
678 | 368 |
self executeCommandAndShowOutput:cmd |
73 | 369 |
] |
1 | 370 |
]. |
0 | 371 |
|
372 |
nDone := nDone + 1 |
|
373 |
]. |
|
374 |
||
375 |
^ true |
|
376 |
||
678 | 377 |
" |
378 |
STXInstaller open |
|
379 |
" |
|
380 |
||
381 |
"Created: / 17.7.1996 / 15:16:20 / cg" |
|
793
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
382 |
"Modified: / 20.4.1998 / 17:41:45 / cg" |
0 | 383 |
! |
384 |
||
385 |
createDirectories |
|
386 |
|msg dirsToMake numDirs nDone| |
|
387 |
||
11 | 388 |
msg := (resources array:#('ST/X Installation' '' 'creating directory:' '' '' '')) asStringCollection. |
0 | 389 |
|
11 | 390 |
dirsToMake := self directoriesToMake. |
0 | 391 |
|
392 |
numDirs := dirsToMake size. |
|
393 |
nDone := 0. |
|
394 |
||
395 |
dirsToMake do:[:dirName | |
|
396 |
|d errMsg stop box| |
|
397 |
||
398 |
actionPercentageHolder value:(nDone / numDirs * 100) rounded. |
|
399 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
400 |
msg at:4 put:' ' , (dirName asText allBold). |
0 | 401 |
actionTextHolder value:nil. |
402 |
actionTextHolder value:msg. |
|
403 |
||
404 |
d := dirName asFilename. |
|
405 |
||
11 | 406 |
commandTraceView showCR:(resources string:'creating %1 ...' with:d pathName). |
117 | 407 |
commandTraceView endEntry. |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
408 |
|
0 | 409 |
d exists ifFalse:[ |
410 |
OperatingSystem recursiveCreateDirectory:d pathName |
|
411 |
]. |
|
412 |
||
413 |
d exists ifFalse:[ |
|
11 | 414 |
errMsg := resources string:'failed to create directory: %1' with: dirName. |
0 | 415 |
stop := true |
416 |
] ifTrue:[ |
|
417 |
d isDirectory ifFalse:[ |
|
11 | 418 |
errMsg := resources string:'not a directory: %1' with:dirName. |
0 | 419 |
stop := true |
420 |
] ifTrue:[ |
|
421 |
(d isReadable |
|
422 |
and:[d isWritable]) ifFalse:[ |
|
11 | 423 |
errMsg := resources string:'no read/write access to directory: %1' with:dirName. |
0 | 424 |
stop := false |
425 |
] ifTrue:[ |
|
426 |
errMsg := nil |
|
427 |
] |
|
428 |
] |
|
429 |
]. |
|
430 |
||
431 |
errMsg notNil ifTrue:[ |
|
432 |
box := WarningBox new. |
|
433 |
box title:errMsg. |
|
434 |
box showAtPointerNotCovering:(WindowGroup activeGroup topViews first). |
|
1 | 435 |
stop ifTrue:[^ false]. |
0 | 436 |
]. |
437 |
||
438 |
Delay waitForSeconds:0.25. |
|
439 |
nDone := nDone + 1. |
|
440 |
]. |
|
441 |
^ true |
|
442 |
||
443 |
"Created: 17.7.1996 / 15:24:19 / cg" |
|
117 | 444 |
"Modified: 22.5.1997 / 15:06:41 / cg" |
19 | 445 |
! |
446 |
||
447 |
createSymbolicLinks |
|
448 |
|msg dirsToMake numDirs nDone| |
|
449 |
||
450 |
msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection. |
|
451 |
||
28 | 452 |
commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...'). |
117 | 453 |
commandTraceView endEntry. |
678 | 454 |
fullInstallation ifTrue:[ |
455 |
OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)'). |
|
456 |
] ifFalse:[ |
|
457 |
OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)'). |
|
458 |
]. |
|
19 | 459 |
|
678 | 460 |
"Created: / 17.7.1996 / 15:24:19 / cg" |
792 | 461 |
"Modified: / 20.4.1998 / 15:40:11 / cg" |
678 | 462 |
! |
463 |
||
464 |
executeCommandAndShowOutput:cmd |
|
465 |
|doneSemaphore line p| |
|
466 |
||
467 |
doneSemaphore := Semaphore new. |
|
468 |
||
469 |
copyProcess := [ |
|
470 |
||
471 |
p := PipeStream readingFrom:cmd. |
|
472 |
p isNil ifTrue:[ |
|
473 |
self warn:('command error. Could not execute:\\' , cmd) withCRs. |
|
474 |
] ifFalse:[ |
|
475 |
[ |
|
476 |
[p atEnd] whileFalse:[ |
|
477 |
(p readWaitWithTimeout:0.1) ifFalse:[ |
|
478 |
line := p nextLine. |
|
479 |
(line notNil and:[line notEmpty]) ifTrue:[ |
|
480 |
commandTraceView showCR:((' ' , line) asText emphasizeAllWith:(#color->Color red)). |
|
481 |
commandTraceView endEntry. |
|
482 |
] |
|
483 |
] |
|
484 |
]. |
|
485 |
p close. |
|
486 |
] valueOnUnwindDo:[ |
|
487 |
p shutDown |
|
488 |
] |
|
489 |
]. |
|
490 |
doneSemaphore signal. |
|
491 |
copyProcess := nil. |
|
492 |
] forkAt:4. |
|
493 |
||
494 |
doneSemaphore wait. |
|
495 |
||
496 |
"Created: / 25.2.1998 / 17:46:06 / cg" |
|
497 |
"Modified: / 25.2.1998 / 18:36:50 / cg" |
|
73 | 498 |
! |
499 |
||
500 |
outputInitialMessage |
|
501 |
#( |
|
502 |
'Notice:' |
|
503 |
'' |
|
504 |
'During the installation, you may get error messages' |
|
505 |
'complaining that some files where not found' |
|
506 |
'and could therefore not be copied.' |
|
507 |
) do:[:line | |
|
508 |
commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). |
|
509 |
commandTraceView endEntry. |
|
510 |
]. |
|
511 |
||
512 |
Delay waitForSeconds:2. |
|
513 |
||
514 |
#( |
|
515 |
'' |
|
516 |
'This is normal behavior; since the CD may contain' |
|
517 |
'broken symbolic links to non-existing packages' |
|
518 |
'which are either not contained on your ordered' |
|
276 | 519 |
'package (i.e. non-commercial) or are not required' |
520 |
'for your architecture (and therefore not contained' |
|
521 |
'on the CD).' |
|
522 |
'' |
|
73 | 523 |
) do:[:line | |
524 |
commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). |
|
525 |
commandTraceView endEntry. |
|
526 |
]. |
|
527 |
||
528 |
Delay waitForSeconds:2. |
|
529 |
||
530 |
#( |
|
531 |
'' |
|
532 |
'Please excuse this inconvenience.' |
|
533 |
'' |
|
534 |
) do:[:line | |
|
535 |
commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). |
|
536 |
commandTraceView endEntry. |
|
537 |
]. |
|
538 |
||
539 |
Delay waitForSeconds:2. |
|
540 |
||
541 |
"Created: 2.3.1997 / 12:49:52 / cg" |
|
276 | 542 |
"Modified: 8.8.1997 / 17:47:06 / cg" |
0 | 543 |
! ! |
544 |
||
545 |
!STXInstaller methodsFor:'startup'! |
|
546 |
||
547 |
askAndInstall |
|
548 |
"/ check, if we are in the projects/smalltalk directory |
|
549 |
||
678 | 550 |
|answer| |
551 |
||
11 | 552 |
resources := ResourcePack for:self class. |
553 |
||
0 | 554 |
(Filename currentDirectory pathName endsWith:'projects/smalltalk') ifFalse:[ |
11 | 555 |
self warn:(resources string:'must be in the ''projects/smalltalk'' directory'). |
0 | 556 |
^ self |
557 |
]. |
|
558 |
||
678 | 559 |
answer := self askForFullInstallation. |
560 |
answer ifFalse:[^ self]. |
|
561 |
||
0 | 562 |
[self askForDestination] whileTrue:[ |
73 | 563 |
self checkForExistingInstallationAndConfirm ifTrue:[ |
564 |
self preInstall. |
|
565 |
self doInstall ifTrue:[ |
|
566 |
self postInstall. |
|
567 |
^ self |
|
568 |
]. |
|
569 |
(self confirm:(resources string:'installation failed or aborted - retry ?')) |
|
570 |
ifFalse:[ |
|
571 |
^ self |
|
572 |
] |
|
0 | 573 |
] |
574 |
]. |
|
575 |
||
678 | 576 |
"Modified: / 25.2.1998 / 16:54:51 / cg" |
0 | 577 |
! |
578 |
||
579 |
askForDestination |
|
580 |
"open a dialog to enter destination directories" |
|
581 |
||
678 | 582 |
fullInstallation ifTrue:[ |
583 |
^ self askForDestinationForFullInstallation |
|
584 |
] ifFalse:[ |
|
585 |
^ self askForDestinationForPartialInstallation |
|
586 |
] |
|
587 |
||
588 |
" |
|
589 |
STXInstaller open |
|
590 |
" |
|
591 |
||
592 |
"Modified: / 25.2.1998 / 17:12:45 / cg" |
|
593 |
! |
|
594 |
||
595 |
askForDestinationForFullInstallation |
|
596 |
"open a dialog to enter destination directories" |
|
597 |
||
598 |
|d cm l green dark img |
|
599 |
fullDirHolder| |
|
600 |
||
601 |
LastFullDir isNil ifTrue:[ |
|
602 |
LastFullDir := (Filename homeDirectory |
|
603 |
construct:'stx') |
|
604 |
constructString:'develop' |
|
605 |
]. |
|
606 |
||
607 |
fullDirHolder := LastFullDir asValue. |
|
608 |
||
609 |
Screen current hasColors ifTrue:[ |
|
610 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
611 |
dark := Color grey:10. |
|
612 |
] ifFalse:[ |
|
613 |
green := Color white. |
|
614 |
dark := Color black. |
|
615 |
]. |
|
616 |
||
617 |
d := DialogBox new. |
|
618 |
||
619 |
d label:(resources string:'ST/X Full Installation'). |
|
620 |
img := Image fromFile:'SmalltalkX.xbm'. |
|
621 |
||
622 |
l := d addTextLabel:img. |
|
623 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
624 |
||
625 |
l := d addTextLabel:(resources string:'Smalltalk/X CD installation (full).'). |
|
626 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
627 |
d addVerticalSpace. |
|
628 |
d addVerticalSpace. |
|
629 |
||
630 |
d addHorizontalLine. |
|
631 |
||
632 |
l := d addTextLabel:(resources string:'ST/X development directory:'). |
|
633 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
634 |
||
635 |
cm := ComboBoxView on:fullDirHolder. |
|
636 |
cm list:self defaultFullDirs. |
|
637 |
d |
|
638 |
addLabelledField:cm |
|
639 |
label:(resources string:'stx develop') |
|
640 |
adjust:#left |
|
641 |
tabable:true |
|
642 |
from:0.0 to:1.0 separateAtX:0.25 |
|
643 |
nameAs:'fullBox'. |
|
644 |
||
645 |
(d componentAt:'fullBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
646 |
||
647 |
d addVerticalSpace. |
|
648 |
d addHorizontalLine. |
|
649 |
||
650 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
|
651 |
addAbortButton; |
|
652 |
addOkButtonLabelled:(resources string:'install'). |
|
653 |
d extent:500@400. |
|
654 |
||
655 |
d allViewBackground:dark. |
|
656 |
||
657 |
d openAtCenter. |
|
658 |
d accepted ifTrue:[ |
|
659 |
fullDir := LastFullDir := fullDirHolder value. |
|
660 |
d destroy. |
|
661 |
^ true |
|
662 |
]. |
|
663 |
d destroy. |
|
664 |
^ false |
|
665 |
||
666 |
" |
|
667 |
STXInstaller open |
|
668 |
" |
|
669 |
||
670 |
"Created: / 25.2.1998 / 17:11:37 / cg" |
|
671 |
"Modified: / 25.2.1998 / 17:29:07 / cg" |
|
672 |
! |
|
673 |
||
674 |
askForDestinationForPartialInstallation |
|
675 |
"open a dialog to enter destination directories" |
|
676 |
||
2 | 677 |
|d cm l green dark img |
24 | 678 |
stxLibDirHolder stxLibBinDirHolder stxBinDirHolder |
5 | 679 |
installDocHolder installSourceHolder installSTCHolder installGoodiesHolder |
73 | 680 |
binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes |
0 | 681 |
| |
682 |
||
678 | 683 |
binMegabytes := 12. |
73 | 684 |
libMegabytes := 30. |
678 | 685 |
docMegabytes := 15. |
73 | 686 |
stcMegabytes := 1. |
678 | 687 |
srcMegabytes := 20. |
11 | 688 |
|
0 | 689 |
LastLibDir isNil ifTrue:[ |
690 |
LastLibDir := '/usr/local/lib/smalltalk' |
|
691 |
]. |
|
24 | 692 |
LastLibBinDir isNil ifTrue:[ |
693 |
LastLibBinDir := '/usr/local/lib' |
|
694 |
]. |
|
0 | 695 |
LastBinDir isNil ifTrue:[ |
696 |
LastBinDir := '/usr/local/bin' |
|
697 |
]. |
|
698 |
||
699 |
stxLibDirHolder := LastLibDir asValue. |
|
24 | 700 |
stxLibBinDirHolder := LastLibBinDir asValue. |
0 | 701 |
stxBinDirHolder := LastBinDir asValue. |
24 | 702 |
|
5 | 703 |
installDocHolder := true asValue. |
704 |
installSourceHolder := true asValue. |
|
705 |
installSTCHolder := true asValue. |
|
706 |
installGoodiesHolder := true asValue. |
|
0 | 707 |
|
708 |
Screen current hasColors ifTrue:[ |
|
709 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
710 |
dark := Color grey:10. |
|
711 |
] ifFalse:[ |
|
712 |
green := Color white. |
|
713 |
dark := Color black. |
|
714 |
]. |
|
715 |
||
716 |
d := DialogBox new. |
|
717 |
||
678 | 718 |
d label:(resources string:'ST/X Partial Installation'). |
2 | 719 |
img := Image fromFile:'SmalltalkX.xbm'. |
720 |
||
721 |
l := d addTextLabel:img. |
|
722 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
723 |
||
678 | 724 |
l := d addTextLabel:(resources string:'Smalltalk/X CD installation (partial).'). |
0 | 725 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
726 |
d addVerticalSpace. |
|
727 |
d addVerticalSpace. |
|
728 |
||
729 |
d addHorizontalLine. |
|
730 |
||
11 | 731 |
l := d addTextLabel:(resources string:'Destination directories:'). |
0 | 732 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
733 |
||
678 | 734 |
l := d addTextLabel:(resources string:'(the defaults below are recommended)'). |
735 |
l adjust:#right; backgroundColor:dark; foregroundColor:Color white. |
|
736 |
||
0 | 737 |
cm := ComboBoxView on:stxBinDirHolder. |
1 | 738 |
cm list:self defaultBinDirs. |
0 | 739 |
d |
740 |
addLabelledField:cm |
|
11 | 741 |
label:(resources string:'binaries') |
0 | 742 |
adjust:#left |
743 |
tabable:true |
|
744 |
from:0.0 to:1.0 separateAtX:0.25 |
|
745 |
nameAs:'binaryBox'. |
|
746 |
||
747 |
(d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
748 |
||
24 | 749 |
cm := ComboBoxView on:stxLibBinDirHolder. |
750 |
cm list:self defaultLibBinDirs. |
|
751 |
d |
|
752 |
addLabelledField:cm |
|
753 |
label:(resources string:'libraries') |
|
754 |
adjust:#left |
|
755 |
tabable:true |
|
756 |
from:0.0 to:1.0 separateAtX:0.25 |
|
757 |
nameAs:'libraryBinBox'. |
|
758 |
||
759 |
(d componentAt:'libraryBinBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
760 |
||
0 | 761 |
cm := ComboBoxView on:stxLibDirHolder. |
1 | 762 |
cm list:self defaultLibDirs. |
0 | 763 |
d |
764 |
addLabelledField:cm |
|
117 | 765 |
label:(resources string:'other files') |
0 | 766 |
adjust:#left |
767 |
tabable:true |
|
768 |
from:0.0 to:1.0 separateAtX:0.25 |
|
769 |
nameAs:'libraryBox'. |
|
770 |
||
771 |
(d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
772 |
||
5 | 773 |
d addVerticalSpace. |
774 |
d addHorizontalLine. |
|
775 |
d addVerticalSpace. |
|
776 |
||
11 | 777 |
(d addTextLabel:(resources string:'required:')) |
5 | 778 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
779 |
||
780 |
d leftIndent:35. |
|
11 | 781 |
(d addTextLabel:(resources string:'binaries (approx. %1 Mb)' with:binMegabytes printString)) |
5 | 782 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
11 | 783 |
(d addTextLabel:(resources string:'libraries (approx. %1 Mb)' with:libMegabytes printString)) |
5 | 784 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
785 |
d leftIndent:0. |
|
786 |
||
787 |
d addVerticalSpace. |
|
788 |
d addHorizontalLine. |
|
789 |
d addVerticalSpace. |
|
790 |
||
11 | 791 |
(d addTextLabel:(resources string:'optional:')) |
5 | 792 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
793 |
||
73 | 794 |
(d addCheckBox:((resources string:'doc files (+%1 Mb)' with:docMegabytes)) on:installDocHolder) |
5 | 795 |
labelView foregroundColor:Color white backgroundColor:dark. |
73 | 796 |
(d addCheckBox:((resources string:'stc & support files (+%1 Mb)' with:stcMegabytes)) on:installSTCHolder) |
10 | 797 |
labelView foregroundColor:Color white backgroundColor:dark. |
798 |
||
799 |
d addVerticalSpace. |
|
800 |
d addHorizontalLine. |
|
801 |
d addVerticalSpace. |
|
802 |
||
11 | 803 |
(d addTextLabel:(resources string:'optional (but highly recommended):')) |
10 | 804 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
805 |
||
73 | 806 |
(d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder) |
5 | 807 |
labelView foregroundColor:Color white backgroundColor:dark. |
73 | 808 |
(d addCheckBox:((resources string:'goodies (+0.5 Mb)')) on:installGoodiesHolder) |
5 | 809 |
labelView foregroundColor:Color white backgroundColor:dark. |
810 |
||
811 |
d addVerticalSpace. |
|
812 |
d addHorizontalLine. |
|
813 |
||
24 | 814 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
815 |
addAbortButton; |
|
816 |
addOkButtonLabelled:(resources string:'install'). |
|
73 | 817 |
d extent:500@400. |
0 | 818 |
|
819 |
d allViewBackground:dark. |
|
820 |
||
821 |
d openAtCenter. |
|
822 |
d accepted ifTrue:[ |
|
823 |
stxLibDir := LastLibDir := stxLibDirHolder value. |
|
24 | 824 |
stxLibBinDir := LastLibBinDir := stxLibBinDirHolder value. |
0 | 825 |
stxBinDir := LastBinDir := stxBinDirHolder value. |
5 | 826 |
installDocFiles := installDocHolder value. |
827 |
installSourceFiles := installSourceHolder value. |
|
828 |
installSTCFiles := installSTCHolder value. |
|
829 |
installGoodyFiles := installGoodiesHolder value. |
|
1 | 830 |
d destroy. |
0 | 831 |
^ true |
832 |
]. |
|
1 | 833 |
d destroy. |
0 | 834 |
^ false |
835 |
||
678 | 836 |
" |
837 |
STXInstaller open |
|
838 |
" |
|
839 |
||
840 |
"Created: / 25.2.1998 / 17:11:26 / cg" |
|
841 |
"Modified: / 25.2.1998 / 19:43:30 / cg" |
|
842 |
! |
|
843 |
||
844 |
askForFullInstallation |
|
845 |
"open a dialog to enter destination directories" |
|
846 |
||
847 |
|d cm l green dark img| |
|
848 |
||
849 |
Screen current hasColors ifTrue:[ |
|
850 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
851 |
dark := Color grey:10. |
|
852 |
] ifFalse:[ |
|
853 |
green := Color white. |
|
854 |
dark := Color black. |
|
855 |
]. |
|
856 |
||
857 |
d := DialogBox new. |
|
858 |
||
859 |
d label:(resources string:'ST/X CD Installation'). |
|
860 |
img := Image fromFile:'SmalltalkX.xbm'. |
|
861 |
||
862 |
l := d addTextLabel:img. |
|
863 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
864 |
||
865 |
l := d addTextLabel:(resources string:'Smalltalk/X CD installation.'). |
|
866 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
867 |
d addVerticalSpace. |
|
868 |
d addVerticalSpace. |
|
869 |
||
870 |
d addHorizontalLine. |
|
871 |
||
872 |
l := d addTextLabel:(resources string: |
|
873 |
'You can either perform a ' , 'full' asText allBold , ' installation, or a ' , 'partial' asText allBold ,' installation.'). |
|
874 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
875 |
||
876 |
d addVerticalSpace. |
|
877 |
d addHorizontalLine. |
|
878 |
||
879 |
d leftIndent:20. |
|
880 |
l := d addTextLabel:(resources string: |
|
881 |
'The full installation is required if you want to build your own |
|
882 |
customized smalltalk executable. It allows you to include additional |
|
883 |
precompiled classes or classLibraries. |
|
884 |
This is also required if you want to link your own standalone executables. |
|
885 |
||
886 |
It consists of a directory hierachy, including makefiles for a customizeable |
|
887 |
rebuild of the whole smalltalk system. |
|
888 |
(Actually, it simply copies the whole CD contents onto your disk). |
|
889 |
This requires roughly 120-200Mb of hard disk space.'). |
|
890 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
891 |
||
892 |
d addVerticalSpace. |
|
893 |
d addHorizontalLine. |
|
894 |
||
895 |
l := d addTextLabel:(resources string: |
|
896 |
'The partial installation requires less disk space and only copies the |
|
897 |
smalltalk executable, shared libraries and support files onto your hard disk. |
|
898 |
This requires roughly 70-90Mb of hard disk space. |
|
899 |
||
900 |
||
901 |
'). |
|
902 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
903 |
||
904 |
||
905 |
d leftIndent:0. |
|
906 |
d addVerticalSpace. |
|
907 |
d addHorizontalLine. |
|
908 |
||
909 |
||
910 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
|
911 |
addAbortButton; |
|
912 |
addOkButton:(Button label:(resources string:'install full') action:[fullInstallation:=true]); |
|
913 |
addOkButtonLabelled:(resources string:'install partial'). |
|
914 |
d extent:500@400. |
|
915 |
||
916 |
d allViewBackground:dark. |
|
917 |
||
918 |
fullInstallation := false. |
|
919 |
d openAtCenter. |
|
920 |
d accepted ifTrue:[ |
|
921 |
d destroy. |
|
922 |
^ true |
|
923 |
]. |
|
924 |
d destroy. |
|
925 |
^ false |
|
926 |
||
927 |
" |
|
928 |
STXInstaller open |
|
929 |
" |
|
930 |
||
931 |
"Created: / 25.2.1998 / 16:50:16 / cg" |
|
932 |
"Modified: / 25.2.1998 / 19:42:31 / cg" |
|
0 | 933 |
! |
934 |
||
935 |
checkForExistingInstallationAndConfirm |
|
936 |
"look if there is another installation and confirm |
|
937 |
reinstalling; return true if ok, false if not" |
|
938 |
||
678 | 939 |
|whichDir canOverWrite whatToDo box| |
940 |
||
941 |
fullInstallation ifTrue:[ |
|
942 |
whichDir := fullDir. |
|
943 |
canOverWrite := false. |
|
944 |
] ifFalse:[ |
|
945 |
whichDir := stxLibDir. |
|
946 |
canOverWrite := true. |
|
947 |
]. |
|
1 | 948 |
|
678 | 949 |
whichDir asFilename exists ifTrue:[ |
950 |
whatToDo := Dialog |
|
951 |
choose:(resources |
|
952 |
string:'detected existing ST/X installation in %1' |
|
953 |
with:whichDir asText allBold) |
|
954 |
label:(resources string:'Attention') |
|
955 |
labels:(resources array:(canOverWrite |
|
956 |
ifFalse:[#('remove first' 'cancel')] |
|
957 |
ifTrue:[#('remove first' 'overwrite' 'cancel')] )) |
|
958 |
values:(canOverWrite ifFalse:[#(remove nil)] ifTrue:[#(remove over nil)]) |
|
959 |
default:nil. |
|
73 | 960 |
|
678 | 961 |
whatToDo isNil ifTrue:[^false]. |
962 |
whatToDo == #remove ifTrue:[ |
|
963 |
((whichDir findString:'stx') == 0 |
|
964 |
and:[(whichDir findString:'smalltalk') == 0]) ifTrue:[ |
|
965 |
"/ confirm again |
|
966 |
(self confirm:(resources |
|
967 |
string:'are you certain that the directory to remove |
|
968 |
(' , whichDir , ') is really a smalltalk directory ? |
|
23
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
969 |
|
73 | 970 |
Remove it now ?')) ifFalse:[ |
678 | 971 |
^ false |
972 |
] |
|
973 |
]. |
|
974 |
||
975 |
[ |
|
976 |
box := DialogBox new label:'please wait'. |
|
977 |
box addTextLabel:'removing ' , whichDir , ' ...'. |
|
978 |
box showAtPointer. |
|
979 |
] forkAt:(Processor activePriority+1). |
|
980 |
box waitUntilVisible. |
|
23
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
981 |
|
678 | 982 |
(OperatingSystem recursiveRemoveDirectory:whichDir) |
983 |
ifFalse:[ |
|
984 |
self warn:(resources string:'mhmh - could not remove old installation. |
|
985 |
||
986 |
Please remove it manually (using root privileges if required) |
|
987 |
and try again.'). |
|
988 |
box destroy. |
|
989 |
^ false |
|
990 |
]. |
|
991 |
||
992 |
box destroy |
|
1 | 993 |
]. |
0 | 994 |
]. |
678 | 995 |
|
0 | 996 |
^ true |
997 |
||
678 | 998 |
" |
999 |
STXInstaller open |
|
1000 |
" |
|
1001 |
||
1002 |
"Modified: / 25.2.1998 / 19:35:12 / cg" |
|
0 | 1003 |
! |
1004 |
||
1005 |
doInstall |
|
1006 |
"install ST/X; return true if ok, false if not" |
|
1007 |
||
678 | 1008 |
|progressView ok v textView p l |
1009 |
dirToMonitor doDfMonitoring dfMonitorProcess| |
|
1010 |
||
1011 |
doDfMonitoring := false. |
|
1012 |
||
1013 |
v := View new preferredExtent:(250 @ 350). |
|
1014 |
||
1015 |
textView := HVScrollableView for:TextCollector in:v. |
|
1016 |
textView origin:0.0@0.0 corner:1.0@1.0. |
|
1017 |
textView bottomInset:30. |
|
1018 |
commandTraceView := textView scrolledView. |
|
1019 |
||
1020 |
fullInstallation ifTrue:[ |
|
1021 |
dirToMonitor := fullDir. |
|
1022 |
] ifFalse:[ |
|
1023 |
dirToMonitor := stxLibDir |
|
1024 |
]. |
|
1025 |
||
1026 |
(OperatingSystem canExecuteCommand:'df ' , dirToMonitor) ifTrue:[ |
|
1027 |
p := HorizontalPanelView in:v. |
|
1028 |
p origin:0.0@1.0 corner:1.0@1.0. |
|
1029 |
p topInset:-30. |
|
1030 |
p horizontalLayout:#fit. |
|
1031 |
||
1032 |
l := Label label:'' in:p. |
|
1033 |
l labelChannel:(dfHolder := '' asValue). |
|
1034 |
l adjust:#left. |
|
1035 |
dfMonitorProcess := [ |
|
1036 |
|ok p text keys values i l| |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1037 |
|
678 | 1038 |
ok := true. |
1039 |
[ok] whileTrue:[ |
|
1040 |
doDfMonitoring ifTrue:[ |
|
1041 |
ok := false. |
|
1042 |
p := PipeStream readingFrom:('df -k ' , dirToMonitor). |
|
1043 |
p notNil ifTrue:[ |
|
1044 |
[ |
|
1045 |
text := p contentsOfEntireFile. |
|
1046 |
] valueNowOrOnUnwindDo:[ |
|
1047 |
p close. |
|
1048 |
]. |
|
1049 |
"/ Transcript showCR:text asString. |
|
1050 |
text notNil ifTrue:[ |
|
1051 |
text := text asCollectionOfLines. |
|
1052 |
text size >= 2 ifTrue:[ |
|
1053 |
keys := (text at:1) asCollectionOfWords. |
|
1054 |
values := (text at:2) asCollectionOfWords. |
|
1055 |
i := (keys indexOf:'Capacity'). |
|
1056 |
i == 0 ifTrue:[ |
|
1057 |
i := (keys indexOf:'capacity'). |
|
1058 |
]. |
|
1059 |
i ~~ 0 ifTrue:[ |
|
1060 |
l := 'Used disk space: ' , (values at:i) withoutSeparators. |
|
1061 |
i := (keys indexOf:'Available'). |
|
1062 |
i == 0 ifTrue:[ |
|
1063 |
i := (keys indexOf:'available'). |
|
1064 |
i == 0 ifTrue:[ |
|
1065 |
i := (keys indexOf:'avail'). |
|
1066 |
i == 0 ifTrue:[ |
|
1067 |
i := (keys indexOf:'Avail'). |
|
1068 |
]. |
|
1069 |
]. |
|
1070 |
]. |
|
1071 |
i ~~ 0 ifTrue:[ |
|
1072 |
l := l , ' (' , (values at:i) withoutSeparators , 'k available)'. |
|
1073 |
]. |
|
1074 |
dfHolder value:l. |
|
1075 |
ok := true. |
|
1076 |
Delay waitForSeconds:9. |
|
1077 |
] |
|
1078 |
] |
|
1079 |
]. |
|
1080 |
]. |
|
1081 |
]. |
|
1082 |
Delay waitForSeconds:1. |
|
1083 |
] |
|
1084 |
] forkAt:(Processor activePriority+3) |
|
1085 |
]. |
|
0 | 1086 |
|
1087 |
progressView := ProgressIndicator |
|
26 | 1088 |
inBoxWithLabel:'ST/X Installation' icon:(Depth8Image fromImage:Launcher aboutIcon) |
0 | 1089 |
text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1090 |
abortable:true |
678 | 1091 |
view:v |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1092 |
closeWhenDone:false. |
73 | 1093 |
progressView topView extent:(640 min:Display width) @ (500 min:Display height). |
0 | 1094 |
|
1095 |
ok := false. |
|
1096 |
||
1097 |
progressView showProgressOf: |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1098 |
[:progressValue :currentAction| |msg| |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1099 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1100 |
Processor activeProcess withPriority:7 do:[ |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1101 |
[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1102 |
actionPercentageHolder := progressValue. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1103 |
actionTextHolder := currentAction. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1104 |
|
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1105 |
fullInstallation ifFalse:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1106 |
self outputInitialMessage. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1107 |
]. |
0 | 1108 |
|
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1109 |
(self createDirectories) ifTrue:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1110 |
doDfMonitoring := true. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1111 |
ok := self copyFiles |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1112 |
]. |
790 | 1113 |
self changeWritability. |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1114 |
self createSymbolicLinks. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1115 |
|
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1116 |
progressValue value:100. |
73 | 1117 |
|
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1118 |
progressView topView abortButton label:(resources string:'continue'). |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1119 |
progressView topView abortButton action:[progressView topView hide]. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1120 |
msg := (resources |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1121 |
array:#('ST/X Installation finished.' '' 'press continue ...' '' '' '')) |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1122 |
asStringCollection. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1123 |
actionTextHolder value:nil. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1124 |
actionTextHolder value:msg. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1125 |
] valueOnUnwindDo:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1126 |
dfMonitorProcess notNil ifTrue:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1127 |
dfMonitorProcess terminate. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1128 |
dfMonitorProcess := nil. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1129 |
]. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1130 |
copyProcess notNil ifTrue:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1131 |
copyProcess terminate. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1132 |
copyProcess := nil. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1133 |
]. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1134 |
] |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1135 |
] |
0 | 1136 |
]. |
1137 |
||
678 | 1138 |
dfMonitorProcess notNil ifTrue:[ |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1139 |
dfMonitorProcess terminate. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1140 |
dfMonitorProcess := nil. |
678 | 1141 |
]. |
1142 |
copyProcess notNil ifTrue:[ |
|
1143 |
copyProcess terminate. |
|
1144 |
copyProcess := nil. |
|
1145 |
]. |
|
0 | 1146 |
^ ok |
1147 |
||
678 | 1148 |
" |
1149 |
STXInstaller open |
|
1150 |
" |
|
1151 |
||
1152 |
"Created: / 17.7.1996 / 15:11:27 / cg" |
|
790 | 1153 |
"Modified: / 20.4.1998 / 15:36:40 / cg" |
0 | 1154 |
! |
1155 |
||
1156 |
open |
|
1 | 1157 |
self askAndInstall. |
0 | 1158 |
|
5 | 1159 |
" |
1160 |
STXInstaller open |
|
1161 |
" |
|
1 | 1162 |
! |
1163 |
||
1164 |
postInstall |
|
1165 |
"some messages at the end ..." |
|
1166 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1167 |
|shInfo cshInfo msg havePath| |
1 | 1168 |
|
678 | 1169 |
resources isNil ifTrue:[ |
1170 |
resources := ResourcePack for:self class. |
|
1171 |
]. |
|
1172 |
||
11 | 1173 |
msg := (resources string:'ST/X Installation complete.\\') withCRs. |
1 | 1174 |
shInfo := ''. |
1175 |
cshInfo := ''. |
|
1176 |
||
678 | 1177 |
fullInstallation ifTrue:[ |
1178 |
msg := msg , 'You will now find a development directory hierarchy |
|
1179 |
in ''' , fullDir asText allBold , '''. |
|
1180 |
||
1181 |
To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk'' |
|
1182 |
and start smalltalk with the command: ''./smalltalk''. |
|
1183 |
||
1184 |
To perform a partial installation of your customized smalltalk later, |
|
1185 |
use the INSTALL script found in ''' , fullDir , ''''. |
|
1 | 1186 |
|
678 | 1187 |
] ifFalse:[ |
1188 |
havePath := true. |
|
1189 |
(((OperatingSystem getEnvironment:'PATH') |
|
1190 |
asCollectionOfSubstringsSeparatedBy:$:) |
|
1191 |
includes:stxBinDir) ifFalse:[ |
|
1 | 1192 |
|
678 | 1193 |
havePath := false. |
1194 |
shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. |
|
1195 |
cshInfo := 'set path=($path ' , stxBinDir , ')\'. |
|
1196 |
msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\' |
|
1197 |
with:stxBinDir asText allBold) withCRs. |
|
1 | 1198 |
]. |
1199 |
||
678 | 1200 |
(stxLibDir ~= '/usr/local/lib/smalltalk' |
1201 |
and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[ |
|
1202 |
msg := msg , (resources string:'The library directory is not a standard ST/X library directory\("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk").\You have to define the %1 environment variable\as %2 before ST/X can be started.\' |
|
1203 |
with:'STX_LIBDIR' asText allBold |
|
1204 |
with:stxLibDir asText allBold) withCRs. |
|
1205 |
havePath ifFalse:[ |
|
1206 |
msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs. |
|
1207 |
] ifTrue:[ |
|
1208 |
msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs. |
|
1209 |
]. |
|
1 | 1210 |
|
678 | 1211 |
shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. |
1212 |
cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. |
|
1213 |
]. |
|
1214 |
||
1215 |
shInfo notEmpty ifTrue:[ |
|
1216 |
'*********************************************************' errorPrintCR. |
|
1217 |
(resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR. |
|
1218 |
(resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR. |
|
1219 |
'' errorPrintCR. |
|
1220 |
shInfo withCRs errorPrintCR. |
|
1221 |
'' errorPrintCR. |
|
1222 |
(resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR. |
|
1223 |
'' errorPrintCR. |
|
1224 |
cshInfo withCRs errorPrintCR. |
|
1225 |
'' errorPrintCR. |
|
1226 |
'*********************************************************' errorPrintCR. |
|
1227 |
]. |
|
1 | 1228 |
]. |
73 | 1229 |
|
1230 |
msg := msg , '\\Have fun using ST/X !!'. |
|
1231 |
||
1232 |
self information:msg withCRs. |
|
1 | 1233 |
|
678 | 1234 |
"Modified: / 25.2.1998 / 19:29:04 / cg" |
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1235 |
! |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1236 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1237 |
preInstall |
678 | 1238 |
"clobber the doc directory, to avoid copying cyclic symbolic links. |
1239 |
Notice, the CD does not contain symlinks, but checking for them |
|
1240 |
allows installing from a development dir." |
|
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1241 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1242 |
|f| |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1243 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1244 |
f := '../../doc/online/english/german' asFilename. |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1245 |
f exists ifTrue:[ |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1246 |
f isSymbolicLink ifTrue:[ |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1247 |
OperatingSystem executeCommand:'(cd ../../doc/online; make clobber) >/dev/null 2>/dev/null' |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1248 |
] |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1249 |
] |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1250 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1251 |
" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1252 |
STXInstaller new preInstall |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1253 |
" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1254 |
|
678 | 1255 |
"Modified: / 25.2.1998 / 17:39:55 / cg" |
0 | 1256 |
! ! |
1257 |
||
28 | 1258 |
!STXInstaller class methodsFor:'documentation'! |
0 | 1259 |
|
1260 |
version |
|
1261 |
^ '$Header$' |
|
1262 |
! ! |