author | Claus Gittinger <cg@exept.de> |
Tue, 03 Sep 1996 15:16:32 +0200 | |
changeset 4 | 8b68fdf7c870 |
parent 3 | 7b048cdcc856 |
child 5 | 16cff74f42b0 |
permissions | -rw-r--r-- |
0 | 1 |
Object subclass:#STXInstaller |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
2 |
instanceVariableNames:'stxLibDir stxBinDir actionPercentageHolder actionTextHolder |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
3 |
commandTraceView' |
0 | 4 |
classVariableNames:'LastBinDir LastLibDir' |
5 |
poolDictionaries:'' |
|
6 |
category:'eXept-tools' |
|
7 |
! |
|
8 |
||
9 |
||
10 |
!STXInstaller class methodsFor:'startup'! |
|
11 |
||
12 |
open |
|
13 |
^ self new open |
|
14 |
||
15 |
"Created: 17.7.1996 / 14:36:22 / cg" |
|
1 | 16 |
"Modified: 18.7.1996 / 21:20:22 / cg" |
17 |
! ! |
|
18 |
||
19 |
!STXInstaller methodsFor:'defaults'! |
|
20 |
||
21 |
defaultBinDirs |
|
22 |
|dirs| |
|
23 |
||
24 |
dirs := OrderedCollection new. |
|
25 |
dirs add:'/usr/local/bin'. |
|
26 |
dirs add:'/usr/bin'. |
|
27 |
dirs add:(Filename homeDirectory constructString:'bin'). |
|
28 |
dirs add:'/tmp/stxbin'. |
|
3 | 29 |
('/home' asFilename exists and:['/home' asFilename isDirectory]) ifTrue:[ |
30 |
dirs add:'/home/stx/bin'. |
|
31 |
]. |
|
32 |
('/home2' asFilename exists and:['/home2' asFilename isDirectory]) ifTrue:[ |
|
33 |
dirs add:'/home2/stx/bin'. |
|
34 |
]. |
|
35 |
||
36 |
"/ dirs := dirs select:[:path | |
|
37 |
"/ |f| |
|
38 |
"/ |
|
39 |
"/ f := path asFilename. |
|
40 |
"/ f exists and:[f isDirectory]]. |
|
41 |
^ dirs sort |
|
1 | 42 |
|
43 |
"Created: 18.7.1996 / 19:43:00 / cg" |
|
44 |
"Modified: 18.7.1996 / 19:45:08 / cg" |
|
45 |
! |
|
46 |
||
47 |
defaultLibDirs |
|
48 |
|dirs| |
|
49 |
||
50 |
dirs := OrderedCollection new. |
|
51 |
dirs add:'/usr/local/lib/smalltalk'. |
|
52 |
dirs add:'/usr/lib/smalltalk'. |
|
53 |
dirs add:((Filename homeDirectory |
|
54 |
construct:'lib') |
|
55 |
constructString:'smalltalk'). |
|
56 |
dirs add:'/tmp/stxlib'. |
|
57 |
dirs add:'/home/stx/lib'. |
|
58 |
dirs add:'/home2/stx/lib'. |
|
3 | 59 |
|
60 |
"/ dirs := dirs select:[:path | |
|
61 |
"/ |f| |
|
62 |
"/ |
|
63 |
"/ f := path asFilename. |
|
64 |
"/ f exists and:[f isDirectory]]. |
|
65 |
^ dirs sort |
|
1 | 66 |
|
67 |
"Created: 18.7.1996 / 19:43:21 / cg" |
|
68 |
"Modified: 18.7.1996 / 19:46:04 / cg" |
|
0 | 69 |
! ! |
70 |
||
71 |
!STXInstaller methodsFor:'installing'! |
|
72 |
||
73 |
copyFiles |
|
74 |
|msg fileSpec filesToCopy numFiles nDone| |
|
75 |
||
76 |
msg := #('ST/X Installation' '' 'copying:' '' 'to:' '') asStringCollection. |
|
77 |
||
78 |
fileSpec := #( |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
79 |
"/ name destination subDir required mode |
0 | 80 |
|
1 | 81 |
( 'stc/stc' #bin nil false '755' ) |
82 |
( 'rules/stmkmp' #bin nil false '755' ) |
|
83 |
( 'rules/stmkmf' #bin nil false '755' ) |
|
84 |
( 'projects/smalltalk/smalltalk' #bin nil true '755' ) |
|
0 | 85 |
|
1 | 86 |
( 'librun/librun.a' #lib 'lib' false '644' ) |
87 |
( 'libbasic/libbasic.o' #lib 'lib' false '644' ) |
|
88 |
( 'libbasic2/libbasic2.o' #lib 'lib' false '644' ) |
|
89 |
( 'libbasic3/libbasic3.o' #lib 'lib' false '644' ) |
|
90 |
( 'libcomp/libcomp.o' #lib 'lib' false '644' ) |
|
91 |
( 'libview/libview.o' #lib 'lib' false '644' ) |
|
92 |
( 'libview2/libview2.o' #lib 'lib' false '644' ) |
|
93 |
( 'libwidg/libwidg.o' #lib 'lib' false '644' ) |
|
94 |
( 'libwidg2/libwidg2.o' #lib 'lib' false '644' ) |
|
95 |
( 'libwidg3/libwidg3.o' #lib 'lib' false '644' ) |
|
96 |
( 'libsnmp/libsnmp.o' #lib 'lib' false '644' ) |
|
97 |
( 'libtable/libtable.o' #lib 'lib' false '644' ) |
|
98 |
( 'libtool/libtool.o' #lib 'lib' false '644' ) |
|
99 |
( 'libxt/libxt.o' #lib 'lib' false '644' ) |
|
100 |
( 'librt/librt.o' #lib 'lib' false '644' ) |
|
101 |
( 'support/VGL/vogl/src/libvogl.a' #lib 'lib' false '644' ) |
|
102 |
( 'support/VGL/vogl/src/*.h' #lib 'include' false '644' ) |
|
103 |
( 'support/DLD/dld-3.2.5/libdld.a' #lib 'lib' false '644' ) |
|
0 | 104 |
|
1 | 105 |
( 'projects/smalltalk/*.rc' #lib nil false '644' ) |
106 |
( 'projects/smalltalk/patches' #lib nil true '644' ) |
|
0 | 107 |
|
1 | 108 |
( 'projects/smalltalk/bitmaps' #lib nil true '644' ) |
109 |
( 'doc' #lib nil false '644' ) |
|
110 |
( 'projects/smalltalk/include' #lib nil true '644' ) |
|
111 |
( 'projects/smalltalk/resources' #lib nil true '644' ) |
|
112 |
( 'projects/smalltalk/source' #lib nil true '644' ) |
|
113 |
( 'configurations' #lib nil false '644' ) |
|
114 |
( 'rules' #lib nil false '644' ) |
|
115 |
||
116 |
( 'goodies/*.st' #lib 'goodies' false '644' ) |
|
117 |
( 'goodies/*.chg' #lib 'goodies' false '644' ) |
|
118 |
( 'goodies/rdoit/rdoit' #bin nil false '755' ) |
|
0 | 119 |
). |
120 |
||
121 |
filesToCopy := OrderedCollection new. |
|
122 |
||
123 |
fileSpec do:[:entry | |
|
124 |
|fileName dest subDir required destDir| |
|
125 |
||
126 |
fileName := entry at:1. |
|
127 |
dest := entry at:2. |
|
128 |
subDir := entry at:3. |
|
129 |
required := entry at:4. |
|
130 |
||
131 |
dest == #bin ifTrue:[ |
|
132 |
destDir := stxBinDir |
|
133 |
] ifFalse:[ |
|
134 |
destDir := stxLibDir |
|
135 |
]. |
|
136 |
||
137 |
destDir := destDir asFilename. |
|
138 |
subDir notNil ifTrue:[ |
|
139 |
destDir := destDir construct:subDir |
|
140 |
]. |
|
141 |
||
142 |
filesToCopy add:(fileName -> destDir pathName) |
|
143 |
]. |
|
144 |
||
145 |
numFiles := filesToCopy size. |
|
146 |
nDone := 0. |
|
147 |
||
148 |
filesToCopy do:[:entry | |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
149 |
|fileName destDir cmd p text line| |
0 | 150 |
|
151 |
fileName := entry key. |
|
152 |
destDir := entry value. |
|
153 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
154 |
('../../' , fileName) asFilename exists ifTrue:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
155 |
actionPercentageHolder value:(nDone / numFiles * 100) rounded. |
0 | 156 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
157 |
msg at:4 put:' ' , (fileName asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
158 |
msg at:6 put:' ' , (destDir asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
159 |
actionTextHolder value:nil. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
160 |
actionTextHolder value:msg. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
161 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
162 |
cmd := 'cp -r ../../' , fileName , ' ' , destDir. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
163 |
commandTraceView showCR:cmd , ' ...'. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
164 |
cmd := 'sh -c "echo ; ' , cmd , ' 2>&1"' . |
1 | 165 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
166 |
p := PipeStream readingFrom:cmd. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
167 |
p isNil ifTrue:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
168 |
self warn:('command error. Could not execute:\\' , cmd) withCRs. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
169 |
] ifFalse:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
170 |
"/ text := OrderedCollection new. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
171 |
[p atEnd] whileFalse:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
172 |
p readWaitWithTimeout:0.1. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
173 |
line := p nextLine. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
174 |
(line notNil and:[line notEmpty]) ifTrue:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
175 |
commandTraceView showCR:((' ' , line) asText emphasizeAllWith:(#color->Color red)). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
176 |
"/ text add:line |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
177 |
] |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
178 |
]. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
179 |
p close. |
1 | 180 |
]. |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
181 |
"/ (OperatingSystem executeCommand:('cp -r ../../' , fileName , ' ' , destDir)) |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
182 |
"/ ifFalse:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
183 |
"/ self warn:('error while copying ' , fileName , '\\Please check manually.') withCRs. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
184 |
"/ ]. |
1 | 185 |
]. |
0 | 186 |
|
187 |
nDone := nDone + 1 |
|
188 |
]. |
|
189 |
||
190 |
^ true |
|
191 |
||
192 |
"Created: 17.7.1996 / 15:16:20 / cg" |
|
1 | 193 |
"Modified: 18.7.1996 / 22:20:24 / cg" |
0 | 194 |
! |
195 |
||
196 |
createDirectories |
|
197 |
|msg dirsToMake numDirs nDone| |
|
198 |
||
199 |
msg := #('ST/X Installation' '' 'creating directory:' '' '' '') asStringCollection. |
|
200 |
||
201 |
dirsToMake := OrderedCollection new. |
|
202 |
dirsToMake add:stxBinDir. |
|
203 |
dirsToMake add:stxLibDir. |
|
204 |
dirsToMake add:(stxLibDir asFilename constructString:'lib'). |
|
205 |
dirsToMake add:(stxLibDir asFilename constructString:'doc'). |
|
206 |
dirsToMake add:(stxLibDir asFilename constructString:'include'). |
|
207 |
dirsToMake add:(stxLibDir asFilename constructString:'resources'). |
|
208 |
dirsToMake add:(stxLibDir asFilename constructString:'binary'). |
|
209 |
dirsToMake add:(stxLibDir asFilename constructString:'bitmaps'). |
|
1 | 210 |
dirsToMake add:(stxLibDir asFilename constructString:'goodies'). |
0 | 211 |
|
212 |
numDirs := dirsToMake size. |
|
213 |
nDone := 0. |
|
214 |
||
215 |
dirsToMake do:[:dirName | |
|
216 |
|d errMsg stop box| |
|
217 |
||
218 |
actionPercentageHolder value:(nDone / numDirs * 100) rounded. |
|
219 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
220 |
msg at:4 put:' ' , (dirName asText allBold). |
0 | 221 |
actionTextHolder value:nil. |
222 |
actionTextHolder value:msg. |
|
223 |
||
224 |
d := dirName asFilename. |
|
225 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
226 |
commandTraceView showCR:'creating ' , d pathName , ' ...'. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
227 |
|
0 | 228 |
d exists ifFalse:[ |
229 |
OperatingSystem recursiveCreateDirectory:d pathName |
|
230 |
]. |
|
231 |
||
232 |
d exists ifFalse:[ |
|
233 |
errMsg := 'failed to create directory: ' , dirName. |
|
234 |
stop := true |
|
235 |
] ifTrue:[ |
|
236 |
d isDirectory ifFalse:[ |
|
237 |
errMsg := 'not a directory: ' , dirName. |
|
238 |
stop := true |
|
239 |
] ifTrue:[ |
|
240 |
(d isReadable |
|
241 |
and:[d isWritable]) ifFalse:[ |
|
242 |
errMsg := 'no R/W access to directory: ' , dirName. |
|
243 |
stop := false |
|
244 |
] ifTrue:[ |
|
245 |
errMsg := nil |
|
246 |
] |
|
247 |
] |
|
248 |
]. |
|
249 |
||
250 |
errMsg notNil ifTrue:[ |
|
251 |
box := WarningBox new. |
|
252 |
box title:errMsg. |
|
253 |
box showAtPointerNotCovering:(WindowGroup activeGroup topViews first). |
|
1 | 254 |
stop ifTrue:[^ false]. |
0 | 255 |
]. |
256 |
||
257 |
Delay waitForSeconds:0.25. |
|
258 |
nDone := nDone + 1. |
|
259 |
]. |
|
260 |
^ true |
|
261 |
||
262 |
"Created: 17.7.1996 / 15:24:19 / cg" |
|
1 | 263 |
"Modified: 18.7.1996 / 22:18:38 / cg" |
0 | 264 |
! ! |
265 |
||
266 |
!STXInstaller methodsFor:'startup'! |
|
267 |
||
268 |
askAndInstall |
|
269 |
"/ check, if we are in the projects/smalltalk directory |
|
270 |
||
271 |
(Filename currentDirectory pathName endsWith:'projects/smalltalk') ifFalse:[ |
|
272 |
self warn:'must be in the projects/smalltalk directory'. |
|
273 |
^ self |
|
274 |
]. |
|
275 |
||
276 |
[self askForDestination] whileTrue:[ |
|
277 |
self checkForExistingInstallationAndConfirm ifFalse:[ |
|
278 |
^ self |
|
279 |
]. |
|
280 |
self doInstall ifTrue:[ |
|
1 | 281 |
self postInstall. |
0 | 282 |
^ self |
283 |
]. |
|
284 |
(self confirm:'installation failed or aborted - retry ?') |
|
285 |
ifFalse:[ |
|
286 |
^ self |
|
287 |
] |
|
288 |
]. |
|
289 |
||
1 | 290 |
"Modified: 18.7.1996 / 21:20:56 / cg" |
0 | 291 |
! |
292 |
||
293 |
askForDestination |
|
294 |
"open a dialog to enter destination directories" |
|
295 |
||
2 | 296 |
|d cm l green dark img |
0 | 297 |
stxLibDirHolder stxBinDirHolder |
298 |
| |
|
299 |
||
300 |
LastLibDir isNil ifTrue:[ |
|
301 |
LastLibDir := '/usr/local/lib/smalltalk' |
|
302 |
]. |
|
303 |
LastBinDir isNil ifTrue:[ |
|
304 |
LastBinDir := '/usr/local/bin' |
|
305 |
]. |
|
306 |
||
307 |
stxLibDirHolder := LastLibDir asValue. |
|
308 |
stxBinDirHolder := LastBinDir asValue. |
|
309 |
||
310 |
Screen current hasColors ifTrue:[ |
|
311 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
312 |
dark := Color grey:10. |
|
313 |
] ifFalse:[ |
|
314 |
green := Color white. |
|
315 |
dark := Color black. |
|
316 |
]. |
|
317 |
||
318 |
d := DialogBox new. |
|
319 |
||
320 |
d label:'ST/X CD Installation'. |
|
2 | 321 |
img := Image fromFile:'SmalltalkX.xbm'. |
322 |
||
323 |
l := d addTextLabel:img. |
|
324 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
325 |
||
0 | 326 |
l := d addTextLabel:'Smalltalk/X CD installation.'. |
327 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
328 |
d addVerticalSpace. |
|
329 |
d addVerticalSpace. |
|
330 |
||
331 |
d addHorizontalLine. |
|
332 |
||
333 |
l := d addTextLabel:'Destination directories:'. |
|
334 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
335 |
||
336 |
cm := ComboBoxView on:stxBinDirHolder. |
|
1 | 337 |
cm list:self defaultBinDirs. |
0 | 338 |
d |
339 |
addLabelledField:cm |
|
340 |
label:'binaries' |
|
341 |
adjust:#left |
|
342 |
tabable:true |
|
343 |
from:0.0 to:1.0 separateAtX:0.25 |
|
344 |
nameAs:'binaryBox'. |
|
345 |
||
346 |
(d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
347 |
||
348 |
cm := ComboBoxView on:stxLibDirHolder. |
|
1 | 349 |
cm list:self defaultLibDirs. |
0 | 350 |
d |
351 |
addLabelledField:cm |
|
352 |
label:'libraries' |
|
353 |
adjust:#left |
|
354 |
tabable:true |
|
355 |
from:0.0 to:1.0 separateAtX:0.25 |
|
356 |
nameAs:'libraryBox'. |
|
357 |
||
358 |
(d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
359 |
||
360 |
d addAbortButton; addOkButtonLabelled:'install'. |
|
361 |
d extent:400@300. |
|
362 |
||
363 |
d allViewBackground:dark. |
|
364 |
||
365 |
d openAtCenter. |
|
366 |
d accepted ifTrue:[ |
|
367 |
stxLibDir := LastLibDir := stxLibDirHolder value. |
|
368 |
stxBinDir := LastBinDir := stxBinDirHolder value. |
|
1 | 369 |
d destroy. |
0 | 370 |
^ true |
371 |
]. |
|
1 | 372 |
d destroy. |
0 | 373 |
^ false |
374 |
||
1 | 375 |
"Modified: 18.7.1996 / 19:43:38 / cg" |
0 | 376 |
! |
377 |
||
378 |
checkForExistingInstallationAndConfirm |
|
379 |
"look if there is another installation and confirm |
|
380 |
reinstalling; return true if ok, false if not" |
|
381 |
||
1 | 382 |
|whatToDo| |
383 |
||
0 | 384 |
stxLibDir asFilename exists ifTrue:[ |
1 | 385 |
whatToDo := Dialog |
386 |
choose:('detected existing installation in ' |
|
387 |
, stxLibDir asText allBold) |
|
2 | 388 |
label:'Attention' |
1 | 389 |
labels:#('remove first' 'overwrite' 'cancel') |
390 |
values:#(remove over nil) |
|
391 |
default:nil. |
|
392 |
whatToDo isNil ifTrue:[^false]. |
|
393 |
whatToDo == #remove ifTrue:[ |
|
394 |
(OperatingSystem recursiveRemoveDirectory:stxLibDir) |
|
395 |
ifFalse:[ |
|
396 |
self warn:'mhmh - could not remove old installation.' |
|
397 |
]. |
|
398 |
]. |
|
399 |
^ true |
|
400 |
"/ ^ DialogBox |
|
401 |
"/ confirm:('detected existing installation in ' |
|
402 |
"/ , stxLibDir asText allBold |
|
403 |
"/ , '\\continue & overwrite ?') withCRs |
|
404 |
"/ yesLabel:'overwrite' noLabel:'cancel' |
|
0 | 405 |
|
406 |
]. |
|
407 |
^ true |
|
408 |
||
1 | 409 |
"Modified: 18.7.1996 / 20:01:36 / cg" |
0 | 410 |
! |
411 |
||
412 |
doInstall |
|
413 |
"install ST/X; return true if ok, false if not" |
|
414 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
415 |
|progressView ok textView| |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
416 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
417 |
textView := HVScrollableView for:TextCollector. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
418 |
textView preferredExtent:(100 @ 250). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
419 |
commandTraceView := textView scrolledView. |
0 | 420 |
|
421 |
progressView := ProgressIndicator |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
422 |
inBoxWithLabel:'ST/X Installation' icon:(Depth8Image fromImage:NewLauncher aboutIcon) |
0 | 423 |
text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
424 |
abortable:true |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
425 |
view:textView |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
426 |
closeWhenDone:false. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
427 |
progressView topView extent:(500 min:Display width) @ 300. |
0 | 428 |
|
429 |
ok := false. |
|
430 |
||
431 |
progressView showProgressOf: |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
432 |
[:progressValue :currentAction| |msg| |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
433 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
434 |
Processor activeProcess withPriority:7 do:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
435 |
actionPercentageHolder := progressValue. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
436 |
actionTextHolder := currentAction. |
0 | 437 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
438 |
(self createDirectories) ifTrue:[ |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
439 |
ok := self copyFiles |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
440 |
]. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
441 |
progressView topView abortButton label:'continue'. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
442 |
progressView topView abortButton action:[progressView topView hide]. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
443 |
msg := #('ST/X Installation finished.' '' 'press continue ...' '' '' '') asStringCollection. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
444 |
actionTextHolder value:nil. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
445 |
actionTextHolder value:msg. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
446 |
] |
0 | 447 |
]. |
448 |
||
449 |
^ ok |
|
450 |
||
451 |
"Created: 17.7.1996 / 15:11:27 / cg" |
|
452 |
"Modified: 17.7.1996 / 15:24:27 / cg" |
|
453 |
! |
|
454 |
||
455 |
open |
|
1 | 456 |
self askAndInstall. |
0 | 457 |
|
458 |
"Created: 17.7.1996 / 14:37:14 / cg" |
|
1 | 459 |
"Modified: 18.7.1996 / 18:26:20 / cg" |
460 |
! |
|
461 |
||
462 |
postInstall |
|
463 |
"some messages at the end ..." |
|
464 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
465 |
|shInfo cshInfo msg havePath| |
1 | 466 |
|
467 |
msg := 'ST/X Installation complete.\\' withCRs. |
|
468 |
shInfo := ''. |
|
469 |
cshInfo := ''. |
|
470 |
||
471 |
havePath := true. |
|
472 |
(((OperatingSystem getEnvironment:'PATH') |
|
473 |
asCollectionOfSubstringsSeparatedBy:$:) |
|
474 |
includes:stxBinDir) ifFalse:[ |
|
475 |
||
476 |
havePath := false. |
|
477 |
shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. |
|
478 |
cshInfo := 'set path=($path ' , stxBinDir , ')\'. |
|
479 |
msg := msg , stxBinDir asText allBold , ' is not in your PATH. |
|
480 |
You should change your ".login" and/or ".profile" files to include it. |
|
481 |
||
482 |
' |
|
483 |
]. |
|
484 |
||
485 |
(stxLibDir ~= '/usr/local/lib/smalltalk' |
|
486 |
and:[stxLibDir ~= '/usr/lib/smalltalk']) ifTrue:[ |
|
487 |
msg := msg , |
|
488 |
'The library directory is not a standard ST/X library directory |
|
489 |
("/usr/local/lib/smalltalk" or "/usr/lib/smalltalk"). |
|
490 |
You have to define the ' , 'STX_LIBDIR' asText allBold ,' environment variable |
|
491 |
as ' , stxLibDir asText allBold , ' before ST/X can be started. |
|
492 |
'. |
|
493 |
||
494 |
havePath ifFalse:[ |
|
495 |
msg := msg , 'The above mentioned files are also a good place to do this. |
|
496 |
'. |
|
497 |
] ifTrue:[ |
|
498 |
msg := msg , 'The ".login" and/or ".profile" files are a good place to do this. |
|
499 |
'. |
|
500 |
]. |
|
501 |
||
502 |
shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. |
|
503 |
cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. |
|
504 |
]. |
|
505 |
||
506 |
shInfo notEmpty ifTrue:[ |
|
507 |
'Please add the following to your ".profile" file:' errorPrintCR. |
|
508 |
'' errorPrintCR. |
|
509 |
shInfo withCRs errorPrintCR. |
|
510 |
'' errorPrintCR. |
|
511 |
'or (if you use csh/tcsh), add to your ".login" file:' errorPrintCR. |
|
512 |
'' errorPrintCR. |
|
513 |
cshInfo withCRs errorPrintCR. |
|
514 |
'' errorPrintCR. |
|
515 |
]. |
|
516 |
self information:msg. |
|
517 |
||
518 |
" |
|
519 |
STXInstaller new postInstall |
|
520 |
" |
|
521 |
||
522 |
"Modified: 18.7.1996 / 22:10:42 / cg" |
|
0 | 523 |
! ! |
524 |
||
525 |
!STXInstaller class methodsFor:'documentation'! |
|
526 |
||
527 |
version |
|
528 |
^ '$Header$' |
|
529 |
! ! |