FS-10696: [Build-System] Update 7za to 1701 on windows.
This commit is contained in:
parent
86911858e8
commit
def7afdee6
|
@ -107,28 +107,28 @@ Sub GetCompressionTools(DestFolder)
|
||||||
tries = 0
|
tries = 0
|
||||||
max_tries = 10
|
max_tries = 10
|
||||||
If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If
|
If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If
|
||||||
If Not FSO.FileExists(DestFolder & "7za.exe") Then
|
If Not FSO.FileExists(DestFolder & "7za1701.exe") Then
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
Set MyFile = FSO.CreateTextFile(DestFolder & "7za.tag", False)
|
Set MyFile = FSO.CreateTextFile(DestFolder & "7za.tag", False)
|
||||||
If Err <> 0 Then Wscript.echo("Downloading 7za: " & DestFolder & "7za.tag - " & Err.Description) End If
|
If Err <> 0 Then Wscript.echo("Downloading 7za: " & DestFolder & "7za.tag - " & Err.Description) End If
|
||||||
On Error Goto 0
|
On Error Goto 0
|
||||||
If Not IsEmpty(MyFile) Then
|
If Not IsEmpty(MyFile) Then
|
||||||
MyFile.WriteLine("This file marks a pending download for 7za.exe so we don't download it twice at the same time")
|
MyFile.WriteLine("This file marks a pending download for 7za1701.exe so we don't download it twice at the same time")
|
||||||
MyFile.Close
|
MyFile.Close
|
||||||
Wget ToolsBase & "7za.exe", DestFolder
|
Wget ToolsBase & "7za1701.exe", DestFolder
|
||||||
FSO.DeleteFile DestFolder & "7za.tag", true
|
FSO.DeleteFile DestFolder & "7za.tag", true
|
||||||
Wscript.echo("Downloaded 7za.exe")
|
Wscript.echo("Downloaded 7za1701.exe")
|
||||||
End If
|
End If
|
||||||
Set MyFile = Nothing
|
Set MyFile = Nothing
|
||||||
WScript.Sleep(500)
|
WScript.Sleep(500)
|
||||||
End If
|
End If
|
||||||
Do While FSO.FileExists(DestFolder & "7za.tag") And tries < max_tries
|
Do While FSO.FileExists(DestFolder & "7za.tag") And tries < max_tries
|
||||||
Wscript.echo("Waiting for 7za.exe to be downloaded")
|
Wscript.echo("Waiting for 7za1701.exe to be downloaded")
|
||||||
WScript.Sleep(1000)
|
WScript.Sleep(1000)
|
||||||
tries = tries + 1
|
tries = tries + 1
|
||||||
Loop
|
Loop
|
||||||
If tries = max_tries Then
|
If tries = max_tries Then
|
||||||
Wscript.echo("ERROR: Download of 7za.exe takes too much time")
|
Wscript.echo("ERROR: Download of 7za1701.exe takes too much time")
|
||||||
Wscript.quit 99
|
Wscript.quit 99
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
@ -189,15 +189,15 @@ Sub UnCompress(Archive, DestFolder)
|
||||||
batname = "tmp" & Strip(Archive) & CStr(Int(10000*Rnd)) & ".bat"
|
batname = "tmp" & Strip(Archive) & CStr(Int(10000*Rnd)) & ".bat"
|
||||||
wscript.echo("Extracting: " & Archive & " - using: " & batname)
|
wscript.echo("Extracting: " & Archive & " - using: " & batname)
|
||||||
Set MyFile = FSO.CreateTextFile(UtilsDir & batname, True)
|
Set MyFile = FSO.CreateTextFile(UtilsDir & batname, True)
|
||||||
MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Archive & quote & " -y -o" & quote & DestFolder & quote )
|
MyFile.WriteLine("@" & quote & UtilsDir & "7za1701.exe" & quote & " x " & quote & Archive & quote & " -y -o" & quote & DestFolder & quote )
|
||||||
MyFile.Close
|
MyFile.Close
|
||||||
Set MyFile = Nothing
|
Set MyFile = Nothing
|
||||||
ExecPrintOutput(UtilsDir & batname)
|
ExecPrintOutput(UtilsDir & batname)
|
||||||
wscript.echo("Ready extracting: " & Archive)
|
wscript.echo("Ready extracting: " & Archive)
|
||||||
Fn = Left(Archive, Len(Archive)-3)
|
Fn = fso.GetParentFolderName(Archive) & "\" & FSO.getbasename(Archive)
|
||||||
If FSO.FileExists(Fn) Then
|
If FSO.FileExists(Fn) Then
|
||||||
Set MyFile = FSO.CreateTextFile(UtilsDir & batname, True)
|
Set MyFile = FSO.CreateTextFile(UtilsDir & batname, True)
|
||||||
MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Fn & quote & " -y -o" & quote & DestFolder & quote )
|
MyFile.WriteLine("@" & quote & UtilsDir & "7za1701.exe" & quote & " x " & quote & Fn & quote & " -y -o" & quote & DestFolder & quote )
|
||||||
MyFile.Close
|
MyFile.Close
|
||||||
Set MyFile = Nothing
|
Set MyFile = Nothing
|
||||||
ExecPrintOutput(UtilsDir & batname)
|
ExecPrintOutput(UtilsDir & batname)
|
||||||
|
@ -205,10 +205,9 @@ Sub UnCompress(Archive, DestFolder)
|
||||||
wscript.echo("Deleting: " & Fn)
|
wscript.echo("Deleting: " & Fn)
|
||||||
FSO.DeleteFile Fn,true
|
FSO.DeleteFile Fn,true
|
||||||
End If
|
End If
|
||||||
Fn = Fn & tar
|
|
||||||
If FSO.FileExists(Fn) Then
|
If FSO.FileExists(Fn) Then
|
||||||
Set MyFile = FSO.CreateTextFile(UtilsDir & batname, True)
|
Set MyFile = FSO.CreateTextFile(UtilsDir & batname, True)
|
||||||
MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Fn & quote & " -y -o" & quote & DestFolder & quote )
|
MyFile.WriteLine("@" & quote & UtilsDir & "7za1701.exe" & quote & " x " & quote & Fn & quote & " -y -o" & quote & DestFolder & quote )
|
||||||
MyFile.Close
|
MyFile.Close
|
||||||
Set MyFile = Nothing
|
Set MyFile = Nothing
|
||||||
ExecPrintOutput(UtilsDir & batname)
|
ExecPrintOutput(UtilsDir & batname)
|
||||||
|
|
Loading…
Reference in New Issue