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