2016-09-06 15:31:41 -04:00
|
|
|
setlocal
|
|
|
|
|
|
|
|
if "%EnvRootPath%"=="" exit /B 1
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
set CEchoUrl=https://github.com/lordmulder/cecho/releases/download/2015-10-10/cecho.2015-10-10.zip
|
|
|
|
set CEchoInstall=cecho.2015-10-10.zip
|
2020-07-29 12:11:53 -04:00
|
|
|
set SevenZipUrl=https://sourceforge.net/projects/sevenzip/files/7-Zip/19.00/7z1900.msi/download
|
|
|
|
set SevenZipInstall=7z1900.msi
|
2016-09-06 15:31:41 -04:00
|
|
|
set DependsUrl=http://www.dependencywalker.com/depends22_x86.zip
|
|
|
|
set DependsInstall=depends22_x86.zip
|
|
|
|
set UnixToolsUrl=http://unxutils.sourceforge.net/UnxUpdates.zip
|
|
|
|
set UnixToolsInstall=UnxUpdates.zip
|
2020-07-30 20:25:12 -04:00
|
|
|
set NSISInstall=nsis-3.05-setup.exe
|
|
|
|
set NSISUrl=http://prdownloads.sourceforge.net/nsis/%NSISInstall%?download
|
2016-09-06 15:31:41 -04:00
|
|
|
set NSISInstallPath=%EnvToolsPath%\NSIS
|
2020-07-29 12:11:53 -04:00
|
|
|
set MinGitInstall=MinGit-2.28.0-32-bit.zip
|
|
|
|
set MinGitUrl=https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/%MinGitInstall%
|
2018-10-13 07:19:22 -04:00
|
|
|
set MinGitInstallPath=%EnvToolsPath%\MinGit
|
2017-02-27 02:16:48 -05:00
|
|
|
set CMakeVersion=cmake-3.1.0-win32-x86
|
|
|
|
set CMakeInstall=%CMakeVersion%.zip
|
|
|
|
set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall%
|
|
|
|
set CMakeInstallPath=%EnvToolsPath%\cmake
|
2020-08-08 09:05:05 -04:00
|
|
|
set TorProjectUrl=https://www.torproject.org
|
|
|
|
set TorDownloadIndexUrl=%TorProjectUrl%/download/tor
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
if not exist "%EnvToolsPath%\7z.exe" (
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
|
|
|
echo Download 7z installation
|
|
|
|
|
2018-05-07 00:42:52 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%SevenZipInstall%" call "%ToolsPath%\download-file.bat" "%SevenZipUrl%" "%EnvDownloadPath%\%SevenZipInstall%"
|
2016-09-06 15:31:41 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%SevenZipInstall%" echo Cannot download 7z installation& goto error
|
|
|
|
|
|
|
|
echo Unpack 7z
|
|
|
|
msiexec /a "%EnvDownloadPath%\%SevenZipInstall%" /qb TARGETDIR="%EnvTempPath%"
|
|
|
|
copy "%EnvTempPath%\Files\7-Zip\7z.dll" "%EnvToolsPath%"
|
|
|
|
copy "%EnvTempPath%\Files\7-Zip\7z.exe" "%EnvToolsPath%"
|
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
if not exist "%EnvToolsPath%\cecho.exe" (
|
2016-09-06 15:31:41 -04:00
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
echo Download cecho installation
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2018-06-17 11:51:58 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%CEchoInstall%" call "%ToolsPath%\download-file.bat" "%CEchoUrl%" "%EnvDownloadPath%\%CEchoInstall%"
|
2016-11-03 03:32:15 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%cCEhoInstall%" echo Cannot download cecho installation& goto error
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
echo Unpack cecho
|
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%"
|
|
|
|
copy "%EnvTempPath%\cecho.exe" "%EnvToolsPath%"
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
|
|
|
if not exist "%EnvToolsPath%\depends.exe" (
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Download Dependency Walker installation"
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2020-08-03 12:14:32 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%DependsInstall%" call "%ToolsPath%\download-file.bat" %DependsUrl% "%EnvDownloadPath%\%DependsInstall%"
|
2016-11-03 03:32:15 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%DependsInstall%" %cecho% error "Cannot download Dependendy Walker installation" & goto error
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Unpack Dependency Walker"
|
2016-09-06 15:31:41 -04:00
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%DependsInstall%"
|
|
|
|
copy "%EnvTempPath%\*" "%EnvToolsPath%"
|
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
|
|
|
if not exist "%EnvToolsPath%\cut.exe" (
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Download Unix Tools installation"
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2020-08-03 12:14:32 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\download-file.bat" %UnixToolsUrl% "%EnvDownloadPath%\%UnixToolsInstall%"
|
2018-03-04 14:08:15 -05:00
|
|
|
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error "Cannot download Unix Tools installation" & goto error
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Unpack Unix Tools"
|
2016-09-06 15:31:41 -04:00
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%"
|
|
|
|
copy "%EnvTempPath%\cut.exe" "%EnvToolsPath%"
|
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
|
|
|
if not exist "%EnvToolsPath%\sed.exe" (
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Download Unix Tools installation"
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2020-08-03 12:14:32 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\download-file.bat" %UnixToolsUrl% "%EnvDownloadPath%\%UnixToolsInstall%"
|
2018-03-04 14:08:15 -05:00
|
|
|
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error "Cannot download Unix Tools installation" & goto error
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Unpack Unix Tools"
|
2016-09-06 15:31:41 -04:00
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%"
|
|
|
|
copy "%EnvTempPath%\sed.exe" "%EnvToolsPath%"
|
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
2020-07-30 20:25:12 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%NSISInstall%" call "%ToolsPath%\remove-dir.bat" "%NSISInstallPath%"
|
2018-10-13 07:19:22 -04:00
|
|
|
if not exist "%NSISInstallPath%\nsis.exe" (
|
2016-09-06 15:31:41 -04:00
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
2020-07-30 20:25:12 -04:00
|
|
|
|
|
|
|
if exist "%NSISInstallPath%" call "%ToolsPath%\remove-dir.bat" "%NSISInstallPath%"
|
|
|
|
|
2016-09-06 15:31:41 -04:00
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Download NSIS installation"
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
if not exist "%EnvDownloadPath%\%NSISInstall%" call "%ToolsPath%\download-file.bat" "%NSISUrl%" "%EnvDownloadPath%\%NSISInstall%"
|
|
|
|
if not exist "%EnvDownloadPath%\%NSISInstall%" %cecho% error "Cannot download NSIS installation" & goto error
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
%cecho% info "Unpack NSIS"
|
2016-09-06 15:31:41 -04:00
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%NSISInstall%"
|
|
|
|
if not exist "%NSISInstallPath%" mkdir "%NSISInstallPath%"
|
|
|
|
xcopy /s "%EnvTempPath%" "%NSISInstallPath%"
|
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
2018-10-13 07:19:22 -04:00
|
|
|
if not exist "%MinGitInstallPath%\cmd\git.exe" (
|
|
|
|
%cecho% info "Download MinGit installation"
|
|
|
|
|
|
|
|
if not exist "%EnvDownloadPath%\%MinGitInstall%" call "%ToolsPath%\download-file.bat" "%MinGitUrl%" "%EnvDownloadPath%\%MinGitInstall%"
|
|
|
|
if not exist "%EnvDownloadPath%\%MinGitInstall%" %cecho% error "Cannot download MinGit installation" & goto error
|
|
|
|
|
|
|
|
%cecho% info "Unpack MinGit"
|
|
|
|
"%EnvSevenZipExe%" x -o"%MinGitInstallPath%" "%EnvDownloadPath%\%MinGitInstall%"
|
|
|
|
)
|
|
|
|
|
2017-02-27 02:16:48 -05:00
|
|
|
if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\remove-dir.bat" "%CMakeInstallPath%"
|
|
|
|
if not exist "%CMakeInstallPath%\bin\cmake.exe" (
|
|
|
|
%cecho% info "Download CMake installation"
|
|
|
|
|
|
|
|
if exist "%CMakeInstallPath%" call "%ToolsPath%\remove-dir.bat" "%CMakeInstallPath%"
|
|
|
|
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
|
|
|
|
if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.bat" "%CMakeUrl%" "%EnvDownloadPath%\%CMakeInstall%"
|
|
|
|
if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake installation" & goto error
|
|
|
|
|
|
|
|
%cecho% info "Unpack CMake"
|
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CMakeInstall%"
|
|
|
|
|
|
|
|
move "%EnvTempPath%\%CMakeVersion%" "%CMakeInstallPath%"
|
|
|
|
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
)
|
|
|
|
|
2020-08-08 09:05:05 -04:00
|
|
|
rem Tor
|
|
|
|
rem Get download link and filename from download page
|
|
|
|
mkdir "%EnvTempPath%"
|
|
|
|
call "%ToolsPath%\download-file.bat" "%TorDownloadIndexUrl%" "%EnvTempPath%\index.html"
|
|
|
|
if not exist "%EnvTempPath%\index.html" %cecho% error "Cannot download Tor installation" & goto error
|
|
|
|
|
|
|
|
for /F "tokens=1,2 delims= " %%A in ('%EnvSedExe% -r -n -e"s/.*href=\"^(.*^)^(tor-win32.*\.zip^)\".*/\2 \1\2/p" "%EnvTempPath%\index.html"') do set TorInstall=%%A& set TorDownloadUrl=%TorProjectUrl%%%B
|
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
|
|
|
if "%TorInstall%"=="" %cecho% error "Cannot download Tor installation" & goto error
|
|
|
|
if "%TorDownloadUrl%"=="" %cecho% error "Cannot download Tor installation" & goto error
|
|
|
|
|
|
|
|
if not exist "%EnvDownloadPath%\%TorInstall%" call "%ToolsPath%\remove-dir.bat" "%EnvTorPath%"
|
|
|
|
if not exist "%EnvTorPath%\Tor\tor.exe" (
|
|
|
|
%cecho% info "Download Tor installation"
|
|
|
|
|
|
|
|
if not exist "%EnvDownloadPath%\%TorInstall%" call "%ToolsPath%\download-file.bat" "%TorDownloadUrl%" "%EnvDownloadPath%\%TorInstall%"
|
|
|
|
if not exist "%EnvDownloadPath%\%TorInstall%" %cecho% error "Cannot download Tor installation" & goto error
|
|
|
|
|
|
|
|
%cecho% info "Unpack Tor"
|
|
|
|
"%EnvSevenZipExe%" x -o"%EnvTorPath%" "%EnvDownloadPath%\%TorInstall%"
|
|
|
|
)
|
|
|
|
|
2016-09-06 15:31:41 -04:00
|
|
|
:exit
|
|
|
|
endlocal
|
|
|
|
exit /B 0
|
|
|
|
|
|
|
|
:error
|
2020-08-08 09:05:05 -04:00
|
|
|
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
2016-09-06 15:31:41 -04:00
|
|
|
endlocal
|
|
|
|
exit /B 1
|