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