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