SHOW:
|
|
- or go back to the newest paste.
1 | @echo off | |
2 | setlocal | |
3 | :: | |
4 | :: config | |
5 | :: | |
6 | set url=http://go.microsoft.com/fwlink/?LinkID=121721 | |
7 | :: | |
8 | ::end config | |
9 | :: | |
10 | for %%a in (86 64) do call:init x%%a | |
11 | del /f /q log.tmp | |
12 | del /f /q sig.tmp | |
13 | GOTO:EOF | |
14 | ||
15 | :init | |
16 | ::parameters MachineType[x86|x64] | |
17 | if not exist %1 mkdir %1 | |
18 | if exist %1\mpam-fe.exe ( | |
19 | call:update %1 %~dp0%1\mpam-fe.exe | |
20 | ) else ( | |
21 | call:proc_full %1 "%url%&arch=%1" | |
22 | ) | |
23 | GOTO:EOF | |
24 | ||
25 | :update | |
26 | ::parameters MachineType[x86|x64] "filepath" | |
27 | ||
28 | ::engine version | |
29 | set _tmp=%random%.tmp | |
30 | mkdir %~dp0%_tmp% | |
31 | pushd %~dp0%_tmp% | |
32 | %~dp0%1\mpam-fe.exe -extract | |
33 | - | %~dp0sigcheck -q %~dp0%_tmp%\mpengine.dll > sig.tmp |
33 | + | sigcheck -q %~dp0%_tmp%\mpengine.dll > sig.tmp |
34 | for /f "tokens=2 delims=:- " %%a in ('findstr /C:"File version" sig.tmp') do set eng=%%a | |
35 | popd | |
36 | rmdir /q /s %~dp0%_tmp% | |
37 | :: | |
38 | ||
39 | ::mpam-fe.exe vdbVersion | |
40 | sigcheck -q %1\mpam-fe.exe > sig.tmp | |
41 | for /f "tokens=2 delims=: " %%a in ('findstr /C:"File version" sig.tmp') do call:spider %1 %%a %eng% | |
42 | GOTO:EOF | |
43 | ||
44 | :spider | |
45 | ::parameters MachineType[x86|x64] vdbVersion vEngineVersion | |
46 | wget --spider %url%^&arch=%1^&avdelta=%2^&asdelta=%2^&eng=%3 -o log.tmp | |
47 | for /f "tokens=3" %%a in ('findstr "d.exe$" log.tmp') do call:proc_delta %1 %%a | |
48 | for /f "tokens=3" %%a in ('findstr "fe.exe$" log.tmp') do call:proc_full %1 %%a | |
49 | GOTO:EOF | |
50 | ||
51 | :proc_delta | |
52 | echo dl delta | |
53 | wget -nv --no-cache -P%1 -N %2 | |
54 | GOTO:EOF | |
55 | ||
56 | :proc_full | |
57 | echo dl full | |
58 | del /f /q %1\mpam-d.exe >nul 2>nul | |
59 | wget -nv -P%1 -N %2 |