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