Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
|
@ -0,0 +1,18 @@
|
|||
param([String]$filename="", [Int32]$filesize=0, [String]$hashvalue="", [String]$hashname="SHA512")
|
||||
Function Get-FileHashWin7([String] $FileName, $HashName) {
|
||||
$FileStream = New-Object System.IO.FileStream($FileName,[System.IO.FileMode]::Open)
|
||||
$StringBuilder = New-Object System.Text.StringBuilder
|
||||
[System.Security.Cryptography.HashAlgorithm]::Create($HashName).ComputeHash($FileStream)|%{[Void]$StringBuilder.Append($_.ToString("x2"))}
|
||||
$FileStream.Close()
|
||||
$StringBuilder.ToString()
|
||||
}
|
||||
Write-Output "Verify " $filename
|
||||
if ((Get-Item $filename).length -ne $filesize) {
|
||||
Write-Output "Failed " $filename
|
||||
exit 1
|
||||
}
|
||||
if ((Get-FileHashWin7 $filename $hashname) -ne $hashvalue) {
|
||||
Write-Output "Failed " $filename
|
||||
exit 1
|
||||
}
|
||||
exit 0
|
|
@ -0,0 +1,17 @@
|
|||
rem bDOWNLOAD bAUTO URL FILE HASH SIZE
|
||||
echo URL %3
|
||||
if "%1" == "yes" (
|
||||
if "%2" == "xauto" (
|
||||
echo Check %3 ...
|
||||
if exist "%~4" (
|
||||
powershell -ExecutionPolicy Unrestricted .\build\scriptlib\Verify-File.ps1 -hashvalue %5 -filesize %6 -filename %4 || del /Q "%4"
|
||||
)
|
||||
)
|
||||
if not exist "%~4" (
|
||||
echo Download %3 ...
|
||||
powershell -Command "(New-Object Net.WebClient).DownloadFile('%~3', '%~4')" || exit /B 1
|
||||
)
|
||||
)
|
||||
echo Verify %4 ...
|
||||
powershell -ExecutionPolicy Unrestricted .\build\scriptlib\Verify-File.ps1 -hashvalue %5 -filesize %6 -filename %4 || exit /B 1
|
||||
exit /B 0
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
On Error Resume Next
|
||||
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Sub UnZIP(zipfilename, destinationfolder)
|
||||
With CreateObject("Shell.Application")
|
||||
.NameSpace(destinationfolder).Copyhere .NameSpace(zipfilename).Items
|
||||
End With
|
||||
End Sub
|
||||
|
||||
zipfile = WScript.Arguments(0)
|
||||
If Err.Number <> 0 Then
|
||||
WSCript.Quit 1
|
||||
End If
|
||||
|
||||
outdir = WScript.Arguments(1)
|
||||
If Err.Number <> 0 Then
|
||||
WSCript.Quit 1
|
||||
End If
|
||||
|
||||
WScript.Echo zipfile
|
||||
WScript.Echo outdir
|
||||
|
||||
If fso.FolderExists(fso.GetAbsolutePathName(outdir)) Then
|
||||
fso.DeleteFolder fso.GetAbsolutePathName(outdir)
|
||||
End If
|
||||
|
||||
fso.CreateFolder fso.GetAbsolutePathName(outdir)
|
||||
If Err.Number <> 0 Then
|
||||
WSCript.Quit 1
|
||||
End If
|
||||
|
||||
UnZIP fso.GetAbsolutePathName(zipfile), fso.GetAbsolutePathName(outdir)
|
||||
If Err.Number <> 0 Then
|
||||
WSCript.Quit 1
|
||||
End If
|
|
@ -0,0 +1,16 @@
|
|||
set MPT_GET_DESTDIR="%~1"
|
||||
set MPT_GET_FILE="%~2"
|
||||
set MPT_GET_SUBDIR="%~3"
|
||||
echo %MPT_GET_DESTDIR%
|
||||
if exist %MPT_GET_DESTDIR% rmdir /S /Q %MPT_GET_DESTDIR%
|
||||
if "%~3" == "." (
|
||||
build\tools\7zip\7z.exe x -y -o%MPT_GET_DESTDIR% "%~2" || exit /B 1
|
||||
)
|
||||
if not "%~3" == "." (
|
||||
if exist "%~1.tmp" rmdir /S /Q "%~1.tmp"
|
||||
build\tools\7zip\7z.exe x -y -o"%~1.tmp" -ir!"%~3" "%~2" || exit /B 1
|
||||
choice /C y /N /T 1 /D y
|
||||
move /Y "%~1.tmp\%~3" %MPT_GET_DESTDIR% || exit /B 1
|
||||
rmdir /S /Q "%~1.tmp"
|
||||
)
|
||||
exit /B 0
|
Loading…
Add table
Add a link
Reference in a new issue