Commit aecf9d11 authored by maruel@chromium.org's avatar maruel@chromium.org

Change the windows bootstrap code to download zips in %TEMP%.

It may help when the directory is created at high integrity level.
This hypothesis is unconfirmed.

TBR=iannucci@chromium.org
BUG=241769,314257

Review URL: https://codereview.chromium.org/72803002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@235149 0039d316-1c4b-4281-b951-d872f2087c98
parent 411b7b0d
......@@ -11,6 +11,9 @@
set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
set GIT_BIN_DIR=git-1.8.0_bin
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%
:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
......@@ -42,17 +45,17 @@ rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:GIT_INSTALL
echo Installing git (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%~dp0git.zip" del "%~dp0git.zip"
if exist "%ZIP_DIR%\git.zip" del "%ZIP_DIR%\git.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%~dp0git.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%ZIP_DIR%\git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%~dp0git.zip"
del "%ZIP_DIR%\git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
......@@ -85,18 +88,18 @@ goto :PYTHON_CHECK
:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
if exist "%ZIP_DIR%\svn.zip" del "%ZIP_DIR%\svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%ZIP_DIR%\svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR%"
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%~dp0svn.zip"
del "%ZIP_DIR%\svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
......@@ -135,15 +138,16 @@ goto :END
echo Installing python 2.7.5...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python275_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python275_bin"
if exist "%~dp0python275.zip" del "%~dp0python275.zip"
if exist "%ZIP_DIR%\python275.zip" del "%ZIP_DIR%\python275.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip "%~dp0python275_bin.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip "%ZIP_DIR%\python275_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python275_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0python275_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python275_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python275.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python275_bin.zip"
set ERRORLEVEL=0
goto :END
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment