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