author | Claus Gittinger <cg@exept.de> |
Mon, 10 Jan 2000 17:03:20 +0100 | |
changeset 1289 | 76e5acce57a6 |
parent 1284 | 9f4ba1b3b604 |
child 1367 | e761ba85d5ac |
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' ) |
|
1284 | 235 |
( 'COPYRIGHT' nil 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 |
( 'doc/online/german/LICENCE_DEMO_STX.html' nil 'doc/online/german' true '644' ) |
|
239 |
( 'doc/online/english/LICENCE_DEMO_STX.html' nil 'doc/online/english' true '644' ) |
|
1279 | 240 |
). |
241 |
||
242 |
installDocFiles ifTrue:[ |
|
243 |
fileSpec := fileSpec , #( |
|
1281 | 244 |
( 'doc' nil nil false '644' ) |
1279 | 245 |
). |
246 |
]. |
|
247 |
||
248 |
installSTCFiles ifTrue:[ |
|
249 |
fileSpec := fileSpec , #( |
|
250 |
( 'include' #lib nil false '644' ) |
|
251 |
( 'configurations' #lib nil false '644' ) |
|
252 |
( 'configurations/PACKS' #lib 'configurations' false '644' ) |
|
253 |
( 'configurations/my*' #lib 'configurations' false '644' ) |
|
254 |
( 'configurations/vendor*' #lib 'configurations' false '644' ) |
|
255 |
( 'rules' #lib nil false '644' ) |
|
256 |
). |
|
257 |
]. |
|
258 |
||
259 |
installGoodyFiles ifTrue:[ |
|
260 |
fileSpec := fileSpec , #( |
|
1281 | 261 |
( 'goodies/*.st' #pkg 'stx/goodies/source' false '644' ) |
262 |
( 'goodies/*.chg' #pkg 'stx/goodies/source' false '644' ) |
|
1279 | 263 |
). |
264 |
]. |
|
265 |
||
266 |
||
267 |
^ fileSpec |
|
268 |
||
269 |
"Created: / 2.5.1999 / 13:17:37 / cg" |
|
1284 | 270 |
"Modified: / 24.12.1999 / 01:16:42 / cg" |
1279 | 271 |
! |
272 |
||
11 | 273 |
specOfFilesToCopy |
1119 | 274 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
275 |
^ self specOfWindowsFilesToCopy |
|
276 |
]. |
|
277 |
^ self specOfUnixFilesToCopy |
|
278 |
||
279 |
"Modified: / 2.5.1999 / 13:17:59 / cg" |
|
280 |
! |
|
281 |
||
282 |
specOfUnixFilesToCopy |
|
11 | 283 |
|fileSpec| |
0 | 284 |
|
1279 | 285 |
fileSpec := self specOfCommonFilesToCopy. |
286 |
||
287 |
fileSpec := fileSpec , #( |
|
27 | 288 |
"/ name destination subDir required mode |
12
6cb00d713d4d
LICENSE texts must always be installed
Claus Gittinger <cg@exept.de>
parents:
11
diff
changeset
|
289 |
( 'projects/smalltalk/smalltalk' #bin nil true '755' ) |
27 | 290 |
( 'projects/smalltalk/stx' #bin nil true '755' ) |
1281 | 291 |
( 'librun/librun.so' #lib 'lib' true '644' ) |
5 | 292 |
). |
0 | 293 |
|
5 | 294 |
installSTCFiles ifTrue:[ |
295 |
fileSpec := fileSpec , #( |
|
24 | 296 |
( 'stc/stc' #bin nil false '755' ) |
297 |
( 'rules/stmkmp' #bin nil false '755' ) |
|
298 |
( 'rules/stmkmf' #bin nil false '755' ) |
|
1281 | 299 |
( 'configurations/COMMON' #lib 'configurations' false '644' ) |
24 | 300 |
( 'configurations/PACKS' #lib 'configurations' false '644' ) |
301 |
( 'configurations/my*' #lib 'configurations' false '644' ) |
|
302 |
( 'configurations/vendor*' #lib 'configurations' false '644' ) |
|
5 | 303 |
|
276 | 304 |
( 'support/VGL/vogl/src/libvogl.*' #lib 'lib' false '644' ) |
305 |
( 'support/VGL/vogl/src/*.h' #lib 'include' false '644' ) |
|
306 |
( 'support/DLD/dld-3.2.5/libdld.*' #lib 'lib' false '644' ) |
|
307 |
||
1281 | 308 |
( 'goodies/persistency/db-1.6/PORT/libdb.*' #libBin 'lib' false '644' ) |
0 | 309 |
|
1281 | 310 |
"/ ( 'librun/librun.o' #libBin nil false '644' ) |
311 |
"/ ( 'librun/librun.a' #libBin nil false '644' ) |
|
5 | 312 |
). |
313 |
]. |
|
0 | 314 |
|
5 | 315 |
installGoodyFiles ifTrue:[ |
316 |
fileSpec := fileSpec , #( |
|
1281 | 317 |
( 'goodies/rdoit/rdoit' #bin nil false '755' ) |
318 |
( 'goodies/xml-indelv/abbrev.stc' #pkg 'stx/goodies/xml-indelv' true ) |
|
319 |
). |
|
320 |
] ifFalse:[ |
|
321 |
fileSpec := fileSpec , #( |
|
322 |
( 'goodies/persistency/libdbase.so' #pkg 'stx/goodies/persistency' true '644' ) |
|
5 | 323 |
). |
324 |
]. |
|
0 | 325 |
|
11 | 326 |
^ fileSpec |
327 |
||
1119 | 328 |
"Modified: / 30.4.1999 / 18:02:22 / cg" |
329 |
"Created: / 2.5.1999 / 13:17:37 / cg" |
|
330 |
! |
|
331 |
||
332 |
specOfWindowsFilesToCopy |
|
333 |
|fileSpec| |
|
334 |
||
1279 | 335 |
fileSpec := self specOfCommonFilesToCopy. |
336 |
||
337 |
fileSpec := fileSpec , #( |
|
1119 | 338 |
"/ name destination subDir required |
1132 | 339 |
( 'projects\smalltalk\smalltalk.bat' #bin nil true ) |
340 |
( 'projects\smalltalk\stx.exe' #bin nil true ) |
|
341 |
( 'projects\smalltalk\stxspawn.exe' #bin nil true ) |
|
1279 | 342 |
( 'projects\smalltalk\*.dll' #bin nil true ) |
1119 | 343 |
). |
344 |
||
345 |
installSTCFiles ifTrue:[ |
|
346 |
fileSpec := fileSpec , #( |
|
1132 | 347 |
( 'projects\smalltalk\stc.exe' #bin nil false ) |
348 |
( 'libbc\*.lib' #lib nil false ) |
|
1279 | 349 |
( 'rules' #lib nil false ) |
1119 | 350 |
). |
351 |
]. |
|
352 |
||
353 |
installGoodyFiles ifTrue:[ |
|
354 |
fileSpec := fileSpec , #( |
|
1279 | 355 |
( 'goodies/rdoit/rdoit.exe' #bin nil false ) |
1119 | 356 |
). |
357 |
]. |
|
358 |
||
359 |
^ fileSpec |
|
360 |
||
361 |
"Created: / 2.5.1999 / 13:23:06 / cg" |
|
1137 | 362 |
"Modified: / 31.5.1999 / 17:39:58 / cg" |
11 | 363 |
! ! |
364 |
||
365 |
!STXInstaller methodsFor:'installing'! |
|
366 |
||
1281 | 367 |
addFilesToSpec:fileSpec relativeTo:rel fromINSTALLSpec:f |
368 |
|s entry t cond dst| |
|
369 |
||
370 |
s := f asFilename readStream. |
|
371 |
s isNil ifTrue:[^ self]. |
|
372 |
[s atEnd] whileFalse:[ |
|
373 |
entry := s nextLine. |
|
374 |
(entry startsWith:$#) ifFalse:[ |
|
375 |
t := entry asCollectionOfWords. |
|
376 |
t size >= 2 ifTrue:[ |
|
377 |
cond := t at:3 ifAbsent:nil. |
|
378 |
(cond ~= 'optionalSource' |
|
379 |
or:[installSourceFiles]) ifTrue:[ |
|
380 |
((rel startsWith:'goodies/') not |
|
381 |
or:[installGoodyFiles]) ifTrue:[ |
|
382 |
dst := t at:2. |
|
383 |
(dst startsWith:'packages/stx/') ifTrue:[ |
|
384 |
fileSpec add:(Array |
|
385 |
with:(rel asFilename constructString:(t at:1)) |
|
386 |
with:#pkg |
|
387 |
with:('stx' asFilename constructString:(dst copyFrom:'packages/stx/' size+1)) |
|
388 |
with:true). |
|
389 |
] ifFalse:[ |
|
390 |
(dst = 'bin') ifTrue:[ |
|
391 |
fileSpec add:(Array |
|
392 |
with:(rel asFilename constructString:(t at:1)) |
|
393 |
with:#bin |
|
394 |
with:nil |
|
395 |
with:true). |
|
396 |
] |
|
397 |
] |
|
398 |
] |
|
399 |
]. |
|
400 |
]. |
|
401 |
]. |
|
402 |
]. |
|
403 |
s close. |
|
404 |
! |
|
405 |
||
790 | 406 |
changeWritability |
791 | 407 |
|msg| |
790 | 408 |
|
1010 | 409 |
installWhat == #full ifTrue:[ |
792 | 410 |
msg := (resources array:#('ST/X Installation' '' 'making target dir writable' '' '' '')) asStringCollection. |
790 | 411 |
|
792 | 412 |
commandTraceView showCR:(resources string:'making target dir writable ...'). |
413 |
commandTraceView endEntry. |
|
790 | 414 |
OperatingSystem executeCommand:('(cd ' , fullDir , ' ; find . -exec chmod u+w {} \;)'). |
415 |
]. |
|
416 |
||
791 | 417 |
"Created: / 17.7.1996 / 15:24:19 / cg" |
792 | 418 |
"Modified: / 20.4.1998 / 15:40:00 / cg" |
790 | 419 |
! |
420 |
||
11 | 421 |
copyFiles |
1132 | 422 |
|msg fileSpec filesToCopy numFiles nDone cmd topDir topDirPrefix| |
423 |
||
424 |
msg := (resources array:#('ST/X Installation' '' 'copying:' '' 'to:' '')) asStringCollection. |
|
678 | 425 |
|
1132 | 426 |
OperatingSystem isUNIXlike ifTrue:[ |
427 |
topDir := '../..'. |
|
428 |
topDirPrefix := '../../'. |
|
429 |
] ifFalse:[ |
|
430 |
topDir := '..\..'. |
|
431 |
topDirPrefix := '..\..\'. |
|
432 |
]. |
|
678 | 433 |
|
1010 | 434 |
installWhat == #full ifTrue:[ |
678 | 435 |
msg at:4 put:(' all from CD' asText allBold). |
436 |
msg at:6 put:' ' , (fullDir asText allBold). |
|
437 |
actionTextHolder value:nil. |
|
438 |
actionTextHolder value:msg. |
|
11 | 439 |
|
1132 | 440 |
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
|
441 |
"/ "/ |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
442 |
"/ "/ not all systems have cp -rv |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
443 |
"/ "/ |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
444 |
"/ OperatingSystem getOSType = 'linux' ifTrue:[ |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
445 |
"/ cmd := 'cp -rv ../../* ' , fullDir. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
446 |
"/ ]. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
447 |
"/ commandTraceView showCR:cmd , ' ...'. |
43a9a195b0f3
use tar instead of cp to copy full
Claus Gittinger <cg@exept.de>
parents:
792
diff
changeset
|
448 |
commandTraceView showCR:'copying ...'. |
678 | 449 |
commandTraceView endEntry. |
450 |
cmd := cmd , ' 2>&1' . |
|
451 |
||
452 |
self executeCommandAndShowOutput:cmd. |
|
453 |
||
454 |
^ true |
|
455 |
]. |
|
11 | 456 |
|
1281 | 457 |
fileSpec := self specOfFilesToCopy asOrderedCollection. |
458 |
||
459 |
actionPercentageHolder value:0. |
|
460 |
"/ search for INSTALL.files specs, and add to list ... |
|
461 |
actionTextHolder value:nil. |
|
462 |
actionTextHolder value:(resources array:#('ST/X Installation' '' 'searching for packages to install...' '' '' '')) asStringCollection. |
|
463 |
||
464 |
topDir asFilename recursiveDirectoryContentsDo:[:f | |
|
465 |
f asFilename baseName = 'INSTALL.files' ifTrue:[ |
|
466 |
self addFilesToSpec:fileSpec relativeTo:f asFilename directoryName fromINSTALLSpec:(topDir asFilename construct:f). |
|
467 |
] |
|
468 |
]. |
|
11 | 469 |
|
0 | 470 |
filesToCopy := OrderedCollection new. |
471 |
||
472 |
fileSpec do:[:entry | |
|
8 | 473 |
|fileNames dest subDir required destDir| |
0 | 474 |
|
8 | 475 |
fileNames := entry at:1. |
0 | 476 |
dest := entry at:2. |
477 |
subDir := entry at:3. |
|
478 |
required := entry at:4. |
|
479 |
||
480 |
dest == #bin ifTrue:[ |
|
481 |
destDir := stxBinDir |
|
482 |
] ifFalse:[ |
|
24 | 483 |
dest == #libBin ifTrue:[ |
484 |
destDir := stxLibBinDir |
|
485 |
] ifFalse:[ |
|
1279 | 486 |
dest == #pkg ifTrue:[ |
487 |
destDir := stxPkgDir |
|
488 |
] ifFalse:[ |
|
489 |
dest == nil ifTrue:[ |
|
490 |
destDir := stxTopDir |
|
491 |
] ifFalse:[ |
|
492 |
destDir := stxLibDir |
|
493 |
] |
|
494 |
] |
|
24 | 495 |
] |
0 | 496 |
]. |
497 |
||
498 |
destDir := destDir asFilename. |
|
499 |
subDir notNil ifTrue:[ |
|
500 |
destDir := destDir construct:subDir |
|
501 |
]. |
|
502 |
||
8 | 503 |
filesToCopy add:(fileNames -> destDir pathName) |
0 | 504 |
]. |
505 |
||
506 |
numFiles := filesToCopy size. |
|
507 |
nDone := 0. |
|
508 |
||
509 |
filesToCopy do:[:entry | |
|
678 | 510 |
|fileName destDir cmd| |
0 | 511 |
|
512 |
fileName := entry key. |
|
513 |
destDir := entry value. |
|
514 |
||
8 | 515 |
((fileName includes:$*) |
1132 | 516 |
or:[(topDirPrefix , fileName) asFilename exists])ifTrue:[ |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
517 |
actionPercentageHolder value:(nDone / numFiles * 100) rounded. |
0 | 518 |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
519 |
msg at:4 put:' ' , (fileName asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
520 |
msg at:6 put:' ' , (destDir asText allBold). |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
521 |
actionTextHolder value:nil. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
522 |
actionTextHolder value:msg. |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
523 |
|
73 | 524 |
((fileName includes:$*) not |
1136 | 525 |
and:[(topDirPrefix , fileName) asFilename exists not]) ifTrue:[ |
73 | 526 |
(self listOfOptionalPackages includes:fileName) ifFalse:[ |
117 | 527 |
commandTraceView showCR:('cannot copy ' , fileName , ' - not included in distribution'). |
528 |
commandTraceView endEntry. |
|
73 | 529 |
] |
530 |
] ifFalse:[ |
|
1136 | 531 |
destDir asFilename exists ifFalse:[ |
532 |
commandTraceView showCR:(resources string:'creating %1 ...' with:destDir asFilename pathName). |
|
533 |
commandTraceView endEntry. |
|
534 |
OperatingSystem recursiveCreateDirectory:destDir asFilename pathName |
|
535 |
]. |
|
1132 | 536 |
self recursiveCopy:(topDirPrefix , fileName) to:destDir. |
73 | 537 |
] |
1 | 538 |
]. |
0 | 539 |
|
540 |
nDone := nDone + 1 |
|
541 |
]. |
|
542 |
||
543 |
^ true |
|
544 |
||
678 | 545 |
" |
546 |
STXInstaller open |
|
547 |
" |
|
548 |
||
549 |
"Created: / 17.7.1996 / 15:16:20 / cg" |
|
1138 | 550 |
"Modified: / 31.5.1999 / 18:07:33 / cg" |
0 | 551 |
! |
552 |
||
553 |
createDirectories |
|
554 |
|msg dirsToMake numDirs nDone| |
|
555 |
||
11 | 556 |
msg := (resources array:#('ST/X Installation' '' 'creating directory:' '' '' '')) asStringCollection. |
0 | 557 |
|
11 | 558 |
dirsToMake := self directoriesToMake. |
0 | 559 |
|
560 |
numDirs := dirsToMake size. |
|
561 |
nDone := 0. |
|
562 |
||
563 |
dirsToMake do:[:dirName | |
|
564 |
|d errMsg stop box| |
|
565 |
||
566 |
actionPercentageHolder value:(nDone / numDirs * 100) rounded. |
|
567 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
568 |
msg at:4 put:' ' , (dirName asText allBold). |
0 | 569 |
actionTextHolder value:nil. |
570 |
actionTextHolder value:msg. |
|
571 |
||
572 |
d := dirName asFilename. |
|
573 |
||
11 | 574 |
commandTraceView showCR:(resources string:'creating %1 ...' with:d pathName). |
117 | 575 |
commandTraceView endEntry. |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
576 |
|
0 | 577 |
d exists ifFalse:[ |
578 |
OperatingSystem recursiveCreateDirectory:d pathName |
|
579 |
]. |
|
580 |
||
581 |
d exists ifFalse:[ |
|
1279 | 582 |
errMsg := (resources string:'failed to create directory: %1\\Please check your permissions.' with:dirName) withCRs. |
0 | 583 |
stop := true |
584 |
] ifTrue:[ |
|
585 |
d isDirectory ifFalse:[ |
|
11 | 586 |
errMsg := resources string:'not a directory: %1' with:dirName. |
0 | 587 |
stop := true |
588 |
] ifTrue:[ |
|
589 |
(d isReadable |
|
590 |
and:[d isWritable]) ifFalse:[ |
|
11 | 591 |
errMsg := resources string:'no read/write access to directory: %1' with:dirName. |
0 | 592 |
stop := false |
593 |
] ifTrue:[ |
|
594 |
errMsg := nil |
|
595 |
] |
|
596 |
] |
|
597 |
]. |
|
598 |
||
599 |
errMsg notNil ifTrue:[ |
|
600 |
box := WarningBox new. |
|
601 |
box title:errMsg. |
|
602 |
box showAtPointerNotCovering:(WindowGroup activeGroup topViews first). |
|
1 | 603 |
stop ifTrue:[^ false]. |
0 | 604 |
]. |
605 |
||
606 |
Delay waitForSeconds:0.25. |
|
607 |
nDone := nDone + 1. |
|
608 |
]. |
|
609 |
^ true |
|
610 |
||
611 |
"Created: 17.7.1996 / 15:24:19 / cg" |
|
117 | 612 |
"Modified: 22.5.1997 / 15:06:41 / cg" |
19 | 613 |
! |
614 |
||
1134 | 615 |
createRegistryEntries |
616 |
|release msg k| |
|
617 |
||
618 |
msg := (resources array:#('ST/X Installation' '' 'creating registry entries' '' '' '')) asStringCollection. |
|
619 |
actionTextHolder value:nil. |
|
620 |
actionTextHolder value:msg. |
|
621 |
||
622 |
commandTraceView showCR:(resources string:'creating registry entries...'). |
|
623 |
commandTraceView endEntry. |
|
624 |
||
625 |
release := self smalltalkRelease. |
|
626 |
||
627 |
k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'. |
|
1282 | 628 |
k isNil ifTrue:[ |
629 |
self warn:'cannot update registry under HKEY_LOCAL_MACHINE\Software\eXept'. |
|
630 |
^ self. |
|
631 |
]. |
|
632 |
||
1134 | 633 |
k := k createSubKeyNamed:'eXept'. |
634 |
k := k createSubKeyNamed:'Smalltalk/X'. |
|
635 |
k valueNamed:'CurrentVersion' put:release. |
|
636 |
||
637 |
k := k createSubKeyNamed:release. |
|
638 |
k valueNamed:'LibDir' put:stxLibDir. |
|
639 |
k valueNamed:'BinDir' put:stxBinDir. |
|
1279 | 640 |
k valueNamed:'DocDir' put:stxDocDir. |
641 |
k valueNamed:'PackageDirPath' put:stxPkgDir. |
|
1134 | 642 |
|
1282 | 643 |
"Modified: / 23.12.1999 / 22:21:18 / cg" |
1134 | 644 |
! |
645 |
||
19 | 646 |
createSymbolicLinks |
647 |
|msg dirsToMake numDirs nDone| |
|
648 |
||
1132 | 649 |
OperatingSystem isUNIXlike ifFalse:[^ self]. |
650 |
||
19 | 651 |
msg := (resources array:#('ST/X Installation' '' 'creating symbolic links' '' '' '')) asStringCollection. |
1134 | 652 |
actionTextHolder value:nil. |
653 |
actionTextHolder value:msg. |
|
19 | 654 |
|
1281 | 655 |
commandTraceView showCR:(resources string:'setting up symbolic links in doc/online ...'); endEntry. |
656 |
||
1010 | 657 |
installWhat == #full ifTrue:[ |
678 | 658 |
OperatingSystem executeCommand:('(cd ' , fullDir , '/doc/online ; make links)'). |
659 |
] ifFalse:[ |
|
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 |
|
678 | 687 |
"Created: / 17.7.1996 / 15:24:19 / cg" |
1134 | 688 |
"Modified: / 31.5.1999 / 14:46:36 / cg" |
678 | 689 |
! |
690 |
||
691 |
executeCommandAndShowOutput:cmd |
|
692 |
|doneSemaphore line p| |
|
693 |
||
1119 | 694 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
695 |
^ self |
|
696 |
]. |
|
697 |
||
678 | 698 |
doneSemaphore := Semaphore new. |
699 |
||
700 |
copyProcess := [ |
|
701 |
||
702 |
p := PipeStream readingFrom:cmd. |
|
703 |
p isNil ifTrue:[ |
|
704 |
self warn:('command error. Could not execute:\\' , cmd) withCRs. |
|
705 |
] ifFalse:[ |
|
706 |
[ |
|
707 |
[p atEnd] whileFalse:[ |
|
708 |
(p readWaitWithTimeout:0.1) ifFalse:[ |
|
709 |
line := p nextLine. |
|
710 |
(line notNil and:[line notEmpty]) ifTrue:[ |
|
711 |
commandTraceView showCR:((' ' , line) asText emphasizeAllWith:(#color->Color red)). |
|
712 |
commandTraceView endEntry. |
|
713 |
] |
|
714 |
] |
|
715 |
]. |
|
716 |
p close. |
|
717 |
] valueOnUnwindDo:[ |
|
718 |
p shutDown |
|
719 |
] |
|
720 |
]. |
|
721 |
doneSemaphore signal. |
|
722 |
copyProcess := nil. |
|
723 |
] forkAt:4. |
|
724 |
||
725 |
doneSemaphore wait. |
|
726 |
||
727 |
"Created: / 25.2.1998 / 17:46:06 / cg" |
|
1119 | 728 |
"Modified: / 30.4.1999 / 18:00:43 / cg" |
73 | 729 |
! |
730 |
||
731 |
outputInitialMessage |
|
1279 | 732 |
^ self. |
733 |
||
73 | 734 |
#( |
735 |
'Notice:' |
|
736 |
'' |
|
737 |
'During the installation, you may get error messages' |
|
738 |
'complaining that some files where not found' |
|
739 |
'and could therefore not be copied.' |
|
740 |
) do:[:line | |
|
741 |
commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). |
|
742 |
commandTraceView endEntry. |
|
743 |
]. |
|
744 |
||
745 |
Delay waitForSeconds:2. |
|
746 |
||
747 |
#( |
|
748 |
'' |
|
749 |
'This is normal behavior; since the CD may contain' |
|
750 |
'broken symbolic links to non-existing packages' |
|
751 |
'which are either not contained on your ordered' |
|
276 | 752 |
'package (i.e. non-commercial) or are not required' |
753 |
'for your architecture (and therefore not contained' |
|
754 |
'on the CD).' |
|
755 |
'' |
|
73 | 756 |
) do:[:line | |
757 |
commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). |
|
758 |
commandTraceView endEntry. |
|
759 |
]. |
|
760 |
||
761 |
Delay waitForSeconds:2. |
|
762 |
||
763 |
#( |
|
764 |
'' |
|
765 |
'Please excuse this inconvenience.' |
|
766 |
'' |
|
767 |
) do:[:line | |
|
768 |
commandTraceView showCR:((resources string:line) asText emphasizeAllWith:(#color->Color blue)). |
|
769 |
commandTraceView endEntry. |
|
770 |
]. |
|
771 |
||
772 |
Delay waitForSeconds:2. |
|
773 |
||
774 |
"Created: 2.3.1997 / 12:49:52 / cg" |
|
276 | 775 |
"Modified: 8.8.1997 / 17:47:06 / cg" |
1132 | 776 |
! |
777 |
||
1279 | 778 |
recursiveCopy:src to:dst |
1281 | 779 |
self recursiveCopy:src to:dst print:true |
780 |
! |
|
781 |
||
782 |
recursiveCopy:src to:dst print:doPrint |
|
1282 | 783 |
|cmd srcBaseName srcF dstF d| |
1132 | 784 |
|
1279 | 785 |
srcF := src asFilename. |
786 |
dstF := dst asFilename. |
|
1282 | 787 |
|
1279 | 788 |
"/ OperatingSystem isUNIXlike ifTrue:[ |
789 |
"/ cmd := 'cp -r ' , src , ' ' , destDir. |
|
790 |
"/ commandTraceView showCR:cmd , ' ...'. |
|
791 |
"/ commandTraceView endEntry. |
|
792 |
"/ cmd := cmd , ' 2>&1' . |
|
793 |
"/ |
|
794 |
"/ self executeCommandAndShowOutput:cmd |
|
795 |
"/ ] ifFalse:[ |
|
1282 | 796 |
srcBaseName := srcF baseName. |
797 |
(srcBaseName startsWith:'.#') ifTrue:[^ self]. |
|
798 |
||
1279 | 799 |
(#( |
800 |
'CVS' |
|
801 |
'not_delivered' |
|
1282 | 802 |
'.cvsignore' |
803 |
'.dir.info' |
|
804 |
) includes:srcBaseName) ifFalse:[ |
|
805 |
srcBaseName includesMatchCharacters ifTrue:[ |
|
1281 | 806 |
doPrint ifTrue:[ |
807 |
OperatingSystem isUNIXlike ifTrue:[ |
|
808 |
commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). |
|
809 |
] ifFalse:[ |
|
810 |
commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). |
|
811 |
]. |
|
812 |
commandTraceView endEntry. |
|
813 |
]. |
|
1284 | 814 |
(srcF directory directoryContents ? #()) do:[:fileName | |
1282 | 815 |
(srcBaseName match:fileName) ifTrue:[ |
1279 | 816 |
(#( |
817 |
'CVS' |
|
818 |
'not_delivered' |
|
819 |
) includes:fileName) ifFalse:[ |
|
1281 | 820 |
self |
821 |
recursiveCopy:(srcF directory construct:fileName) |
|
822 |
to:dstF |
|
823 |
print:false |
|
1279 | 824 |
] |
825 |
] |
|
826 |
] |
|
827 |
] ifFalse:[ |
|
1281 | 828 |
doPrint ifTrue:[ |
829 |
OperatingSystem isUNIXlike ifTrue:[ |
|
830 |
commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). |
|
831 |
] ifFalse:[ |
|
832 |
commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). |
|
833 |
]. |
|
834 |
commandTraceView endEntry. |
|
1279 | 835 |
]. |
836 |
srcF isDirectory ifFalse:[ |
|
837 |
(dstF exists and:[dstF isDirectory]) ifTrue:[ |
|
1282 | 838 |
dstF := dstF construct:srcBaseName. |
1279 | 839 |
]. |
1281 | 840 |
srcF copyTo:dstF. |
841 |
OperatingSystem isUNIXlike ifTrue:[ |
|
842 |
srcF isExecutable ifTrue:[ |
|
843 |
dstF makeExecutableForAll |
|
844 |
] |
|
845 |
] |
|
1279 | 846 |
] ifTrue:[ |
1282 | 847 |
d := dstF asFilename construct:srcBaseName. |
1279 | 848 |
(d exists) ifFalse:[ |
849 |
d makeDirectory. |
|
850 |
]. |
|
1284 | 851 |
(srcF directoryContents ? #()) do:[:fileName | |
1279 | 852 |
self recursiveCopy:(srcF construct:fileName) |
853 |
to:d |
|
1281 | 854 |
print:false |
1279 | 855 |
] |
1132 | 856 |
] |
857 |
] |
|
858 |
] |
|
1279 | 859 |
"/ ] |
1132 | 860 |
|
861 |
"Created: / 31.5.1999 / 13:05:09 / cg" |
|
1284 | 862 |
"Modified: / 23.12.1999 / 23:36:53 / cg" |
0 | 863 |
! ! |
864 |
||
865 |
!STXInstaller methodsFor:'startup'! |
|
866 |
||
867 |
askAndInstall |
|
868 |
"/ check, if we are in the projects/smalltalk directory |
|
869 |
||
1119 | 870 |
|answer here| |
678 | 871 |
|
11 | 872 |
resources := ResourcePack for:self class. |
873 |
||
1132 | 874 |
(((here := Filename currentDirectory pathName) endsWith:'projects/smalltalk') not |
875 |
and:[(here asLowercase endsWith:'stx\binbc') not |
|
876 |
and:[(here asLowercase endsWith:'projects\smalltalk') not |
|
877 |
]]) ifTrue:[ |
|
1150 | 878 |
"/ double - check if some of my expected files exists here ... |
1151 | 879 |
('../../libbasic' asFilename exists |
880 |
and:['../../libbasic' asFilename isDirectory]) ifTrue:[ |
|
1150 | 881 |
self warn:(resources string:'Oops - current directories name seems to not end with ''/projects/smalltalk''\\Assume its OK.' withCRs). |
882 |
] ifFalse:[ |
|
883 |
self warn:(resources string:'must be in the ''projects/smalltalk'' directory'). |
|
884 |
^ self |
|
885 |
] |
|
0 | 886 |
]. |
887 |
||
678 | 888 |
answer := self askForFullInstallation. |
889 |
answer ifFalse:[^ self]. |
|
890 |
||
0 | 891 |
[self askForDestination] whileTrue:[ |
73 | 892 |
self checkForExistingInstallationAndConfirm ifTrue:[ |
893 |
self preInstall. |
|
894 |
self doInstall ifTrue:[ |
|
895 |
self postInstall. |
|
896 |
^ self |
|
897 |
]. |
|
898 |
(self confirm:(resources string:'installation failed or aborted - retry ?')) |
|
899 |
ifFalse:[ |
|
900 |
^ self |
|
901 |
] |
|
0 | 902 |
] |
903 |
]. |
|
904 |
||
1132 | 905 |
"Modified: / 31.5.1999 / 12:04:14 / cg" |
0 | 906 |
! |
907 |
||
908 |
askForDestination |
|
909 |
"open a dialog to enter destination directories" |
|
910 |
||
1010 | 911 |
installWhat == #full ifTrue:[ |
678 | 912 |
^ self askForDestinationForFullInstallation |
913 |
] ifFalse:[ |
|
914 |
^ self askForDestinationForPartialInstallation |
|
915 |
] |
|
916 |
||
917 |
" |
|
918 |
STXInstaller open |
|
919 |
" |
|
920 |
||
921 |
"Modified: / 25.2.1998 / 17:12:45 / cg" |
|
922 |
! |
|
923 |
||
924 |
askForDestinationForFullInstallation |
|
925 |
"open a dialog to enter destination directories" |
|
926 |
||
927 |
|d cm l green dark img |
|
928 |
fullDirHolder| |
|
929 |
||
930 |
LastFullDir isNil ifTrue:[ |
|
931 |
LastFullDir := (Filename homeDirectory |
|
932 |
construct:'stx') |
|
933 |
constructString:'develop' |
|
934 |
]. |
|
935 |
||
936 |
fullDirHolder := LastFullDir asValue. |
|
937 |
||
938 |
Screen current hasColors ifTrue:[ |
|
939 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
940 |
dark := Color grey:10. |
|
941 |
] ifFalse:[ |
|
942 |
green := Color white. |
|
943 |
dark := Color black. |
|
944 |
]. |
|
945 |
||
946 |
d := DialogBox new. |
|
947 |
||
948 |
d label:(resources string:'ST/X Full Installation'). |
|
949 |
img := Image fromFile:'SmalltalkX.xbm'. |
|
950 |
||
951 |
l := d addTextLabel:img. |
|
952 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
953 |
||
954 |
l := d addTextLabel:(resources string:'Smalltalk/X CD installation (full).'). |
|
955 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
956 |
d addVerticalSpace. |
|
957 |
d addVerticalSpace. |
|
958 |
||
959 |
d addHorizontalLine. |
|
960 |
||
961 |
l := d addTextLabel:(resources string:'ST/X development directory:'). |
|
962 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
963 |
||
964 |
cm := ComboBoxView on:fullDirHolder. |
|
965 |
cm list:self defaultFullDirs. |
|
966 |
d |
|
967 |
addLabelledField:cm |
|
968 |
label:(resources string:'stx develop') |
|
969 |
adjust:#left |
|
970 |
tabable:true |
|
971 |
from:0.0 to:1.0 separateAtX:0.25 |
|
972 |
nameAs:'fullBox'. |
|
973 |
||
974 |
(d componentAt:'fullBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
975 |
||
976 |
d addVerticalSpace. |
|
977 |
d addHorizontalLine. |
|
978 |
||
979 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
|
980 |
addAbortButton; |
|
981 |
addOkButtonLabelled:(resources string:'install'). |
|
982 |
d extent:500@400. |
|
1151 | 983 |
d resize. "/ compute best size |
678 | 984 |
|
985 |
d allViewBackground:dark. |
|
986 |
||
987 |
d openAtCenter. |
|
988 |
d accepted ifTrue:[ |
|
989 |
fullDir := LastFullDir := fullDirHolder value. |
|
990 |
d destroy. |
|
991 |
^ true |
|
992 |
]. |
|
993 |
d destroy. |
|
994 |
^ false |
|
995 |
||
996 |
" |
|
997 |
STXInstaller open |
|
998 |
" |
|
999 |
||
1000 |
"Created: / 25.2.1998 / 17:11:37 / cg" |
|
1001 |
"Modified: / 25.2.1998 / 17:29:07 / cg" |
|
1002 |
! |
|
1003 |
||
1004 |
askForDestinationForPartialInstallation |
|
1005 |
"open a dialog to enter destination directories" |
|
1006 |
||
2 | 1007 |
|d cm l green dark img |
1132 | 1008 |
stxInstDirHolder stxLibDirHolder stxLibBinDirHolder stxBinDirHolder |
5 | 1009 |
installDocHolder installSourceHolder installSTCHolder installGoodiesHolder |
73 | 1010 |
binMegabytes libMegabytes docMegabytes stcMegabytes srcMegabytes |
1132 | 1011 |
goodyMegabytes stxRel list stxInstDir |
0 | 1012 |
| |
1013 |
||
1139 | 1014 |
binMegabytes := 20. |
73 | 1015 |
libMegabytes := 30. |
1139 | 1016 |
docMegabytes := 12. |
1117
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1017 |
stcMegabytes := 2. |
1139 | 1018 |
srcMegabytes := 20. |
1019 |
goodyMegabytes := 10. |
|
11 | 1020 |
|
1132 | 1021 |
stxRel := self smalltalkRelease. |
1022 |
||
1119 | 1023 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
1132 | 1024 |
LastPartialDir isNil ifTrue:[ |
1139 | 1025 |
LastPartialDir := 'c:\Programme\eXept\SmalltalkX\' , stxRel |
1119 | 1026 |
]. |
1132 | 1027 |
"/ LastLibDir isNil ifTrue:[ |
1028 |
"/ LastLibDir := 'c:\Programme\SmalltalkX\' , stxRel , '\lib' |
|
1029 |
"/ ]. |
|
1030 |
"/ LastLibBinDir isNil ifTrue:[ |
|
1031 |
"/ LastLibBinDir := 'c:\Programme\SmalltalkX\' , stxRel , '\lib' |
|
1032 |
"/ ]. |
|
1033 |
"/ LastBinDir isNil ifTrue:[ |
|
1034 |
"/ LastBinDir := 'c:\Programme\SmalltalkX\' , stxRel , '\bin' |
|
1035 |
"/ ]. |
|
1119 | 1036 |
] ifFalse:[ |
1132 | 1037 |
LastPartialDir isNil ifTrue:[ |
1038 |
LastPartialDir := '/opt/smalltalk/' , stxRel |
|
1119 | 1039 |
]. |
1132 | 1040 |
"/ LastLibDir isNil ifTrue:[ |
1041 |
"/ LastLibDir := '/opt/smalltalk/' , stxRel , '/lib' |
|
1042 |
"/ ]. |
|
1043 |
"/ LastLibBinDir isNil ifTrue:[ |
|
1044 |
"/ LastLibBinDir := '/opt/smalltalk/' , stxRel , '/lib' |
|
1045 |
"/ ]. |
|
1046 |
"/ LastBinDir isNil ifTrue:[ |
|
1047 |
"/ LastBinDir := '/opt/smalltalk/' , stxRel , '/bin' |
|
1048 |
"/ ]. |
|
0 | 1049 |
]. |
1050 |
||
1132 | 1051 |
stxInstDirHolder := LastPartialDir asValue. |
1052 |
"/ stxLibDirHolder := LastLibDir asValue. |
|
1053 |
"/ stxLibBinDirHolder := LastLibBinDir asValue. |
|
1054 |
"/ stxBinDirHolder := LastBinDir asValue. |
|
24 | 1055 |
|
5 | 1056 |
installDocHolder := true asValue. |
1057 |
installSourceHolder := true asValue. |
|
1058 |
installSTCHolder := true asValue. |
|
1059 |
installGoodiesHolder := true asValue. |
|
0 | 1060 |
|
1061 |
Screen current hasColors ifTrue:[ |
|
1062 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
1063 |
dark := Color grey:10. |
|
1064 |
] ifFalse:[ |
|
1065 |
green := Color white. |
|
1066 |
dark := Color black. |
|
1067 |
]. |
|
1068 |
||
1069 |
d := DialogBox new. |
|
1070 |
||
1279 | 1071 |
d label:(resources string:'ST/X Standard Installation'). |
2 | 1072 |
img := Image fromFile:'SmalltalkX.xbm'. |
1073 |
||
1074 |
l := d addTextLabel:img. |
|
1075 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
1076 |
||
1279 | 1077 |
l := d addTextLabel:(resources string:'Smalltalk/X Standard installation (partial).'). |
0 | 1078 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
1079 |
d addVerticalSpace. |
|
1080 |
d addVerticalSpace. |
|
1081 |
||
1082 |
d addHorizontalLine. |
|
1083 |
||
11 | 1084 |
l := d addTextLabel:(resources string:'Destination directories:'). |
0 | 1085 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
1086 |
||
1132 | 1087 |
l := d addTextLabel:(resources string:'(the default below is recommended)'). |
678 | 1088 |
l adjust:#right; backgroundColor:dark; foregroundColor:Color white. |
1089 |
||
1132 | 1090 |
cm := ComboBoxView on:stxInstDirHolder. |
1139 | 1091 |
list := self defaultInstDirs collect:[:line | |
1132 | 1092 |
line replChar:$\ withString:'\\' |
1093 |
]. |
|
1094 |
cm list:list. |
|
0 | 1095 |
d |
1096 |
addLabelledField:cm |
|
1132 | 1097 |
label:(resources string:'install into:') |
0 | 1098 |
adjust:#left |
1099 |
tabable:true |
|
1100 |
from:0.0 to:1.0 separateAtX:0.25 |
|
1132 | 1101 |
nameAs:'instDirBox'. |
0 | 1102 |
|
1132 | 1103 |
(d componentAt:'instDirBox.label') backgroundColor:dark; foregroundColor:Color white. |
24 | 1104 |
|
1132 | 1105 |
"/ cm := ComboBoxView on:stxBinDirHolder. |
1106 |
"/ list := self defaultBinDirs collect:[:line | |
|
1107 |
"/ line replChar:$\ withString:'\\' |
|
1108 |
"/ ]. |
|
1109 |
"/ cm list:list. |
|
1110 |
"/ d |
|
1111 |
"/ addLabelledField:cm |
|
1112 |
"/ label:(resources string:'binaries') |
|
1113 |
"/ adjust:#left |
|
1114 |
"/ tabable:true |
|
1115 |
"/ from:0.0 to:1.0 separateAtX:0.25 |
|
1116 |
"/ nameAs:'binaryBox'. |
|
1117 |
"/ |
|
1118 |
"/ (d componentAt:'binaryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
1119 |
"/ |
|
1120 |
"/ cm := ComboBoxView on:stxLibBinDirHolder. |
|
1121 |
"/ cm list:self defaultLibBinDirs. |
|
1122 |
"/ d |
|
1123 |
"/ addLabelledField:cm |
|
1124 |
"/ label:(resources string:'libraries') |
|
1125 |
"/ adjust:#left |
|
1126 |
"/ tabable:true |
|
1127 |
"/ from:0.0 to:1.0 separateAtX:0.25 |
|
1128 |
"/ nameAs:'libraryBinBox'. |
|
1129 |
"/ |
|
1130 |
"/ (d componentAt:'libraryBinBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
1131 |
"/ |
|
1132 |
"/ cm := ComboBoxView on:stxLibDirHolder. |
|
1133 |
"/ cm list:self defaultLibDirs. |
|
1134 |
"/ d |
|
1135 |
"/ addLabelledField:cm |
|
1136 |
"/ label:(resources string:'other files') |
|
1137 |
"/ adjust:#left |
|
1138 |
"/ tabable:true |
|
1139 |
"/ from:0.0 to:1.0 separateAtX:0.25 |
|
1140 |
"/ nameAs:'libraryBox'. |
|
1141 |
"/ |
|
1142 |
"/ (d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white. |
|
0 | 1143 |
|
5 | 1144 |
d addVerticalSpace. |
1145 |
d addHorizontalLine. |
|
1146 |
d addVerticalSpace. |
|
1147 |
||
11 | 1148 |
(d addTextLabel:(resources string:'required:')) |
5 | 1149 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
1150 |
||
1151 |
d leftIndent:35. |
|
11 | 1152 |
(d addTextLabel:(resources string:'binaries (approx. %1 Mb)' with:binMegabytes printString)) |
5 | 1153 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
11 | 1154 |
(d addTextLabel:(resources string:'libraries (approx. %1 Mb)' with:libMegabytes printString)) |
5 | 1155 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
1156 |
d leftIndent:0. |
|
1157 |
||
1158 |
d addVerticalSpace. |
|
1159 |
d addHorizontalLine. |
|
1160 |
d addVerticalSpace. |
|
1161 |
||
11 | 1162 |
(d addTextLabel:(resources string:'optional:')) |
5 | 1163 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
1164 |
||
73 | 1165 |
(d addCheckBox:((resources string:'doc files (+%1 Mb)' with:docMegabytes)) on:installDocHolder) |
5 | 1166 |
labelView foregroundColor:Color white backgroundColor:dark. |
73 | 1167 |
(d addCheckBox:((resources string:'stc & support files (+%1 Mb)' with:stcMegabytes)) on:installSTCHolder) |
10 | 1168 |
labelView foregroundColor:Color white backgroundColor:dark. |
1169 |
||
1170 |
d addVerticalSpace. |
|
1171 |
d addHorizontalLine. |
|
1172 |
d addVerticalSpace. |
|
1173 |
||
11 | 1174 |
(d addTextLabel:(resources string:'optional (but highly recommended):')) |
10 | 1175 |
adjust:#left; foregroundColor:Color white backgroundColor:dark. |
1176 |
||
73 | 1177 |
(d addCheckBox:((resources string:'smalltalk source files (+%1 Mb)' with:srcMegabytes)) on:installSourceHolder) |
5 | 1178 |
labelView foregroundColor:Color white backgroundColor:dark. |
1117
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1179 |
(d addCheckBox:((resources string:'goodies (+%1 Mb)' with:goodyMegabytes)) on:installGoodiesHolder) |
5 | 1180 |
labelView foregroundColor:Color white backgroundColor:dark. |
1181 |
||
1182 |
d addVerticalSpace. |
|
1183 |
d addHorizontalLine. |
|
1184 |
||
24 | 1185 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
1186 |
addAbortButton; |
|
1187 |
addOkButtonLabelled:(resources string:'install'). |
|
73 | 1188 |
d extent:500@400. |
1151 | 1189 |
d resize. "/ compute best size |
0 | 1190 |
|
1191 |
d allViewBackground:dark. |
|
1192 |
||
1193 |
d openAtCenter. |
|
1194 |
d accepted ifTrue:[ |
|
1279 | 1195 |
stxInstDir := LastPartialDir := stxTopDir := stxInstDirHolder value. |
1196 |
stxDocDir := stxInstDir asFilename constructString:'doc'. |
|
1132 | 1197 |
stxLibDir := stxInstDir asFilename constructString:'lib'. |
1198 |
stxLibBinDir := stxInstDir asFilename constructString:'lib'. |
|
1199 |
stxBinDir := stxInstDir asFilename constructString:'bin'. |
|
1279 | 1200 |
stxPkgDir := stxInstDir asFilename constructString:'packages'. |
1132 | 1201 |
|
1202 |
"/ stxLibDir := LastLibDir := stxLibDirHolder value. |
|
1203 |
"/ stxLibBinDir := LastLibBinDir := stxLibBinDirHolder value. |
|
1204 |
"/ stxBinDir := LastBinDir := stxBinDirHolder value. |
|
5 | 1205 |
installDocFiles := installDocHolder value. |
1206 |
installSourceFiles := installSourceHolder value. |
|
1207 |
installSTCFiles := installSTCHolder value. |
|
1208 |
installGoodyFiles := installGoodiesHolder value. |
|
1 | 1209 |
d destroy. |
0 | 1210 |
^ true |
1211 |
]. |
|
1 | 1212 |
d destroy. |
0 | 1213 |
^ false |
1214 |
||
678 | 1215 |
" |
1216 |
STXInstaller open |
|
1217 |
" |
|
1218 |
||
1219 |
"Created: / 25.2.1998 / 17:11:26 / cg" |
|
1139 | 1220 |
"Modified: / 31.5.1999 / 18:37:50 / cg" |
678 | 1221 |
! |
1222 |
||
1223 |
askForFullInstallation |
|
1224 |
"open a dialog to enter destination directories" |
|
1225 |
||
1226 |
|d cm l green dark img| |
|
1227 |
||
1228 |
Screen current hasColors ifTrue:[ |
|
1229 |
green := (Color red:0 green:80 blue:20) "darkened". |
|
1230 |
dark := Color grey:10. |
|
1231 |
] ifFalse:[ |
|
1232 |
green := Color white. |
|
1233 |
dark := Color black. |
|
1234 |
]. |
|
1235 |
||
1236 |
d := DialogBox new. |
|
1237 |
||
1238 |
d label:(resources string:'ST/X CD Installation'). |
|
1239 |
img := Image fromFile:'SmalltalkX.xbm'. |
|
1240 |
||
1241 |
l := d addTextLabel:img. |
|
1242 |
l adjust:#left; foregroundColor:green backgroundColor:dark. |
|
1243 |
||
1244 |
l := d addTextLabel:(resources string:'Smalltalk/X CD installation.'). |
|
1245 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
1246 |
d addVerticalSpace. |
|
1247 |
d addVerticalSpace. |
|
1248 |
||
1249 |
d addHorizontalLine. |
|
1250 |
||
1251 |
l := d addTextLabel:(resources string: |
|
1279 | 1252 |
'You can either perform a ' , 'full' asText allBold , ' installation, or a ' , 'standard' asText allBold ,' (partial) installation.'). |
678 | 1253 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
1254 |
||
1255 |
d addVerticalSpace. |
|
1256 |
d addHorizontalLine. |
|
1257 |
||
1258 |
d leftIndent:20. |
|
1259 |
l := d addTextLabel:(resources string: |
|
1117
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1260 |
'full:' asText allBold , ' |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1261 |
The full installation is required if you want to build your own |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1262 |
customized smalltalk executable. It allows you to create and include |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1263 |
additional precompiled binary classes or classLibraries. |
678 | 1264 |
This is also required if you want to link your own standalone executables. |
1265 |
||
1266 |
It consists of a directory hierachy, including makefiles for a customizeable |
|
1267 |
rebuild of the whole smalltalk system. |
|
1268 |
(Actually, it simply copies the whole CD contents onto your disk). |
|
1151 | 1269 |
This requires roughly 120-250Mb of hard disk space (dep. upon architecture).'). |
678 | 1270 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
1271 |
||
1272 |
d addVerticalSpace. |
|
1273 |
d addHorizontalLine. |
|
1274 |
||
1275 |
l := d addTextLabel:(resources string: |
|
1279 | 1276 |
'standard:' asText allBold , ' |
1277 |
The standard (runTime) installation requires less disk space and only copies the |
|
678 | 1278 |
smalltalk executable, shared libraries and support files onto your hard disk. |
1117
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1279 |
This setup allows normal smalltalk development and is also useful as a runtime |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1280 |
environment for smalltalk applications. |
1151 | 1281 |
However, it does not support recreation of a new smalltalk executable and/or |
1117
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1282 |
shared binary classLibraries. |
1151 | 1283 |
This setup also saves a lot of disk space, if multiple users are going to |
1284 |
use smalltalk, since most of the code is shared (both on disk and in memory). |
|
1285 |
This requires roughly 70-120Mb of hard disk space (dep. upon architecture). |
|
678 | 1286 |
|
1287 |
||
1288 |
'). |
|
1289 |
l adjust:#left; backgroundColor:dark; foregroundColor:Color white. |
|
1290 |
||
1291 |
||
1292 |
d leftIndent:0. |
|
1293 |
d addVerticalSpace. |
|
1294 |
d addHorizontalLine. |
|
1295 |
||
1296 |
||
1297 |
d addHelpButtonFor:'STXInstaller/installHelp.html'; |
|
1298 |
addAbortButton; |
|
1010 | 1299 |
addOkButton:(Button label:(resources string:'full') action:[installWhat := #full]); |
1279 | 1300 |
addOkButtonLabelled:(resources string:'standard'). |
1151 | 1301 |
d extent:500@500. |
1302 |
d resize. "/ compute best size ... |
|
678 | 1303 |
|
1304 |
d allViewBackground:dark. |
|
1305 |
||
1010 | 1306 |
installWhat := #partial. |
678 | 1307 |
d openAtCenter. |
1308 |
d accepted ifTrue:[ |
|
1309 |
d destroy. |
|
1310 |
^ true |
|
1311 |
]. |
|
1312 |
d destroy. |
|
1313 |
^ false |
|
1314 |
||
1315 |
" |
|
1316 |
STXInstaller open |
|
1317 |
" |
|
1318 |
||
1319 |
"Created: / 25.2.1998 / 16:50:16 / cg" |
|
1320 |
"Modified: / 25.2.1998 / 19:42:31 / cg" |
|
0 | 1321 |
! |
1322 |
||
1323 |
checkForExistingInstallationAndConfirm |
|
1324 |
"look if there is another installation and confirm |
|
1325 |
reinstalling; return true if ok, false if not" |
|
1326 |
||
678 | 1327 |
|whichDir canOverWrite whatToDo box| |
1328 |
||
1010 | 1329 |
installWhat == #full ifTrue:[ |
678 | 1330 |
whichDir := fullDir. |
1331 |
canOverWrite := false. |
|
1332 |
] ifFalse:[ |
|
1333 |
whichDir := stxLibDir. |
|
1334 |
canOverWrite := true. |
|
1335 |
]. |
|
1 | 1336 |
|
678 | 1337 |
whichDir asFilename exists ifTrue:[ |
1338 |
whatToDo := Dialog |
|
1339 |
choose:(resources |
|
1340 |
string:'detected existing ST/X installation in %1' |
|
1341 |
with:whichDir asText allBold) |
|
1342 |
label:(resources string:'Attention') |
|
1343 |
labels:(resources array:(canOverWrite |
|
1344 |
ifFalse:[#('remove first' 'cancel')] |
|
1345 |
ifTrue:[#('remove first' 'overwrite' 'cancel')] )) |
|
1346 |
values:(canOverWrite ifFalse:[#(remove nil)] ifTrue:[#(remove over nil)]) |
|
1347 |
default:nil. |
|
73 | 1348 |
|
678 | 1349 |
whatToDo isNil ifTrue:[^false]. |
1350 |
whatToDo == #remove ifTrue:[ |
|
1351 |
((whichDir findString:'stx') == 0 |
|
1352 |
and:[(whichDir findString:'smalltalk') == 0]) ifTrue:[ |
|
1353 |
"/ confirm again |
|
1354 |
(self confirm:(resources |
|
1355 |
string:'are you certain that the directory to remove |
|
1356 |
(' , whichDir , ') is really a smalltalk directory ? |
|
23
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
1357 |
|
73 | 1358 |
Remove it now ?')) ifFalse:[ |
678 | 1359 |
^ false |
1360 |
] |
|
1361 |
]. |
|
1362 |
||
1363 |
[ |
|
1364 |
box := DialogBox new label:'please wait'. |
|
1365 |
box addTextLabel:'removing ' , whichDir , ' ...'. |
|
1366 |
box showAtPointer. |
|
1367 |
] forkAt:(Processor activePriority+1). |
|
1368 |
box waitUntilVisible. |
|
23
42997b231783
double confirm removal of directory, if its name
Claus Gittinger <cg@exept.de>
parents:
22
diff
changeset
|
1369 |
|
678 | 1370 |
(OperatingSystem recursiveRemoveDirectory:whichDir) |
1371 |
ifFalse:[ |
|
1372 |
self warn:(resources string:'mhmh - could not remove old installation. |
|
1373 |
||
1132 | 1374 |
Please remove it manually (using administrator privileges if required) |
678 | 1375 |
and try again.'). |
1376 |
box destroy. |
|
1377 |
^ false |
|
1378 |
]. |
|
1379 |
||
1380 |
box destroy |
|
1 | 1381 |
]. |
0 | 1382 |
]. |
678 | 1383 |
|
0 | 1384 |
^ true |
1385 |
||
678 | 1386 |
" |
1387 |
STXInstaller open |
|
1388 |
" |
|
1389 |
||
1132 | 1390 |
"Modified: / 31.5.1999 / 13:23:03 / cg" |
0 | 1391 |
! |
1392 |
||
1393 |
doInstall |
|
1394 |
"install ST/X; return true if ok, false if not" |
|
1395 |
||
678 | 1396 |
|progressView ok v textView p l |
1132 | 1397 |
dirToMonitor doDfMonitoring dfMonitorProcess kB drive| |
678 | 1398 |
|
1399 |
doDfMonitoring := false. |
|
1400 |
||
1401 |
v := View new preferredExtent:(250 @ 350). |
|
1402 |
||
1403 |
textView := HVScrollableView for:TextCollector in:v. |
|
1404 |
textView origin:0.0@0.0 corner:1.0@1.0. |
|
1405 |
textView bottomInset:30. |
|
1406 |
commandTraceView := textView scrolledView. |
|
1407 |
||
1010 | 1408 |
installWhat == #full ifTrue:[ |
678 | 1409 |
dirToMonitor := fullDir. |
1410 |
] ifFalse:[ |
|
1411 |
dirToMonitor := stxLibDir |
|
1412 |
]. |
|
1413 |
||
1132 | 1414 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
1415 |
drive := Filename rootDirectoryOnVolume:(dirToMonitor asFilename volume) |
|
1416 |
] ifFalse:[ |
|
1417 |
drive := dirToMonitor |
|
1418 |
]. |
|
1152 | 1419 |
drive := drive asFilename. |
678 | 1420 |
|
1132 | 1421 |
p := HorizontalPanelView in:v. |
1422 |
p origin:0.0@1.0 corner:1.0@1.0. |
|
1423 |
p topInset:-30. |
|
1424 |
p horizontalLayout:#fit. |
|
1425 |
||
1426 |
l := Label label:'' in:p. |
|
1427 |
l labelChannel:(dfHolder := '' asValue). |
|
1428 |
l adjust:#left. |
|
1429 |
dfMonitorProcess := [ |
|
1430 |
|ok info free kB i l| |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1431 |
|
1132 | 1432 |
ok := true. |
1433 |
[ok] whileTrue:[ |
|
1434 |
doDfMonitoring ifTrue:[ |
|
1435 |
ok := false. |
|
1436 |
info := OperatingSystem getDiskInfoOf:drive pathName. |
|
1437 |
info notNil ifTrue:[ |
|
1438 |
free := info at:#freeBytes ifAbsent:nil. |
|
1439 |
free notNil ifTrue:[ |
|
1440 |
kB := free / 1024. |
|
1441 |
kB > 10000 ifTrue:[ |
|
1442 |
l := (kB // 1024) printString, 'Mb available.'. |
|
1443 |
] ifFalse:[ |
|
1444 |
l := kB printString , 'Kb available.'. |
|
678 | 1445 |
]. |
1132 | 1446 |
dfHolder value:l. |
1447 |
ok := true. |
|
1448 |
Delay waitForSeconds:9. |
|
678 | 1449 |
]. |
1450 |
]. |
|
1132 | 1451 |
]. |
1452 |
Delay waitForSeconds:1. |
|
1453 |
] |
|
1454 |
] forkAt:(Processor activePriority+3). |
|
0 | 1455 |
|
1456 |
progressView := ProgressIndicator |
|
1118 | 1457 |
inBoxWithLabel:'ST/X Installation' icon:(Icon stxIcon) |
0 | 1458 |
text:#('ST/X Installation' '' '' '' '' '' '' '') asStringCollection |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1459 |
abortable:true |
678 | 1460 |
view:v |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1461 |
closeWhenDone:false. |
73 | 1462 |
progressView topView extent:(640 min:Display width) @ (500 min:Display height). |
0 | 1463 |
|
1464 |
ok := false. |
|
1465 |
||
1466 |
progressView showProgressOf: |
|
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1467 |
[:progressValue :currentAction| |msg| |
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1468 |
|
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1469 |
Processor activeProcess withPriority:7 do:[ |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1470 |
[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1471 |
actionPercentageHolder := progressValue. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1472 |
actionTextHolder := currentAction. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1473 |
|
1010 | 1474 |
installWhat == #full ifFalse:[ |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1475 |
self outputInitialMessage. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1476 |
]. |
0 | 1477 |
|
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1478 |
(self createDirectories) ifTrue:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1479 |
doDfMonitoring := true. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1480 |
ok := self copyFiles |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1481 |
]. |
790 | 1482 |
self changeWritability. |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1483 |
self createSymbolicLinks. |
1134 | 1484 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
1485 |
self createRegistryEntries. |
|
1486 |
]. |
|
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1487 |
|
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1488 |
progressValue value:100. |
73 | 1489 |
|
1117
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1490 |
progressView topView raise. |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1491 |
commandTraceView showCR:'Installation finished.' asText allBold. |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1492 |
commandTraceView endEntry. |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1493 |
textView flash. |
657dde1e749d
new default destination: /opt/smalltalk/<RELEASE>
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
1494 |
|
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1495 |
progressView topView abortButton label:(resources string:'continue'). |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1496 |
progressView topView abortButton action:[progressView topView hide]. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1497 |
msg := (resources |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1498 |
array:#('ST/X Installation finished.' '' 'press continue ...' '' '' '')) |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1499 |
asStringCollection. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1500 |
actionTextHolder value:nil. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1501 |
actionTextHolder value:msg. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1502 |
] valueOnUnwindDo:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1503 |
dfMonitorProcess notNil ifTrue:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1504 |
dfMonitorProcess terminate. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1505 |
dfMonitorProcess := nil. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1506 |
]. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1507 |
copyProcess notNil ifTrue:[ |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1508 |
copyProcess terminate. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1509 |
copyProcess := nil. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1510 |
]. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1511 |
] |
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1512 |
] |
0 | 1513 |
]. |
1514 |
||
678 | 1515 |
dfMonitorProcess notNil ifTrue:[ |
682
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1516 |
dfMonitorProcess terminate. |
9fcd010d8fd3
terminate monitor process on unwind
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
1517 |
dfMonitorProcess := nil. |
678 | 1518 |
]. |
1519 |
copyProcess notNil ifTrue:[ |
|
1520 |
copyProcess terminate. |
|
1521 |
copyProcess := nil. |
|
1522 |
]. |
|
0 | 1523 |
^ ok |
1524 |
||
678 | 1525 |
" |
1526 |
STXInstaller open |
|
1527 |
" |
|
1528 |
||
1529 |
"Created: / 17.7.1996 / 15:11:27 / cg" |
|
1134 | 1530 |
"Modified: / 31.5.1999 / 14:45:12 / cg" |
0 | 1531 |
! |
1532 |
||
1533 |
open |
|
1 | 1534 |
self askAndInstall. |
0 | 1535 |
|
5 | 1536 |
" |
1119 | 1537 |
LastLibDir := LastBinDir := LastLibBinDir := nil. |
1139 | 1538 |
LastPartialDir := LastFullDir := nil. |
1119 | 1539 |
|
5 | 1540 |
STXInstaller open |
1541 |
" |
|
1119 | 1542 |
|
1139 | 1543 |
"Modified: / 31.5.1999 / 18:28:10 / cg" |
1 | 1544 |
! |
1545 |
||
1546 |
postInstall |
|
1547 |
"some messages at the end ..." |
|
1548 |
||
4
8b68fdf7c870
better looking; show command output
Claus Gittinger <cg@exept.de>
parents:
3
diff
changeset
|
1549 |
|shInfo cshInfo msg havePath| |
1 | 1550 |
|
678 | 1551 |
resources isNil ifTrue:[ |
1552 |
resources := ResourcePack for:self class. |
|
1553 |
]. |
|
1554 |
||
11 | 1555 |
msg := (resources string:'ST/X Installation complete.\\') withCRs. |
1 | 1556 |
shInfo := ''. |
1557 |
cshInfo := ''. |
|
1558 |
||
1119 | 1559 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |
1560 |
||
1561 |
installWhat == #full ifTrue:[ |
|
1562 |
msg := msg , 'You will now find a development directory hierarchy |
|
678 | 1563 |
in ''' , fullDir asText allBold , '''. |
1564 |
||
1565 |
To try it, ''cd'' to ''' , fullDir , '/projects/smalltalk'' |
|
1566 |
and start smalltalk with the command: ''./smalltalk''. |
|
1567 |
||
1568 |
To perform a partial installation of your customized smalltalk later, |
|
1569 |
use the INSTALL script found in ''' , fullDir , ''''. |
|
1 | 1570 |
|
1119 | 1571 |
] ifFalse:[ |
1572 |
havePath := true. |
|
1573 |
(((OperatingSystem getEnvironment:'PATH') |
|
1574 |
asCollectionOfSubstringsSeparatedBy:$:) |
|
1575 |
includes:stxBinDir) ifFalse:[ |
|
1 | 1576 |
|
1119 | 1577 |
havePath := false. |
1578 |
shInfo := 'PATH=$PATH:' , stxBinDir , ' ; export PATH\'. |
|
1579 |
cshInfo := 'set path=($path ' , stxBinDir , ')\'. |
|
1580 |
msg := msg , (resources string:'%1 is not in your PATH.\You should change your ".login" and/or ".profile" files to include it.\\' |
|
1581 |
with:stxBinDir asText allBold) withCRs. |
|
678 | 1582 |
]. |
1 | 1583 |
|
1119 | 1584 |
(stxLibDir ~= '/usr/local/lib/smalltalk' |
1585 |
and:[stxLibDir ~= '/usr/lib/smalltalk' |
|
1586 |
and:[stxLibDir ~= ('/opt/smalltalk/' , self smalltalkRelease , '/lib')]]) ifTrue:[ |
|
1587 |
msg := msg , (resources string:'The library directory is not a standard ST/X library directory\("/opt/smalltalk/' , self smalltalkRelease , '/lib", "/usr/local/lib/smalltalk" or "/usr/lib/smalltalk"). |
|
1588 |
You may have to define the %1 environment variable\as %2 if ST/X complains about not finding its files.\' |
|
1589 |
with:'STX_LIBDIR' asText allBold |
|
1590 |
with:stxLibDir asText allBold) withCRs. |
|
1591 |
havePath ifFalse:[ |
|
1592 |
msg := msg , (resources string:'The above mentioned files are also a good place to do this.\') withCRs. |
|
1593 |
] ifTrue:[ |
|
1594 |
msg := msg , (resources string:'The ".login" and/or ".profile" files are a good place to do this.\') withCRs. |
|
1595 |
]. |
|
678 | 1596 |
|
1119 | 1597 |
shInfo := shInfo , 'STX_LIBDIR=' , stxLibDir , ' ; export STX_LIBDIR\'. |
1598 |
cshInfo := cshInfo , 'setenv STX_LIBDIR ' , stxLibDir , '\'. |
|
1599 |
]. |
|
1600 |
||
1601 |
shInfo notEmpty ifTrue:[ |
|
1602 |
'*********************************************************' errorPrintCR. |
|
1603 |
(resources string:'Message from the ST/X Installer:\\') withCRs errorPrintCR. |
|
1604 |
(resources string:'Please add the following to your ".profile" file:') withCRs errorPrintCR. |
|
1605 |
'' errorPrintCR. |
|
1606 |
shInfo withCRs errorPrintCR. |
|
1607 |
'' errorPrintCR. |
|
1608 |
(resources string:'or (if you use csh/tcsh), add to your ".login" file:') withCRs errorPrintCR. |
|
1609 |
'' errorPrintCR. |
|
1610 |
cshInfo withCRs errorPrintCR. |
|
1611 |
'' errorPrintCR. |
|
1612 |
'*********************************************************' errorPrintCR. |
|
1613 |
]. |
|
678 | 1614 |
]. |
1 | 1615 |
]. |
73 | 1616 |
msg := msg , '\\Have fun using ST/X !!'. |
1617 |
||
1618 |
self information:msg withCRs. |
|
1 | 1619 |
|
1119 | 1620 |
"Modified: / 30.4.1999 / 17:59:39 / cg" |
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1621 |
! |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1622 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1623 |
preInstall |
678 | 1624 |
"clobber the doc directory, to avoid copying cyclic symbolic links. |
1625 |
Notice, the CD does not contain symlinks, but checking for them |
|
1626 |
allows installing from a development dir." |
|
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1627 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1628 |
|f| |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1629 |
|
1119 | 1630 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |
1631 |
f := '../../doc/online/english/german' asFilename. |
|
1632 |
f exists ifTrue:[ |
|
1633 |
f isSymbolicLink ifTrue:[ |
|
1634 |
OperatingSystem executeCommand:'(cd ../../doc/online; make clobber) >/dev/null 2>/dev/null' |
|
1635 |
] |
|
25
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1636 |
] |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1637 |
] |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1638 |
|
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1639 |
" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1640 |
STXInstaller new preInstall |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1641 |
" |
42ee3e7ced09
remove local symbolic links (if any) in doc/online
Claus Gittinger <cg@exept.de>
parents:
24
diff
changeset
|
1642 |
|
1119 | 1643 |
"Modified: / 30.4.1999 / 17:54:38 / cg" |
0 | 1644 |
! ! |
1645 |
||
28 | 1646 |
!STXInstaller class methodsFor:'documentation'! |
0 | 1647 |
|
1648 |
version |
|
1649 |
^ '$Header$' |
|
1650 |
! ! |