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