full installation under win32 (there is no tar )
authorClaus Gittinger <cg@exept.de>
Fri, 26 Oct 2001 15:53:48 +0200
changeset 1512 aa8927693ebf
parent 1511 f62b52f0bb20
child 1513 236f5bfbaa05
full installation under win32 (there is no tar )
STXInstaller.st
--- a/STXInstaller.st	Fri Oct 26 13:56:51 2001 +0200
+++ b/STXInstaller.st	Fri Oct 26 15:53:48 2001 +0200
@@ -441,20 +441,25 @@
         actionTextHolder value:nil.
         actionTextHolder value:msg.
 
-        cmd := '(cd ' , topDir , ' ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'.
-"/        "/
-"/        "/ not all systems have cp -rv
-"/        "/
-"/        OperatingSystem getOSType = 'linux' ifTrue:[
-"/            cmd := 'cp -rv ../../* ' , fullDir.
-"/        ].
-"/      commandTraceView showCR:cmd , ' ...'.
-        commandTraceView showCR:'copying ...'.
-        commandTraceView endEntry.
-        cmd := cmd , ' 2>&1' .
+        actionPercentageHolder value:-1.
+        OperatingSystem isUNIXlike ifTrue:[
+            cmd := '(cd ' , topDir , ' ; tar cf - .) | (cd ' , fullDir , ' ; tar xvf -)'.
+            commandTraceView showCR:'copying ...'.
+            commandTraceView endEntry.
+            cmd := cmd , ' 2>&1' .
 
-        self executeCommandAndShowOutput:cmd emphasize:false.
+            self executeCommandAndShowOutput:cmd emphasize:false.
+        ] ifFalse:[
+            self halt.
 
+            fullDir asFilename exists ifFalse:[
+                commandTraceView showCR:(resources string:'creating %1 ...' with:fullDir asFilename pathName).
+                commandTraceView endEntry.
+                OperatingSystem recursiveCreateDirectory:fullDir asFilename pathName
+            ].
+            self recursiveCopy:(topDir , '\*') to:fullDir.
+        ].
+        actionPercentageHolder value:100.
         ^ true
     ].
 
@@ -1461,12 +1466,15 @@
 
                 (OperatingSystem recursiveRemoveDirectory:whichDir)
                 ifFalse:[
-                    self warn:(resources string:'mhmh - could not remove old installation.
+                    OperatingSystem removeDirectory:whichDir.
+                    whichDir asFilename exists ifTrue:[
+                        self warn:(resources string:'mhmh - could not remove old installation.
 
 Please remove it manually (using administrator privileges if required) 
 and try again.').
-                    box destroy.
-                    ^ false
+                        box destroy.
+                        ^ false
+                    ]
                 ].
 
                 box destroy