STXInstaller.st
changeset 1512 aa8927693ebf
parent 1511 f62b52f0bb20
child 1513 236f5bfbaa05
equal deleted inserted replaced
1511:f62b52f0bb20 1512:aa8927693ebf
   439         msg at:4 put:('    all from CD' asText allBold).
   439         msg at:4 put:('    all from CD' asText allBold).
   440         msg at:6 put:'    ' , (fullDir asText allBold).
   440         msg at:6 put:'    ' , (fullDir asText allBold).
   441         actionTextHolder value:nil.
   441         actionTextHolder value:nil.
   442         actionTextHolder value:msg.
   442         actionTextHolder value:msg.
   443 
   443 
   444         cmd := '(cd ' , topDir , ' ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'.
   444         actionPercentageHolder value:-1.
   445 "/        "/
   445         OperatingSystem isUNIXlike ifTrue:[
   446 "/        "/ not all systems have cp -rv
   446             cmd := '(cd ' , topDir , ' ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'.
   447 "/        "/
   447             commandTraceView showCR:'copying ...'.
   448 "/        OperatingSystem getOSType = 'linux' ifTrue:[
   448             commandTraceView endEntry.
   449 "/            cmd := 'cp -rv ../../* ' , fullDir.
   449             cmd := cmd , ' 2>&1' .
   450 "/        ].
   450 
   451 "/      commandTraceView showCR:cmd , ' ...'.
   451             self executeCommandAndShowOutput:cmd emphasize:false.
   452         commandTraceView showCR:'copying ...'.
   452         ] ifFalse:[
   453         commandTraceView endEntry.
   453             self halt.
   454         cmd := cmd , ' 2>&1' .
   454 
   455 
   455             fullDir asFilename exists ifFalse:[
   456         self executeCommandAndShowOutput:cmd emphasize:false.
   456                 commandTraceView showCR:(resources string:'creating %1 ...' with:fullDir asFilename pathName).
   457 
   457                 commandTraceView endEntry.
       
   458                 OperatingSystem recursiveCreateDirectory:fullDir asFilename pathName
       
   459             ].
       
   460             self recursiveCopy:(topDir , '\*') to:fullDir.
       
   461         ].
       
   462         actionPercentageHolder value:100.
   458         ^ true
   463         ^ true
   459     ].
   464     ].
   460 
   465 
   461     fileSpec := self specOfFilesToCopy asOrderedCollection.
   466     fileSpec := self specOfFilesToCopy asOrderedCollection.
   462 
   467 
  1459                 ] forkAt:(Processor activePriority+1).
  1464                 ] forkAt:(Processor activePriority+1).
  1460                 box waitUntilVisible.
  1465                 box waitUntilVisible.
  1461 
  1466 
  1462                 (OperatingSystem recursiveRemoveDirectory:whichDir)
  1467                 (OperatingSystem recursiveRemoveDirectory:whichDir)
  1463                 ifFalse:[
  1468                 ifFalse:[
  1464                     self warn:(resources string:'mhmh - could not remove old installation.
  1469                     OperatingSystem removeDirectory:whichDir.
       
  1470                     whichDir asFilename exists ifTrue:[
       
  1471                         self warn:(resources string:'mhmh - could not remove old installation.
  1465 
  1472 
  1466 Please remove it manually (using administrator privileges if required) 
  1473 Please remove it manually (using administrator privileges if required) 
  1467 and try again.').
  1474 and try again.').
  1468                     box destroy.
  1475                         box destroy.
  1469                     ^ false
  1476                         ^ false
       
  1477                     ]
  1470                 ].
  1478                 ].
  1471 
  1479 
  1472                 box destroy
  1480                 box destroy
  1473             ].
  1481             ].
  1474     ].
  1482     ].