]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
use different bat file names so multi proc systems can download more than one lib...
authorMichael Jerris <mike@jerris.com>
Mon, 28 Aug 2006 02:01:41 +0000 (02:01 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 28 Aug 2006 02:01:41 +0000 (02:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2414 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/win32/util.vbs

index b2cedcd6c711c1a364931b2bc5a2e6fcf8385c8e..2c894bbc8414d7ca89c990e3c4ab33a480c20eaa 100644 (file)
@@ -25,7 +25,7 @@ If Not IsObject(oStream)  Then
 Else\r
        UseWgetEXE=false\r
 End If\r
-\r
+Randomize\r
 Set objArgs = WScript.Arguments\r
 quote=Chr(34)\r
 ScriptDir=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))\r
@@ -91,19 +91,20 @@ Sub GetWgetEXE(DestFolder)
 End Sub\r
 \r
 Sub UnCompress(Archive, DestFolder)\r
+       batname = "tmp" & CStr(Int(10000*Rnd)) & ".bat"\r
        wscript.echo("Extracting: " & Archive)\r
-       Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+       Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
        MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Archive & quote & " -y -o" & quote & DestFolder & quote )\r
        MyFile.Close\r
-       Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+       Set oExec = WshShell.Exec(UtilsDir & batname)\r
        Do\r
                WScript.Echo OExec.StdOut.ReadLine()\r
        Loop While Not OExec.StdOut.atEndOfStream\r
        If FSO.FileExists(Left(Archive, Len(Archive)-3))Then  \r
-               Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+               Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
                MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Left(Archive, Len(Archive)-3) & quote & " -y -o" & quote & DestFolder & quote )\r
                MyFile.Close\r
-               Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+               Set oExec = WshShell.Exec(UtilsDir & batname)\r
                Do\r
                        WScript.Echo OExec.StdOut.ReadLine()\r
                Loop While Not OExec.StdOut.atEndOfStream\r
@@ -111,10 +112,10 @@ Sub UnCompress(Archive, DestFolder)
                FSO.DeleteFile Left(Archive, Len(Archive)-3) ,true \r
        End If\r
        If FSO.FileExists(Left(Archive, Len(Archive)-3) & "tar")Then  \r
-               Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+               Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
                MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Left(Archive, Len(Archive)-3) & "tar" & quote & " -y -o" & quote & DestFolder & quote )\r
                MyFile.Close\r
-               Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+               Set oExec = WshShell.Exec(UtilsDir & batname)\r
                Do\r
                        WScript.Echo OExec.StdOut.ReadLine()\r
                Loop While Not OExec.StdOut.atEndOfStream\r
@@ -123,6 +124,9 @@ Sub UnCompress(Archive, DestFolder)
        End If\r
        \r
        WScript.Sleep(500)\r
+       If FSO.FileExists(UtilsDir & batname)Then  \r
+               FSO.DeleteFile UtilsDir & batname, True\r
+       End If\r
 End Sub\r
 \r
 Sub Wget(URL, DestFolder)\r
@@ -134,11 +138,12 @@ Sub Wget(URL, DestFolder)
        Wscript.echo("Downloading: " & URL)\r
        \r
 If UseWgetEXE Then\r
-       Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+       batname = "tmp" & CStr(Int(10000*Rnd)) & ".bat"\r
+       Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
        MyFile.WriteLine("@cd " & quote & DestFolder & quote)\r
        MyFile.WriteLine("@" & quote & UtilsDir & "wget.exe" & quote & " " & URL)\r
        MyFile.Close\r
-       Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+       Set oExec = WshShell.Exec(UtilsDir & batname)\r
        Do\r
                WScript.Echo OExec.StdOut.ReadLine()\r
        Loop While Not OExec.StdOut.atEndOfStream\r