10 |
10 |
11 open |
11 open |
12 ^ self new open |
12 ^ self new open |
13 |
13 |
14 "Created: 17.7.1996 / 14:36:22 / cg" |
14 "Created: 17.7.1996 / 14:36:22 / cg" |
|
15 "Modified: 18.7.1996 / 21:20:22 / cg" |
|
16 ! ! |
|
17 |
|
18 !STXInstaller methodsFor:'defaults'! |
|
19 |
|
20 defaultBinDirs |
|
21 |dirs| |
|
22 |
|
23 dirs := OrderedCollection new. |
|
24 dirs add:'/usr/local/bin'. |
|
25 dirs add:'/usr/bin'. |
|
26 dirs add:(Filename homeDirectory constructString:'bin'). |
|
27 dirs add:'/tmp/stxbin'. |
|
28 dirs add:'/home/stx/bin'. |
|
29 dirs add:'/home2/stx/bin'. |
|
30 ^ dirs |
|
31 |
|
32 "Created: 18.7.1996 / 19:43:00 / cg" |
|
33 "Modified: 18.7.1996 / 19:45:08 / cg" |
|
34 ! |
|
35 |
|
36 defaultLibDirs |
|
37 |dirs| |
|
38 |
|
39 dirs := OrderedCollection new. |
|
40 dirs add:'/usr/local/lib/smalltalk'. |
|
41 dirs add:'/usr/lib/smalltalk'. |
|
42 dirs add:((Filename homeDirectory |
|
43 construct:'lib') |
|
44 constructString:'smalltalk'). |
|
45 dirs add:'/tmp/stxlib'. |
|
46 dirs add:'/home/stx/lib'. |
|
47 dirs add:'/home2/stx/lib'. |
|
48 ^ dirs |
|
49 |
|
50 "Created: 18.7.1996 / 19:43:21 / cg" |
|
51 "Modified: 18.7.1996 / 19:46:04 / cg" |
15 ! ! |
52 ! ! |
16 |
53 |
17 !STXInstaller methodsFor:'installing'! |
54 !STXInstaller methodsFor:'installing'! |
18 |
55 |
19 copyFiles |
56 copyFiles |
20 |msg fileSpec filesToCopy numFiles nDone| |
57 |msg fileSpec filesToCopy numFiles nDone| |
21 |
58 |
22 msg := #('ST/X Installation' '' 'copying:' '' 'to:' '') asStringCollection. |
59 msg := #('ST/X Installation' '' 'copying:' '' 'to:' '') asStringCollection. |
23 |
60 |
24 fileSpec := #( |
61 fileSpec := #( |
25 "/ name destination subDir required |
62 "/ name destination subDir required |
26 |
63 |
27 ( 'stc/stc' #bin nil false) |
64 ( 'stc/stc' #bin nil false '755' ) |
28 ( 'rules/stmkmp' #bin nil false) |
65 ( 'rules/stmkmp' #bin nil false '755' ) |
29 ( 'rules/stmkmf' #bin nil false) |
66 ( 'rules/stmkmf' #bin nil false '755' ) |
30 |
67 ( 'projects/smalltalk/smalltalk' #bin nil true '755' ) |
31 ( 'librun/librun.a' #lib 'lib' false) |
68 |
32 ( 'libbasic/libbasic.o' #lib 'lib' false) |
69 ( 'librun/librun.a' #lib 'lib' false '644' ) |
33 ( 'libbasic2/libbasic2.o' #lib 'lib' false) |
70 ( 'libbasic/libbasic.o' #lib 'lib' false '644' ) |
34 ( 'libbasic3/libbasic3.o' #lib 'lib' false) |
71 ( 'libbasic2/libbasic2.o' #lib 'lib' false '644' ) |
35 ( 'libcomp/libcomp.o' #lib 'lib' false) |
72 ( 'libbasic3/libbasic3.o' #lib 'lib' false '644' ) |
36 ( 'libview/libview.o' #lib 'lib' false) |
73 ( 'libcomp/libcomp.o' #lib 'lib' false '644' ) |
37 ( 'libview2/libview2.o' #lib 'lib' false) |
74 ( 'libview/libview.o' #lib 'lib' false '644' ) |
38 ( 'libwidg/libwidg.o' #lib 'lib' false) |
75 ( 'libview2/libview2.o' #lib 'lib' false '644' ) |
39 ( 'libwidg2/libwidg2.o' #lib 'lib' false) |
76 ( 'libwidg/libwidg.o' #lib 'lib' false '644' ) |
40 ( 'libwidg3/libwidg3.o' #lib 'lib' false) |
77 ( 'libwidg2/libwidg2.o' #lib 'lib' false '644' ) |
41 ( 'libtool/libtool.o' #lib 'lib' false) |
78 ( 'libwidg3/libwidg3.o' #lib 'lib' false '644' ) |
42 |
79 ( 'libsnmp/libsnmp.o' #lib 'lib' false '644' ) |
43 ( 'projects/smalltalk/*.rc' #lib nil false) |
80 ( 'libtable/libtable.o' #lib 'lib' false '644' ) |
44 ( 'projects/smalltalk/patches' #lib nil false) |
81 ( 'libtool/libtool.o' #lib 'lib' false '644' ) |
45 |
82 ( 'libxt/libxt.o' #lib 'lib' false '644' ) |
46 ( 'projects/smalltalk/bitmaps' #lib nil false) |
83 ( 'librt/librt.o' #lib 'lib' false '644' ) |
47 ( 'projects/smalltalk/configurations' #lib nil false) |
84 ( 'support/VGL/vogl/src/libvogl.a' #lib 'lib' false '644' ) |
48 ( 'projects/smalltalk/doc' #lib nil false) |
85 ( 'support/VGL/vogl/src/*.h' #lib 'include' false '644' ) |
49 ( 'projects/smalltalk/include' #lib nil false) |
86 ( 'support/DLD/dld-3.2.5/libdld.a' #lib 'lib' false '644' ) |
50 ( 'projects/smalltalk/resources' #lib nil false) |
87 |
51 ( 'projects/smalltalk/rules' #lib nil false) |
88 ( 'projects/smalltalk/*.rc' #lib nil false '644' ) |
|
89 ( 'projects/smalltalk/patches' #lib nil true '644' ) |
|
90 |
|
91 ( 'projects/smalltalk/bitmaps' #lib nil true '644' ) |
|
92 ( 'doc' #lib nil false '644' ) |
|
93 ( 'projects/smalltalk/include' #lib nil true '644' ) |
|
94 ( 'projects/smalltalk/resources' #lib nil true '644' ) |
|
95 ( 'projects/smalltalk/source' #lib nil true '644' ) |
|
96 ( 'configurations' #lib nil false '644' ) |
|
97 ( 'rules' #lib nil false '644' ) |
|
98 |
|
99 ( 'goodies/*.st' #lib 'goodies' false '644' ) |
|
100 ( 'goodies/*.chg' #lib 'goodies' false '644' ) |
|
101 ( 'goodies/rdoit/rdoit' #bin nil false '755' ) |
52 ). |
102 ). |
53 |
103 |
54 filesToCopy := OrderedCollection new. |
104 filesToCopy := OrderedCollection new. |
55 |
105 |
56 fileSpec do:[:entry | |
106 fileSpec do:[:entry | |
89 msg at:4 put:' ' , (fileName asText allBold). |
139 msg at:4 put:' ' , (fileName asText allBold). |
90 msg at:6 put:' ' , (destDir asText allBold). |
140 msg at:6 put:' ' , (destDir asText allBold). |
91 actionTextHolder value:nil. |
141 actionTextHolder value:nil. |
92 actionTextHolder value:msg. |
142 actionTextHolder value:msg. |
93 |
143 |
94 OperatingSystem executeCommand:('cp -r ../../' , fileName , ' ' , destDir). |
144 cmd := 'cp -r ../../' , fileName , ' ' , destDir. |
|
145 |
|
146 p := PipeStream readingFrom:cmd. |
|
147 p isNil ifTrue:[ |
|
148 self warn:('command error. Could not execute:\\' , cmd) withCRs. |
|
149 ] ifFalse:[ |
|
150 text := OrderedCollection new. |
|
151 [p atEnd] whileFalse:[ |
|
152 text add:p nextLine |
|
153 ]. |
|
154 p close. |
|
155 ]. |
|
156 "/ (OperatingSystem executeCommand:('cp -r ../../' , fileName , ' ' , destDir)) |
|
157 "/ ifFalse:[ |
|
158 "/ self warn:('error while copying ' , fileName , '\\Please check manually.') withCRs. |
|
159 "/ ]. |
95 |
160 |
96 nDone := nDone + 1 |
161 nDone := nDone + 1 |
97 ]. |
162 ]. |
98 |
163 |
99 ^ true |
164 ^ true |
100 |
165 |
101 "Created: 17.7.1996 / 15:16:20 / cg" |
166 "Created: 17.7.1996 / 15:16:20 / cg" |
102 "Modified: 17.7.1996 / 15:21:09 / cg" |
167 "Modified: 18.7.1996 / 22:20:24 / cg" |
103 ! |
168 ! |
104 |
169 |
105 createDirectories |
170 createDirectories |
106 |msg dirsToMake numDirs nDone| |
171 |msg dirsToMake numDirs nDone| |
107 |
172 |
273 |
331 |
274 d openAtCenter. |
332 d openAtCenter. |
275 d accepted ifTrue:[ |
333 d accepted ifTrue:[ |
276 stxLibDir := LastLibDir := stxLibDirHolder value. |
334 stxLibDir := LastLibDir := stxLibDirHolder value. |
277 stxBinDir := LastBinDir := stxBinDirHolder value. |
335 stxBinDir := LastBinDir := stxBinDirHolder value. |
|
336 d destroy. |
278 ^ true |
337 ^ true |
279 ]. |
338 ]. |
|
339 d destroy. |
280 ^ false |
340 ^ false |
281 |
341 |
282 "Modified: 17.7.1996 / 15:08:30 / cg" |
342 "Modified: 18.7.1996 / 19:43:38 / cg" |
283 ! |
343 ! |
284 |
344 |
285 checkForExistingInstallationAndConfirm |
345 checkForExistingInstallationAndConfirm |
286 "look if there is another installation and confirm |
346 "look if there is another installation and confirm |
287 reinstalling; return true if ok, false if not" |
347 reinstalling; return true if ok, false if not" |
288 |
348 |
|
349 |whatToDo| |
|
350 |
289 stxLibDir asFilename exists ifTrue:[ |
351 stxLibDir asFilename exists ifTrue:[ |
290 ^ DialogBox |
352 whatToDo := Dialog |
291 confirm:('detected existing installation in ' |
353 choose:('detected existing installation in ' |
292 , stxLibDir asText allBold |
354 , stxLibDir asText allBold) |
293 , '\\continue & overwrite ?') withCRs |
355 labels:#('remove first' 'overwrite' 'cancel') |
294 yesLabel:'overwrite' noLabel:'cancel' |
356 values:#(remove over nil) |
|
357 default:nil. |
|
358 whatToDo isNil ifTrue:[^false]. |
|
359 whatToDo == #remove ifTrue:[ |
|
360 (OperatingSystem recursiveRemoveDirectory:stxLibDir) |
|
361 ifFalse:[ |
|
362 self warn:'mhmh - could not remove old installation.' |
|
363 ]. |
|
364 ]. |
|
365 ^ true |
|
366 "/ ^ DialogBox |
|
367 "/ confirm:('detected existing installation in ' |
|
368 "/ , stxLibDir asText allBold |
|
369 "/ , '\\continue & overwrite ?') withCRs |
|
370 "/ yesLabel:'overwrite' noLabel:'cancel' |
295 |
371 |
296 ]. |
372 ]. |
297 ^ true |
373 ^ true |
298 |
374 |
|
375 "Modified: 18.7.1996 / 20:01:36 / cg" |
299 ! |
376 ! |
300 |
377 |
301 doInstall |
378 doInstall |
302 "install ST/X; return true if ok, false if not" |
379 "install ST/X; return true if ok, false if not" |
303 |
380 |
327 "Created: 17.7.1996 / 15:11:27 / cg" |
404 "Created: 17.7.1996 / 15:11:27 / cg" |
328 "Modified: 17.7.1996 / 15:24:27 / cg" |
405 "Modified: 17.7.1996 / 15:24:27 / cg" |
329 ! |
406 ! |
330 |
407 |
331 open |
408 open |
332 self askAndInstall |
409 self askAndInstall. |
333 |
410 |
334 "Created: 17.7.1996 / 14:37:14 / cg" |
411 "Created: 17.7.1996 / 14:37:14 / cg" |
|
412 "Modified: 18.7.1996 / 18:26:20 / cg" |
|
413 ! |
|
414 |
|
415 postInstall |
|
416 "some messages at the end ..." |
|
417 |
|
418 |shInfo cshInfo msg stxBinDir stxLibDir havePath| |
|
419 |
|
420 stxBinDir := '/home2/stx/bin'. |
|
421 stxLibDir := '/home2/stx/lib'. |
|
422 |
|
423 msg := 'ST/X Installation complete.\\' withCRs. |
|
424 shInfo := ''. |
|
425 cshInfo := ''. |
|
426 |
|
427 havePath := true. |
|
428 (((OperatingSystem getEnvironment:'PATH') |
|
429 asCollectionOfSubstringsSeparatedBy:$:) |
|
430 includes:stxBinDir) ifFalse:[ |
|
431 |
|
432 havePath := false. |
|
433 shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. |
|
434 cshInfo := 'set path=($path ' , stxBinDir , ')\'. |
|
435 msg := msg , stxBinDir asText allBold , ' is not in your PATH. |
|
436 You should change your ".login" and/or ".profile" files to include it. |
|
437 |
|
438 ' |
|
439 ]. |
|
440 |
|
441 (stxLibDir ~= '/usr/local/lib/smalltalk' |
|
442 and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[ |
|
443 msg := msg , |
|
444 'The library directory is not a standard ST/X library directory |
|
445 ("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk"). |
|
446 You have to define the ' , 'STX_LIBDIR' asText allBold ,' environment variable |
|
447 as ' , stxLibDir asText allBold , ' before ST/X can be started. |
|
448 '. |
|
449 |
|
450 havePath ifFalse:[ |
|
451 msg := msg , 'The above mentioned files are also a good place to do this. |
|
452 '. |
|
453 ] ifTrue:[ |
|
454 msg := msg , 'The ".login" and/or ".profile" files are a good place to do this. |
|
455 '. |
|
456 ]. |
|
457 |
|
458 shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. |
|
459 cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. |
|
460 ]. |
|
461 |
|
462 shInfo notEmpty ifTrue:[ |
|
463 'Please add the following to your ".profile" file:' errorPrintCR. |
|
464 '' errorPrintCR. |
|
465 shInfo withCRs errorPrintCR. |
|
466 '' errorPrintCR. |
|
467 'or (if you use csh/tcsh), add to your ".login" file:' errorPrintCR. |
|
468 '' errorPrintCR. |
|
469 cshInfo withCRs errorPrintCR. |
|
470 '' errorPrintCR. |
|
471 ]. |
|
472 self information:msg. |
|
473 |
|
474 " |
|
475 STXInstaller new postInstall |
|
476 " |
|
477 |
|
478 "Modified: 18.7.1996 / 22:10:42 / cg" |
335 ! ! |
479 ! ! |
336 |
480 |
337 !STXInstaller class methodsFor:'documentation'! |
481 !STXInstaller class methodsFor:'documentation'! |
338 |
482 |
339 version |
483 version |