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