author | ca |
Fri, 14 Feb 1997 18:20:05 +0100 | |
changeset 48 | 2fb81a3e0246 |
parent 31 | 0f95ba9204f6 |
child 73 | 2087134eea96 |
permissions | -rw-r--r-- |
0 | 1 |
Object subclass:#STXInstaller |
24 | 2 |
instanceVariableNames:'stxLibDir stxLibBinDir stxBinDir installDocFiles |
3 |
installSourceFiles installSTCFiles installGoodyFiles |
|
4 |
actionPercentageHolder actionTextHolder commandTraceView |
|
5 |
resources' |
|
6 |
classVariableNames:'LastBinDir LastLibBinDir LastLibDir' |
|
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 |
||
24 | 53 |
defaultLibBinDirs |
54 |
|dirs| |
|
55 |
||
56 |
dirs := OrderedCollection new. |
|
57 |
dirs add:'/usr/local/lib'. |
|
58 |
dirs add:'/usr/lib'. |
|
59 |
dirs add:'/lib'. |
|
60 |
dirs add:(Filename homeDirectory |
|
61 |
constructString:'lib'). |
|
62 |
||
63 |
dirs add:((Filename homeDirectory |
|
64 |
construct:'stx') |
|
65 |
constructString:'lib'). |
|
66 |
dirs add:'/tmp/stxlib'. |
|
67 |
dirs add:'/home/stx/lib'. |
|
68 |
dirs add:'/home2/stx/lib'. |
|
69 |
||
70 |
^ dirs sort |
|
71 |
||
72 |
"Created: 18.7.1996 / 19:43:21 / cg" |
|
73 |
"Modified: 18.7.1996 / 19:46:04 / cg" |
|
74 |
! |
|
75 |
||
1 | 76 |
defaultLibDirs |
77 |
|dirs| |
|
78 |
||
79 |
dirs := OrderedCollection new. |
|
80 |
dirs add:'/usr/local/lib/smalltalk'. |
|
81 |
dirs add:'/usr/lib/smalltalk'. |
|
82 |
dirs add:((Filename homeDirectory |
|
83 |
construct:'lib') |
|
84 |
constructString:'smalltalk'). |
|
15 | 85 |
dirs add:((Filename homeDirectory |
86 |
construct:'stx') |
|
87 |
constructString:'lib'). |
|
1 | 88 |
dirs add:'/tmp/stxlib'. |
89 |
dirs add:'/home/stx/lib'. |
|
90 |
dirs add:'/home2/stx/lib'. |
|
3 | 91 |
|
92 |
"/ dirs := dirs select:[:path | |
|
93 |
"/ |f| |
|
94 |
"/ |
|
95 |
"/ f := path asFilename. |
|
96 |
"/ f exists and:[f isDirectory]]. |
|
97 |
^ dirs sort |
|
1 | 98 |
|
99 |
"Created: 18.7.1996 / 19:43:21 / cg" |
|
100 |
"Modified: 18.7.1996 / 19:46:04 / cg" |
|
11 | 101 |
! |
0 | 102 |
|
11 | 103 |
directoriesToMake |
104 |
|dirsToMake| |
|
0 | 105 |
|
11 | 106 |
dirsToMake := OrderedCollection new. |
107 |
dirsToMake add:stxBinDir. |
|
108 |
dirsToMake add:stxLibDir. |
|
24 | 109 |
dirsToMake add:stxLibBinDir. |
110 |
dirsToMake add:(stxLibDir asFilename constructString:'configurations'). |
|
11 | 111 |
dirsToMake add:(stxLibDir asFilename constructString:'doc'). |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
112 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online'). |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
113 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/english'). |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
114 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/german'). |
19 | 115 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/french'). |
116 |
dirsToMake add:(stxLibDir asFilename constructString:'doc/online/italian'). |
|
11 | 117 |
dirsToMake add:(stxLibDir asFilename constructString:'include'). |
118 |
dirsToMake add:(stxLibDir asFilename constructString:'resources'). |
|
119 |
dirsToMake add:(stxLibDir asFilename constructString:'binary'). |
|
120 |
dirsToMake add:(stxLibDir asFilename constructString:'bitmaps'). |
|
121 |
dirsToMake add:(stxLibDir asFilename constructString:'goodies'). |
|
0 | 122 |
|
11 | 123 |
^ dirsToMake |
124 |
! |
|
125 |
||
126 |
specOfFilesToCopy |
|
127 |
|fileSpec| |
|
0 | 128 |
|
129 |
fileSpec := #( |
|
27 | 130 |
"/ name destination subDir required mode |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
131 |
( 'projects/smalltalk/smalltalk' #bin nil true '755' ) |
27 | 132 |
( 'projects/smalltalk/stx' #bin nil true '755' ) |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
133 |
( 'projects/smalltalk/include' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
134 |
( 'projects/smalltalk/*.rc' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
135 |
( 'projects/smalltalk/patches' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
136 |
( 'projects/smalltalk/bitmaps' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
137 |
( 'projects/smalltalk/resources' #lib nil true '644' ) |
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
138 |
( 'projects/smalltalk/lib' #lib nil true '644' ) |
16 | 139 |
( 'doc/online/german/LICENCE.STX.html' #lib 'doc/online/german' true '644' ) |
19 | 140 |
"/ ( 'doc/online/english/LICENCE.STX.html' #lib 'doc/online/english' true '644' ) |
5 | 141 |
). |
0 | 142 |
|
5 | 143 |
installDocFiles ifTrue:[ |
144 |
fileSpec := fileSpec , #( |
|
24 | 145 |
( 'doc' #lib nil false '644' ) |
5 | 146 |
). |
147 |
]. |
|
148 |
||
9 | 149 |
installSourceFiles ifTrue:[ |
150 |
fileSpec := fileSpec , #( |
|
24 | 151 |
( 'projects/smalltalk/source' #lib nil false '644' ) |
9 | 152 |
). |
153 |
]. |
|
154 |
||
5 | 155 |
installSTCFiles ifTrue:[ |
156 |
fileSpec := fileSpec , #( |
|
24 | 157 |
( 'stc/stc' #bin nil false '755' ) |
158 |
( 'rules/stmkmp' #bin nil false '755' ) |
|
159 |
( 'rules/stmkmf' #bin nil false '755' ) |
|
160 |
( 'include' #lib nil false '644' ) |
|
161 |
( 'configurations' #lib nil false '644' ) |
|
162 |
( 'configurations/PACKS' #lib 'configurations' false '644' ) |
|
163 |
( 'configurations/my*' #lib 'configurations' false '644' ) |
|
164 |
( 'configurations/vendor*' #lib 'configurations' false '644' ) |
|
165 |
( 'rules' #lib nil false '644' ) |
|
5 | 166 |
|
24 | 167 |
( 'support/VGL/vogl/src/libvogl.*' #lib 'lib' false '644' ) |
168 |
( 'support/VGL/vogl/src/*.h' #lib 'include' false '644' ) |
|
169 |
( 'support/DLD/dld-3.2.5/libdld.*' #lib 'lib' false '644' ) |
|
170 |
( 'goodies/persistency/db-1.6/PORT/libdb.*' #lib 'lib' false '644' ) |
|
0 | 171 |
|
24 | 172 |
( 'librun/librun.*' #libBin nil false '644' ) |
173 |
( 'libbasic/libbasic.*' #libBin nil false '644' ) |
|
174 |
( 'libbasic2/libbasic2.*' #libBin nil false '644' ) |
|
175 |
( 'libbasic3/libbasic3.*' #libBin nil false '644' ) |
|
176 |
( 'libhtml/libhtml.*' #libBin nil false '644' ) |
|
177 |
( 'libcomp/libcomp.*' #libBin nil false '644' ) |
|
178 |
( 'libview/libview.*' #libBin nil false '644' ) |
|
179 |
( 'libview2/libview2.*' #libBin nil false '644' ) |
|
180 |
( 'libwidg/libwidg.*' #libBin nil false '644' ) |
|
181 |
( 'libwidg2/libwidg2.*' #libBin nil false '644' ) |
|
182 |
( 'libwidg3/libwidg3.*' #libBin nil false '644' ) |
|
27 | 183 |
"/ ( 'libsnmp/libsnmp.*' #libBin nil false '644' ) |
184 |
"/ ( 'contrib/libPVM/libPVM.*' #libBin nil false '644' ) |
|
24 | 185 |
( 'goodies/persistency/libdbase.*' #libBin nil false '644' ) |
27 | 186 |
"/ ( 'libtable/libtable.*' #libBin nil false '644' ) |
24 | 187 |
( 'libtool/libtool.*' #libBin nil false '644' ) |
27 | 188 |
"/ ( 'libxt/libxt.*' #libBin nil false '644' ) |
189 |
"/ ( 'librt/librt.*' #libBin nil false '644' ) |
|
5 | 190 |
). |
191 |
]. |
|
0 | 192 |
|
5 | 193 |
installGoodyFiles ifTrue:[ |
194 |
fileSpec := fileSpec , #( |
|
195 |
( 'goodies/*.st' #lib 'goodies' false '644' ) |
|
196 |
( 'goodies/*.chg' #lib 'goodies' false '644' ) |
|
197 |
( 'goodies/rdoit/rdoit' #bin nil false '755' ) |
|
198 |
). |
|
199 |
]. |
|
0 | 200 |
|
11 | 201 |
|
202 |
^ fileSpec |
|
203 |
||
204 |
! ! |
|
205 |
||
206 |
!STXInstaller methodsFor:'installing'! |
|
207 |
||
208 |
copyFiles |
|
209 |
|msg fileSpec filesToCopy numFiles nDone| |
|
210 |
||
211 |
msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection. |
|
212 |
||
213 |
fileSpec := self specOfFilesToCopy. |
|
214 |
||
0 | 215 |
filesToCopy := OrderedCollection new. |
216 |
||
217 |
fileSpec do:[:entry | |
|
8 | 218 |
|fileNames dest subDir required destDir| |
0 | 219 |
|
8 | 220 |
fileNames := entry at:1. |
0 | 221 |
dest := entry at:2. |
222 |
subDir := entry at:3. |
|
223 |
required := entry at:4. |
|
224 |
||
225 |
dest == #bin ifTrue:[ |
|
226 |
destDir := stxBinDir |
|
227 |
] ifFalse:[ |
|
24 | 228 |
dest == #libBin ifTrue:[ |
229 |
destDir := stxLibBinDir |
|
230 |
] ifFalse:[ |
|
231 |
destDir := stxLibDir |
|
232 |
] |
|
0 | 233 |
]. |
234 |
||
235 |
destDir := destDir asFilename. |
|
236 |
subDir notNil ifTrue:[ |
|
237 |
destDir := destDir construct:subDir |
|
238 |
]. |
|
239 |
||
8 | 240 |
filesToCopy add:(fileNames -> destDir pathName) |
0 | 241 |
]. |
242 |
||
243 |
numFiles := filesToCopy size. |
|
244 |
nDone := 0. |
|
245 |
||
246 |
filesToCopy do:[:entry | |
|
11 | 247 |
|fileName destDir cmd p text line doneSemaphore| |
0 | 248 |
|
249 |
fileName := entry key. |
|
250 |
destDir := entry value. |
|
251 |
||
8 | 252 |
((fileName includes:$*) |
253 |
or:[('../../' , fileName) asFilename exists])ifTrue:[ |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
254 |
actionPercentageHolder value:(nDone / numFiles * 100) rounded. |
0 | 255 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
256 |
msg at:4 put:' ' , (fileName asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
257 |
msg at:6 put:' ' , (destDir asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
258 |
actionTextHolder value:nil. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
259 |
actionTextHolder value:msg. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
260 |
|
22 | 261 |
cmd := 'cp -r ../../' , fileName , ' ' , destDir. |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
262 |
commandTraceView showCR:cmd , ' ...'. |
31 | 263 |
"/ cmd := 'sh -c "echo ; ' , cmd , ' 2>&1"' . |
264 |
cmd := cmd , ' 2>&1' . |
|
1 | 265 |
|
11 | 266 |
doneSemaphore := Semaphore new. |
267 |
||
268 |
[ |
|
269 |
||
270 |
p := PipeStream readingFrom:cmd. |
|
271 |
p isNil ifTrue:[ |
|
272 |
self warn:('command error. Could not execute:\\' , cmd) withCRs. |
|
273 |
] ifFalse:[ |
|
274 |
[p atEnd] whileFalse:[ |
|
30 | 275 |
(p readWaitWithTimeout:0.1) ifFalse:[ |
276 |
line := p nextLine. |
|
277 |
(line notNil and:[line notEmpty]) ifTrue:[ |
|
278 |
commandTraceView showCR:((' ' , line) asText emphasizeAllWith:(#color->Color red)). |
|
279 |
] |
|
11 | 280 |
] |
281 |
]. |
|
282 |
p close. |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
283 |
]. |
11 | 284 |
doneSemaphore signal. |
285 |
] forkAt:4. |
|
286 |
||
287 |
doneSemaphore wait. |
|
288 |
||
1 | 289 |
]. |
0 | 290 |
|
291 |
nDone := nDone + 1 |
|
292 |
]. |
|
293 |
||
294 |
^ true |
|
295 |
||
296 |
"Created: 17.7.1996 / 15:16:20 / cg" |
|
31 | 297 |
"Modified: 9.1.1997 / 03:15:23 / cg" |
0 | 298 |
! |
299 |
||
300 |
createDirectories |
|
301 |
|msg dirsToMake numDirs nDone| |
|
302 |
||
11 | 303 |
msg := (resources array:#('ST/X Installation' '' 'creating directory:' '' '' '')) asStringCollection. |
0 | 304 |
|
11 | 305 |
dirsToMake := self directoriesToMake. |
0 | 306 |
|
307 |
numDirs := dirsToMake size. |
|
308 |
nDone := 0. |
|
309 |
||
310 |
dirsToMake do:[:dirName | |
|
311 |
|d errMsg stop box| |
|
312 |
||
313 |
actionPercentageHolder value:(nDone / numDirs * 100) rounded. |
|
314 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
315 |
msg at:4 put:' ' , (dirName asText allBold). |
0 | 316 |
actionTextHolder value:nil. |
317 |
actionTextHolder value:msg. |
|
318 |
||
319 |
d := dirName asFilename. |
|
320 |
||
11 | 321 |
commandTraceView showCR:(resources string:'creating %1 ...' with:d pathName). |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
322 |
|
0 | 323 |
d exists ifFalse:[ |
324 |
OperatingSystem recursiveCreateDirectory:d pathName |
|
325 |
]. |
|
326 |
||
327 |
d exists ifFalse:[ |
|
11 | 328 |
errMsg := resources string:'failed to create directory: %1' with: dirName. |
0 | 329 |
stop := true |
330 |
] ifTrue:[ |
|
331 |
d isDirectory ifFalse:[ |
|
11 | 332 |
errMsg := resources string:'not a directory: %1' with:dirName. |
0 | 333 |
stop := true |
334 |
] ifTrue:[ |
|
335 |
(d isReadable |
|
336 |
and:[d isWritable]) ifFalse:[ |
|
11 | 337 |
errMsg := resources string:'no read/write access to directory: %1' with:dirName. |
0 | 338 |
stop := false |
339 |
] ifTrue:[ |
|
340 |
errMsg := nil |
|
341 |
] |
|
342 |
] |
|
343 |
]. |
|
344 |
||
345 |
errMsg notNil ifTrue:[ |
|
346 |
box := WarningBox new. |
|
347 |
box title:errMsg. |
|
348 |
box showAtPointerNotCovering:(WindowGroup activeGroup topViews first). |
|
1 | 349 |
stop ifTrue:[^ false]. |
0 | 350 |
]. |
351 |
||
352 |
Delay waitForSeconds:0.25. |
|
353 |
nDone := nDone + 1. |
|
354 |
]. |
|
355 |
^ true |
|
356 |
||
357 |
"Created: 17.7.1996 / 15:24:19 / cg" |
|
1 | 358 |
"Modified: 18.7.1996 / 22:18:38 / cg" |
19 | 359 |
! |
360 |
||
361 |
createSymbolicLinks |
|
362 |
|msg dirsToMake numDirs nDone| |
|
363 |
||
364 |
msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection. |
|
365 |
||
28 | 366 |
commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...'). |
29 | 367 |
OperatingSystem executeCommand:('(cd ' , stxLibDir , '/doc/online ; make links)'). |
19 | 368 |
^ true |
369 |
||
370 |
"Created: 17.7.1996 / 15:24:19 / cg" |
|
371 |
"Modified: 18.7.1996 / 22:18:38 / cg" |
|
0 | 372 |
! ! |
373 |
||
374 |
!STXInstaller methodsFor:'startup'! |
|
375 |
||
376 |
askAndInstall |
|
377 |
"/ check, if we are in the projects/smalltalk directory |
|
378 |
||
11 | 379 |
resources := ResourcePack for:self class. |
380 |
||
0 | 381 |
(Filename currentDirectory pathName endsWith:'projects/smalltalk') ifFalse:[ |
11 | 382 |
self warn:(resources string:'must be in the ''projects/smalltalk'' directory'). |
0 | 383 |
^ self |
384 |
]. |
|
385 |
||
386 |
[self askForDestination] whileTrue:[ |
|
387 |
self checkForExistingInstallationAndConfirm ifFalse:[ |
|
388 |
^ self |
|
389 |
]. |
|
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
390 |
self preInstall. |
0 | 391 |
self doInstall ifTrue:[ |
1 | 392 |
self postInstall. |
0 | 393 |
^ self |
394 |
]. |
|
11 | 395 |
(self confirm:(resources string:'installation failed or aborted - retry ?')) |
0 | 396 |
ifFalse:[ |
397 |
^ self |
|
398 |
] |
|
399 |
]. |
|
400 |
||
1 | 401 |
"Modified: 18.7.1996 / 21:20:56 / cg" |
0 | 402 |
! |
403 |
||
404 |
askForDestination |
|
405 |
"open a dialog to enter destination directories" |
|
406 |
||
2 | 407 |
|d cm l green dark img |
24 | 408 |
stxLibDirHolder stxLibBinDirHolder stxBinDirHolder |
5 | 409 |
installDocHolder installSourceHolder installSTCHolder installGoodiesHolder |
11 | 410 |
binMegabytes libMegabytes |
0 | 411 |
| |
412 |
||
11 | 413 |
binMegabytes := 10. |
414 |
libMegabytes := 10. |
|
415 |
||
0 | 416 |
LastLibDir isNil ifTrue:[ |
417 |
LastLibDir := '/usr/local/lib/smalltalk' |
|
418 |
]. |
|
24 | 419 |
LastLibBinDir isNil ifTrue:[ |
420 |
LastLibBinDir := '/usr/local/lib' |
|
421 |
]. |
|
0 | 422 |
LastBinDir isNil ifTrue:[ |
423 |
LastBinDir := '/usr/local/bin' |
|
424 |
]. |
|
425 |
||
426 |
stxLibDirHolder := LastLibDir asValue. |
|
24 | 427 |
stxLibBinDirHolder := LastLibBinDir asValue. |
0 | 428 |
stxBinDirHolder := LastBinDir asValue. |
24 | 429 |
|
5 | 430 |
installDocHolder := true asValue. |
431 |
installSourceHolder := true asValue. |
|
432 |
installSTCHolder := true asValue. |
|
433 |
installGoodiesHolder := true asValue. |
|
0 | 434 |
|
435 |
Screen current hasColors ifTrue:[ |
|
436 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
437 |
dark := Color grey:10. |
|
438 |
] ifFalse:[ |
|
439 |
green := Color white. |
|
440 |
dark := Color black. |
|
441 |
]. |
|
442 |
||
443 |
d := DialogBox new. |
|
444 |
||
11 | 445 |
d label:(resources string:'ST/X CD Installation'). |
2 | 446 |
img := Image fromFile:'SmalltalkX.xbm'. |
447 |
||
448 |
l := d addTextLabel:img. |
|
449 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
450 |
||
11 | 451 |
l := d addTextLabel:(resources string:'Smalltalk/X CD installation.'). |
0 | 452 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
453 |
d addVerticalSpace. |
|
454 |
d addVerticalSpace. |
|
455 |
||
456 |
d addHorizontalLine. |
|
457 |
||
11 | 458 |
l := d addTextLabel:(resources string:'Destination directories:'). |
0 | 459 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
460 |
||
461 |
cm := ComboBoxView on:stxBinDirHolder. |
|
1 | 462 |
cm list:self defaultBinDirs. |
0 | 463 |
d |
464 |
addLabelledField:cm |
|
11 | 465 |
label:(resources string:'binaries') |
0 | 466 |
adjust:#left |
467 |
tabable:true |
|
468 |
from:0.0 to:1.0 separateAtX:0.25 |
|
469 |
nameAs:'binaryBox'. |
|
470 |
||
471 |
(d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
472 |
||
24 | 473 |
cm := ComboBoxView on:stxLibBinDirHolder. |
474 |
cm list:self defaultLibBinDirs. |
|
475 |
d |
|
476 |
addLabelledField:cm |
|
477 |
label:(resources string:'libraries') |
|
478 |
adjust:#left |
|
479 |
tabable:true |
|
480 |
from:0.0 to:1.0 separateAtX:0.25 |
|
481 |
nameAs:'libraryBinBox'. |
|
482 |
||
483 |
(d componentAt:'libraryBinBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
484 |
||
0 | 485 |
cm := ComboBoxView on:stxLibDirHolder. |
1 | 486 |
cm list:self defaultLibDirs. |
0 | 487 |
d |
488 |
addLabelledField:cm |
|
24 | 489 |
label:(resources string:'help files') |
0 | 490 |
adjust:#left |
491 |
tabable:true |
|
492 |
from:0.0 to:1.0 separateAtX:0.25 |
|
493 |
nameAs:'libraryBox'. |
|
494 |
||
495 |
(d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
496 |
||
5 | 497 |
d addVerticalSpace. |
498 |
d addHorizontalLine. |
|
499 |
d addVerticalSpace. |
|
500 |
||
11 | 501 |
(d addTextLabel:(resources string:'required:')) |
5 | 502 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
503 |
||
504 |
d leftIndent:35. |
|
11 | 505 |
(d addTextLabel:(resources string:'binaries (approx. %1 Mb)' with:binMegabytes printString)) |
5 | 506 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
11 | 507 |
(d addTextLabel:(resources string:'libraries (approx. %1 Mb)' with:libMegabytes printString)) |
5 | 508 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
509 |
d leftIndent:0. |
|
510 |
||
511 |
d addVerticalSpace. |
|
512 |
d addHorizontalLine. |
|
513 |
d addVerticalSpace. |
|
514 |
||
11 | 515 |
(d addTextLabel:(resources string:'optional:')) |
5 | 516 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
517 |
||
11 | 518 |
(d addCheckBox:((resources string:'doc files') , ' (+8 Mb)') on:installDocHolder) |
5 | 519 |
labelView foregroundColor:Color white backgroundColor:dark. |
11 | 520 |
(d addCheckBox:((resources string:'stc & support files') , ' (+2 Mb)') on:installSTCHolder) |
10 | 521 |
labelView foregroundColor:Color white backgroundColor:dark. |
522 |
||
523 |
d addVerticalSpace. |
|
524 |
d addHorizontalLine. |
|
525 |
d addVerticalSpace. |
|
526 |
||
11 | 527 |
(d addTextLabel:(resources string:'optional (but highly recommended):')) |
10 | 528 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
529 |
||
11 | 530 |
(d addCheckBox:((resources string:'smalltalk source files') , ' (+12 Mb)') on:installSourceHolder) |
5 | 531 |
labelView foregroundColor:Color white backgroundColor:dark. |
11 | 532 |
(d addCheckBox:((resources string:'goodies') , ' (+0.5 Mb)') on:installGoodiesHolder) |
5 | 533 |
labelView foregroundColor:Color white backgroundColor:dark. |
534 |
||
535 |
d addVerticalSpace. |
|
536 |
d addHorizontalLine. |
|
537 |
||
24 | 538 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
539 |
addAbortButton; |
|
540 |
addOkButtonLabelled:(resources string:'install'). |
|
0 | 541 |
d extent:400@300. |
542 |
||
543 |
d allViewBackground:dark. |
|
544 |
||
545 |
d openAtCenter. |
|
546 |
d accepted ifTrue:[ |
|
547 |
stxLibDir := LastLibDir := stxLibDirHolder value. |
|
24 | 548 |
stxLibBinDir := LastLibBinDir := stxLibBinDirHolder value. |
0 | 549 |
stxBinDir := LastBinDir := stxBinDirHolder value. |
5 | 550 |
installDocFiles := installDocHolder value. |
551 |
installSourceFiles := installSourceHolder value. |
|
552 |
installSTCFiles := installSTCHolder value. |
|
553 |
installGoodyFiles := installGoodiesHolder value. |
|
1 | 554 |
d destroy. |
0 | 555 |
^ true |
556 |
]. |
|
1 | 557 |
d destroy. |
0 | 558 |
^ false |
559 |
||
1 | 560 |
"Modified: 18.7.1996 / 19:43:38 / cg" |
0 | 561 |
! |
562 |
||
563 |
checkForExistingInstallationAndConfirm |
|
564 |
"look if there is another installation and confirm |
|
565 |
reinstalling; return true if ok, false if not" |
|
566 |
||
1 | 567 |
|whatToDo| |
568 |
||
0 | 569 |
stxLibDir asFilename exists ifTrue:[ |
1 | 570 |
whatToDo := Dialog |
11 | 571 |
choose:(resources |
572 |
string:'detected existing ST/X installation in %1' |
|
573 |
with:stxLibDir asText allBold) |
|
574 |
label:(resources string:'Attention') |
|
575 |
labels:(resources array:#('remove first' 'overwrite' 'cancel')) |
|
1 | 576 |
values:#(remove over nil) |
577 |
default:nil. |
|
578 |
whatToDo isNil ifTrue:[^false]. |
|
579 |
whatToDo == #remove ifTrue:[ |
|
23
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
580 |
((stxLibDir findString:'stx') == 0 |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
581 |
and:[(stxLibDir findString:'smalltalk') == 0]) ifTrue:[ |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
582 |
"/ confirm again |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
583 |
(self confirm:(resources |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
584 |
string:'are you certain that the directory to remove |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
585 |
is really an smalltalk directory ? |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
586 |
|
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
587 |
Remove it now ?')) ifFalse:[ ^ true]. |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
588 |
]. |
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
589 |
|
1 | 590 |
(OperatingSystem recursiveRemoveDirectory:stxLibDir) |
591 |
ifFalse:[ |
|
11 | 592 |
self warn:(resources string:'mhmh - could not remove old installation.') |
1 | 593 |
]. |
594 |
]. |
|
595 |
^ true |
|
596 |
"/ ^ DialogBox |
|
597 |
"/ confirm:('detected existing installation in ' |
|
598 |
"/ , stxLibDir asText allBold |
|
599 |
"/ , '\\continue & overwrite ?') withCRs |
|
600 |
"/ yesLabel:'overwrite' noLabel:'cancel' |
|
0 | 601 |
|
602 |
]. |
|
603 |
^ true |
|
604 |
||
1 | 605 |
"Modified: 18.7.1996 / 20:01:36 / cg" |
0 | 606 |
! |
607 |
||
608 |
doInstall |
|
609 |
"install ST/X; return true if ok, false if not" |
|
610 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
611 |
|progressView ok textView| |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
612 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
613 |
textView := HVScrollableView for:TextCollector. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
614 |
textView preferredExtent:(100 @ 250). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
615 |
commandTraceView := textView scrolledView. |
0 | 616 |
|
617 |
progressView := ProgressIndicator |
|
26 | 618 |
inBoxWithLabel:'ST/X Installation' icon:(Depth8Image fromImage:Launcher aboutIcon) |
0 | 619 |
text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
620 |
abortable:true |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
621 |
view:textView |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
622 |
closeWhenDone:false. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
623 |
progressView topView extent:(500 min:Display width) @ 300. |
0 | 624 |
|
625 |
ok := false. |
|
626 |
||
627 |
progressView showProgressOf: |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
628 |
[:progressValue :currentAction| |msg| |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
629 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
630 |
Processor activeProcess withPriority:7 do:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
631 |
actionPercentageHolder := progressValue. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
632 |
actionTextHolder := currentAction. |
0 | 633 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
634 |
(self createDirectories) ifTrue:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
635 |
ok := self copyFiles |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
636 |
]. |
19 | 637 |
self createSymbolicLinks. |
638 |
||
6 | 639 |
progressValue value:100. |
640 |
||
11 | 641 |
progressView topView abortButton label:(resources string:'continue'). |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
642 |
progressView topView abortButton action:[progressView topView hide]. |
11 | 643 |
msg := (resources |
644 |
array:#('ST/X Installation finished.' '' 'press continue ...' '' '' '')) |
|
645 |
asStringCollection. |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
646 |
actionTextHolder value:nil. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
647 |
actionTextHolder value:msg. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
648 |
] |
0 | 649 |
]. |
650 |
||
651 |
^ ok |
|
652 |
||
653 |
"Created: 17.7.1996 / 15:11:27 / cg" |
|
654 |
"Modified: 17.7.1996 / 15:24:27 / cg" |
|
655 |
! |
|
656 |
||
657 |
open |
|
1 | 658 |
self askAndInstall. |
0 | 659 |
|
5 | 660 |
" |
661 |
STXInstaller open |
|
662 |
" |
|
1 | 663 |
! |
664 |
||
665 |
postInstall |
|
666 |
"some messages at the end ..." |
|
667 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
668 |
|shInfo cshInfo msg havePath| |
1 | 669 |
|
11 | 670 |
msg := (resources string:'ST/X Installation complete.\\') withCRs. |
1 | 671 |
shInfo := ''. |
672 |
cshInfo := ''. |
|
673 |
||
674 |
havePath := true. |
|
675 |
(((OperatingSystem getEnvironment:'PATH') |
|
676 |
asCollectionOfSubstringsSeparatedBy:$:) |
|
677 |
includes:stxBinDir) ifFalse:[ |
|
678 |
||
679 |
havePath := false. |
|
680 |
shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. |
|
681 |
cshInfo := 'set path=($path ' , stxBinDir , ')\'. |
|
11 | 682 |
msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\' |
683 |
with:stxBinDir asText allBold) withCRs. |
|
1 | 684 |
]. |
685 |
||
686 |
(stxLibDir ~= '/usr/local/lib/smalltalk' |
|
687 |
and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[ |
|
11 | 688 |
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.\' |
689 |
with:'STX_LIBDIR' asText allBold |
|
690 |
with:stxLibDir asText allBold) withCRs. |
|
1 | 691 |
havePath ifFalse:[ |
11 | 692 |
msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs. |
1 | 693 |
] ifTrue:[ |
11 | 694 |
msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs. |
1 | 695 |
]. |
696 |
||
697 |
shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. |
|
698 |
cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. |
|
699 |
]. |
|
700 |
||
701 |
shInfo notEmpty ifTrue:[ |
|
11 | 702 |
'*********************************************************' errorPrintCR. |
703 |
(resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR. |
|
704 |
(resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR. |
|
1 | 705 |
'' errorPrintCR. |
706 |
shInfo withCRs errorPrintCR. |
|
707 |
'' errorPrintCR. |
|
11 | 708 |
(resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR. |
1 | 709 |
'' errorPrintCR. |
710 |
cshInfo withCRs errorPrintCR. |
|
711 |
'' errorPrintCR. |
|
11 | 712 |
'*********************************************************' errorPrintCR. |
1 | 713 |
]. |
714 |
self information:msg. |
|
715 |
||
716 |
" |
|
717 |
STXInstaller new postInstall |
|
718 |
" |
|
719 |
||
720 |
"Modified: 18.7.1996 / 22:10:42 / cg" |
|
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
721 |
! |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
722 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
723 |
preInstall |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
724 |
"clobber the doc directory, to avoid copying cyclic symbolic links" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
725 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
726 |
|f| |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
727 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
728 |
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
|
729 |
f exists ifTrue:[ |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
730 |
f isSymbolicLink ifTrue:[ |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
731 |
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
|
732 |
] |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
733 |
] |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
734 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
735 |
" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
736 |
STXInstaller new preInstall |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
737 |
" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
738 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
739 |
"Modified: 18.7.1996 / 22:10:42 / cg" |
0 | 740 |
! ! |
741 |
||
28 | 742 |
!STXInstaller class methodsFor:'documentation'! |
0 | 743 |
|
744 |
version |
|
745 |
^ '$Header$' |
|
746 |
! ! |