OSDN Git Service

update zh-cn translation (#1765)
[winmerge-jp/winmerge-jp.git] / DownloadDeps.cmd
1 @echo off
2 setlocal
3 set path="%ProgramFiles%\7-zip";"%ProgramFiles(x86)%\7-zip";%path%
4 7z > NUL
5 if not %ERRORLEVEL% == 0 (
6   echo 7-Zip is not installed
7   goto :eof
8 )
9 @echo on
10
11 set downloadsdir=%~dp0\build\WinMergeDownloadDeps
12 set urls_destdirs=^
13 https://github.com/WinMerge/winmerge/releases/download/winmerge_manual_another_build_tools_v2/winmerge_manual_another_build_tools_v2.zip!Docs\Manual\Tools ^
14 https://github.com/WinMerge/winmerge/releases/download/ShellExtension-1.18.7.0/ShellExtension-1.18.7.0.zip!Build ^
15 https://github.com/WinMerge/winmerge/releases/download/Merge7z2201.0/Merge7z2201.0-x86.zip!Build\x86\Release ^
16 https://github.com/WinMerge/winmerge/releases/download/Merge7z2201.0/Merge7z2201.0-x64.zip!Build\X64\Release ^
17 https://github.com/WinMerge/winmerge/releases/download/Merge7z2201.0/Merge7z2201.0-ARM.zip!Build\ARM64\Release ^
18 https://github.com/WinMerge/winmerge/releases/download/Merge7z2201.0/Merge7z2201.0-ARM64.zip!Build\ARM64\Release ^
19 https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.12-x86.zip!Build\x86\Release ^
20 https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.12-x64.zip!Build\x64\Release ^
21 https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.12-ARM.zip!Build\ARM\Release ^
22 https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.12-ARM64.zip!Build\ARM64\Release ^
23 https://github.com/WinMerge/winimerge/releases/download/v1.0.37/winimerge-1.0.37.0-x86.zip!Build\x86\Release ^
24 https://github.com/WinMerge/winimerge/releases/download/v1.0.37/winimerge-1.0.37.0-x64.zip!Build\x64\Release ^
25 https://github.com/WinMerge/winimerge/releases/download/v1.0.37/winimerge-1.0.37.0-ARM.zip!Build\ARM\Release ^
26 https://github.com/WinMerge/winimerge/releases/download/v1.0.37/winimerge-1.0.37.0-ARM64.zip!Build\ARM64\Release ^
27 https://github.com/WinMerge/winwebdiff/releases/download/v1.0.6/winwebdiff-1.0.6.0-x86.zip!Build\x86\Release ^
28 https://github.com/WinMerge/winwebdiff/releases/download/v1.0.6/winwebdiff-1.0.6.0-x64.zip!Build\x64\Release ^
29 https://github.com/WinMerge/winwebdiff/releases/download/v1.0.6/winwebdiff-1.0.6.0-ARM64.zip!Build\ARM64\Release ^
30 https://github.com/WinMerge/patch/releases/download/v2.5.9-7/patch-2.5.9-7-bin.zip!Build\GnuWin32 ^
31 https://github.com/htacg/tidy-html5/releases/download/5.4.0/tidy-5.4.0-w32-mt-XP.zip!Build\tidy-html5 ^
32 https://github.com/htacg/tidy-html5/archive/refs/tags/5.4.0.zip!Build\tidy-html5 ^
33 https://github.com/stedolan/jq/releases/download/jq-1.4/jq-win32.exe!Build\jq ^
34 https://github.com/stedolan/jq/archive/refs/tags/jq-1.4.zip!Build\jq ^
35 https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-v1.5.2-win64.zip!Build\zstd ^
36 https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-md4c-0.4.8-2-any.pkg.tar.zst!Build\md4c ^
37 http://www.magicnotes.com/steelbytes/SBAppLocale_ENG.zip!Docs\Manual\Tools
38
39 pushd "%~dp0"
40 mkdir %downloadsdir% 2> NUL
41
42 for %%p in (%urls_destdirs%) do (
43   for /F "tokens=1,2 delims=!" %%u in ("%%p") do (
44     if not exist %downloadsdir%\%%~nxu (
45       powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %%u -Outfile %downloadsdir%\%%~nxu"
46     )
47     if "%%~xu" == ".zip" (
48       7z x %downloadsdir%\%%~nxu -aoa -o%%v
49     ) else (
50       mkdir %%v > NUL
51       if "%%~xu" == ".zst" (
52         Build\zstd\zstd-v1.5.2-win64\zstd.exe -dc %downloadsdir%\%%~nxu | tar xf - -C %%v
53       ) else (
54         copy %downloadsdir%\%%~nxu %%v
55       )
56     )
57   )
58 )
59
60 for /d %%i in (build\tidy-html5\tidy-5.4.0-w32-mt-XP\*) do move %%i build\tidy-html5\
61
62 for %%i in (x86 x64 ARM ARM64) do (
63   for %%j in (Release Debug Test) do (
64     mkdir Build\%%i\%%j\Merge7z 2> NUL
65     mkdir Build\%%i\%%j\WinIMerge 2> NUL
66     mkdir Build\%%i\%%j\WinWebDiff 2> NUL
67     mkdir Build\%%i\%%j\Frhed 2> NUL
68     mkdir Build\%%i\%%j\Filters 2> NUL
69     mkdir Build\%%i\%%j\ColorSchemes 2> NUL
70     mkdir Build\%%i\%%j\MergePlugins 2> NUL
71     mkdir Build\%%i\%%j\Commands\jq 2> NUL
72     mkdir Build\%%i\%%j\Commands\tidy-html5 2> NUL
73     mkdir Build\%%i\%%j\Commands\GnuWin32 2> NUL
74     mkdir Build\%%i\%%j\Commands\md4c 2> NUL
75     xcopy /s/y Build\%%i\Release\Merge7z Build\%%i\%%j\Merge7z\
76     xcopy /s/y Build\%%i\Release\Frhed Build\%%i\%%j\Frhed\
77     copy Build\%%i\Release\WinIMerge\WinIMergeLib.dll Build\%%i\%%j\WinIMerge\
78     copy Build\%%i\Release\WinWebDiff\WinWebDiffLib.dll Build\%%i\%%j\WinWebDiff\ 2> NUL
79     xcopy /s/y Build\GnuWin32 Build\%%i\%%j\Commands\GnuWin32\
80     copy Build\jq\jq-win32.exe Build\%%i\%%j\Commands\jq\jq.exe
81     copy Build\jq\jq-jq-1.4\COPYING Build\%%i\%%j\Commands\jq\
82     copy Build\tidy-html5\bin\tidy.* Build\%%i\%%j\Commands\tidy-html5\
83     copy Build\tidy-html5\tidy-html5-5.4.0\README\LICENSE.md Build\%%i\%%j\Commands\tidy-html5\
84     copy Build\md4c\mingw32\bin\*.exe Build\%%i\%%j\Commands\md4c\
85     copy Build\md4c\mingw32\bin\*.dll Build\%%i\%%j\Commands\md4c\
86     copy Build\md4c\mingw32\share\licenses\md4c\LICENSE.md Build\%%i\%%j\Commands\md4c\
87     xcopy /s/y Plugins\Commands Build\%%i\%%j\Commands
88     xcopy /s/y Filters Build\%%i\%%j\Filters\
89     xcopy /s/y ColorSchemes Build\%%i\%%j\ColorSchemes\
90     xcopy /s/y Plugins\dlls\*.sct Build\%%i\%%j\MergePlugins\
91     xcopy /s/y Plugins\Plugins.xml Build\%%i\%%j\MergePlugins\
92     xcopy /s/y Build\ShellExtension\WinMergeContextMenuPackage.msix Build\%%i\%%j
93     copy Plugins\dlls\%%i\*.dll Build\%%i\%%j\MergePlugins\
94   )
95 )
96
97 popd