:: Limitations
:: - Does not support exclamation marks due to delayed expansion
:: http://stackoverflow.com/a/21736349/891976

@echo on
setlocal enabledelayedexpansion
setlocal
echo Inside
set "a=hi@%%$<>()[]|*~';,./?:{}+_-=\/ & bye"
set "b=2"
set "c=^^no ^& """g"o"
set "d=hello^!"
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
call :return a c d e
set return
pause
endlocal %return%
echo Outside
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
echo(z=!z!
endlocal
exit /b 0

:return [Variables...]
setlocal enabledelayedexpansion
set "z=9"
set "return="
:_return
if "%~1"=="" endlocal & exit /b 1
if not defined %~1 goto __return
set "_=!%~1!"
setlocal disabledelayedexpansion
set "_=%_:"=""%"
set "_=%_:^=^^%"
set "_=%_:<=^<%"
set "_=%_:>=^>%"
set "_=%_:&=^&%"
set "_=%_:|=^|%"
set "_=%_:!=^!%"
endlocal & set "return=!return!^&set ""%~1=%_%"""
:__return
if not "%~2"=="" shift & goto _return
set return
endlocal & set "return=%return:""="%"
exit /b 0

:: http://stackoverflow.com/a/21736349/891976

@echo on
setlocal enabledelayedexpansion
setlocal
echo Inside
set "a=hi@%%$<>()[]|*~';,./?:{}+_-=\/ & bye"
set "b=2"
set "c=^^no ^& """g"o"
set "d=hello^!"
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
call :return a c d e
set return
pause
endlocal %return%
echo Outside
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
echo(z=!z!
endlocal
exit /b 0

:return [Variables...]
setlocal enabledelayedexpansion
set "z=9"
set "return="
:_return
if "%~1"=="" endlocal & exit /b 1
if not defined %~1 goto __return
set "%~1=!%~1:"=""!"
set "%~1=!%~1:^=^^!"
set "%~1=!%~1:<=^<!"
set "%~1=!%~1:>=^>!"
set "%~1=!%~1:&=^&!"
set "%~1=!%~1:|=^|!"
set "return=!return!^&set ""%~1=!%~1!"""
:__return
if not "%~2"=="" shift & goto _return
set return
setlocal disabledelayedexpansion
set "return=%return:!=^^^^^^^!%"
endlocal & endlocal & set "return=%return:""="%"
exit /b 0

Update SO21736349891976.bat

Update SO21736349891976.bat

Added support for the ! special character.  Now supports all batch special characters.


mkdir build
mkdir 3rdParty/build
Robocopy "./tools/googletest/googlemock" "./tools/protobuf/gmock" /E /MT:2 /R:0 /DCOPY:T
Robocopy "./tools/googletest/googletest" "./tools/protobuf/gmock/gtest" /E /MT:2 /R:0 /DCOPY:T
IF %ERRORLEVEL% LSS 8 goto build
goto :eof

:build
exit 0

mkdir build
mkdir 3rdParty\build
Robocopy "./tools/googletest/googlemock" "./tools/protobuf/gmock" /E /MT:2 /R:0 /DCOPY:T
Robocopy "./tools/googletest/googletest" "./tools/protobuf/gmock/gtest" /E /MT:2 /R:0 /DCOPY:T
IF %ERRORLEVEL% LSS 8 goto build
goto :eof

:build
exit 0

Update msvc_install.bat

Update msvc_install.bat


@echo off
REM /!\ THIS SCRIPT SUPPOSE A FIXED PATH FOR PYTHON /!\
REM Each blocks could be triggered independently (i.e. commenting others)
REM run it as:
REM set PATH=%PATH%;tools;tools\win
REM cmd /c tools\release\build_delivery_win.cmd

REM Check all prerequisite
set PATH=%PATH%;tools;tools\win

if "%ORTOOLS_TOKEN%" == "" (
  echo ORTOOLS_TOKEN: NOT FOUND | tee.exe build.log
  exit 1
)

REM Print version
make.exe print-OR_TOOLS_VERSION | tee.exe build.log

REM clean everything
echo clean everything... | tee.exe -a build.log
make.exe clean_third_party || exit 1
make.exe clean || exit 1

which.exe cmake || exit 1
which.exe cmake | tee.exe -a build.log
REM Python
which.exe C:\python36-64\python.exe || exit 1
echo C:\python36-64\python.exe: FOUND | tee.exe -a build.log
C:\python36-64\python.exe -m pip install --user absl-py mypy-protobuf

which.exe C:\python37-64\python.exe || exit 1
echo C:\python37-64\python.exe: FOUND | tee.exe -a build.log
C:\python37-64\python.exe -m pip install --user absl-py mypy-protobuf

which.exe C:\python38-64\python.exe || exit 1
echo C:\python38-64\python.exe: FOUND | tee.exe -a build.log
C:\python38-64\python.exe -m pip install --user absl-py mypy-protobuf

which.exe C:\python39-64\python.exe || exit 1
echo C:\python39-64\python.exe: FOUND | tee.exe -a build.log
C:\python39-64\python.exe -m pip install --user absl-py mypy-protobuf

REM Java
echo JAVA_HOME: %JAVA_HOME% | tee.exe -a build.log
which.exe java || exit 1
which.exe java | tee.exe -a build.log
which.exe mvn || exit 1
which.exe mvn | tee.exe -a build.log

which.exe gpg || exit 1
which.exe gpg | tee.exe -a build.log
which.exe openssl || exit 1
which.exe openssl | tee.exe -a build.log

REM .Net
which.exe dotnet || exit 1
which.exe dotnet | tee.exe -a build.log

REM ###############################
REM ##  Build Examples Archives  ##
REM ###############################
rm.exe -rf temp *.zip || exit 1
echo Build examples archives... | tee.exe -a build.log
echo   C++ examples archive... | tee.exe -a build.log
make.exe cc_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo   Python examples archive... | tee.exe -a build.log
make.exe python_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo   Java examples archive... | tee.exe -a build.log
make.exe java_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo   .Net examples archive... | tee.exe -a build.log
make.exe dotnet_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo DONE | tee.exe -a build.log

REM ###################
REM ##  THIRD PARTY  ##
REM ###################
echo make third_party: ... | tee.exe -a build.log
make.exe third_party WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make third_party: DONE | tee.exe -a build.log

REM ########################
REM ##  Install Java gpg  ##
REM ########################
echo Install Java gpg | tee.exe -a build.log
openssl aes-256-cbc -iter 42 -pass pass:%ORTOOLS_TOKEN% -in tools\release\private-key.gpg.enc -out private-key.gpg -d
gpg --batch --import private-key.gpg
del private-key.gpg
mkdir -p %userprofile%/.m2
openssl aes-256-cbc -iter 42 -pass pass:%ORTOOLS_TOKEN% -in tools\release\settings.xml.enc -out %userprofile%/.m2/settings.xml -d
echo "DONE" | tee -a build.log

REM ########################
REM ##  Install .Net snk  ##
REM ########################
echo Install .Net snk | tee.exe -a build.log
openssl aes-256-cbc -iter 42 -pass pass:%ORTOOLS_TOKEN% -in tools\release\or-tools.snk.enc -out or-tools.snk -d
set DOTNET_SNK=or-tools.snk

REM ####################
REM ##  CC/JAVA/.Net  ##
REM ####################
echo make cc: ... | tee.exe -a build.log
make.exe cc WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make cc: DONE | tee.exe -a build.log
REM make.exe test_cc WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_cc: DONE | tee.exe -a build.log

echo make fz: ... | tee.exe -a build.log
make.exe fz WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make fz: DONE | tee.exe -a build.log

echo make java: ... | tee.exe -a build.log
make.exe java WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make java: DONE | tee.exe -a build.log
REM make.exe test_java WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_java: DONE | tee.exe -a build.log

echo make dotnet: ... | tee.exe -a build.log
make.exe dotnet WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make dotnet: DONE | tee.exe -a build.log
REM make.exe test_dotnet WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_dotnet: DONE | tee.exe -a build.log

REM Create Archive
make.exe archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make archive: DONE | tee.exe -a build.log
make.exe test_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make test_archive: DONE | tee.exe -a build.log
make.exe fz_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make fz_archive: DONE | tee.exe -a build.log
make.exe test_fz_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make test_fz_archive: DONE | tee.exe -a build.log

REM ##################
REM ##  PYTHON 3.6  ##
REM ##################
echo Cleaning Python... | tee.exe -a build.log
make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python36-64
echo Cleaning Python...DONE | tee.exe -a build.log

REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1
REM echo make python3.6: DONE | tee.exe -a build.log
REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1
REM echo make test_python3.6: DONE | tee.exe -a build.log
echo Rebuild Python3.6 pypi archive... | tee.exe -a build.log
make.exe package_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1
echo Rebuild Python3.6 pypi archive...DONE | tee.exe -a build.log
echo Test Python3.6 pypi archive... | tee.exe -a build.log
make.exe test_package_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1
echo Test Python3.6 pypi archive...DONE | tee.exe -a build.log

set TEMP_DIR=temp_python36
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .

REM ##################
REM ##  PYTHON 3.7  ##
REM ##################
echo Cleaning Python... | tee.exe -a build.log
make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python37-64
echo Cleaning Python...DONE | tee.exe -a build.log

REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1
REM echo make python3.7: DONE | tee.exe -a build.log
REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1
REM echo make test_python3.7: DONE | tee.exe -a build.log
echo Rebuild Python3.7 pypi archive... | tee.exe -a build.log
make.exe package_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1
echo Rebuild Python3.7 pypi archive...DONE | tee.exe -a build.log
echo Test Python3.7 pypi archive... | tee.exe -a build.log
make.exe test_package_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1
echo Test Python3.7 pypi archive...DONE | tee.exe -a build.log

set TEMP_DIR=temp_python37
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .

REM ##################
REM ##  PYTHON 3.8  ##
REM ##################
echo Cleaning Python... | tee.exe -a build.log
make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python38-64
echo Cleaning Python...DONE | tee.exe -a build.log

REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python38-64 || exit 1
REM echo make python3.8: DONE | tee.exe -a build.log
REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python38-64 || exit 1
REM echo make test_python3.8: DONE | tee.exe -a build.log
echo Rebuild Python3.8 pypi archive... | tee.exe -a build.log
make.exe package_python WINDOWS_PATH_TO_PYTHON=c:\python38-64 || exit 1
echo Rebuild Python3.8 pypi archive...DONE | tee.exe -a build.log
echo Test Python3.8 pypi archive... | tee.exe -a build.log
make.exe test_package_python WINDOWS_PATH_TO_PYTHON=c:\python38-64 || exit 1
echo Test Python3.8 pypi archive...DONE | tee.exe -a build.log

set TEMP_DIR=temp_python38
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .

REM ##################
REM ##  PYTHON 3.9  ##
REM ##################
echo Cleaning Python... | tee.exe -a build.log
make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python39-64
echo Cleaning Python...DONE | tee.exe -a build.log

REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make python3.9: DONE | tee.exe -a build.log
REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_python3.9: DONE | tee.exe -a build.log
echo Rebuild Python3.9 pypi archive... | tee.exe -a build.log
make.exe package_python WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo Rebuild Python3.9 pypi archive...DONE | tee.exe -a build.log
echo Test Python3.9 pypi archive... | tee.exe -a build.log
make.exe test_package_python WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo Test Python3.9 pypi archive...DONE | tee.exe -a build.log

set TEMP_DIR=temp_python39
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .

@echo off
REM /!\ THIS SCRIPT SUPPOSE A FIXED PATH FOR PYTHON /!\
REM Each blocks could be triggered independently (i.e. commenting others)
REM run it as:
REM cmd /c tools\release\build_delivery_win.cmd all

REM make few tools available
set PATH=%PATH%;tools;tools\win

REM Print version
make.exe print-OR_TOOLS_VERSION | tee.exe build.log

:: Display help if no argument
if "%1"=="" (
call :PRINT_HELP
exit /B %ERRORLEVEL%
)

if "%1"=="help" (
call :PRINT_HELP
exit /B %ERRORLEVEL%
)

if "%ORTOOLS_TOKEN%"=="" (
echo ORTOOLS_TOKEN: NOT FOUND | tee.exe -a build.log
exit /B 1
)

FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --abbrev-ref HEAD`) DO (SET BRANCH=%%F)
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --verify HEAD`) DO (SET SHA1=%%F)
echo BRANCH: %BRANCH%
echo SHA1: %SHA1%

md export

if "%1"=="java" (
call :BUILD_CXX
call :BUILD_JAVA
exit /B %ERRORLEVEL%
)

if "%1"=="dotnet" (
call :BUILD_CXX
call :BUILD_DOTNET
exit /B %ERRORLEVEL%
)

if "%1"=="python" (
call :BUILD_CXX
call :BUILD_PYTHON
exit /B %ERRORLEVEL%
)

if "%1"=="archive" (
call :BUILD_CXX
call :BUILD_JAVA
call :BUILD_DOTNET
call :BUILD_ARCHIVE
exit /B %ERRORLEVEL%
)

if "%1"=="examples" (
call :BUILD_EXAMPLES
exit /B %ERRORLEVEL%
)

if "%1"=="all" (
call :BUILD_CXX
call :BUILD_JAVA
call :BUILD_DOTNET
call :BUILD_ARCHIVE
call :BUILD_EXAMPLES
call :BUILD_PYTHON
exit /B %ERRORLEVEL%
)

if "%1"=="reset" (
rm.exe -rf export
for %%i in (*.log) DO del %%i
exit /B %ERRORLEVEL%
)

echo unknow target %1
exit /B 1

:PRINT_HELP
echo NAME
echo 	%0 - Build delivery using the local host system.
echo SYNOPSIS
echo 	%0 [help] dotnet^|java^|python^|archive^|examples^|all^|reset
echo DESCRIPTION
echo 	Build Google OR-Tools deliveries.
echo 	You MUST define the following variables before running this script:
echo 	* ORTOOLS_TOKEN: secret use to decrypt key to sign dotnet and java package.
echo.
echo OPTIONS
echo 	help: show this help text (default)
echo 	dotnet: Build dotnet packages
echo 	java: Build java packages
echo 	python: Build python packages
echo 	archive: Build archive
echo 	examples: Build examples archives
echo 	all: build everything
echo 	reset: delete all artifacts and suppress cache file
echo.
echo EXAMPLES
echo 	cmd /c tools/release/%0
exit /B 0

:BUILD_CXX
title Build C++
set HASH=
for /F "tokens=* delims=" %%x in (build_cxx.log) do (set HASH=%%x)
if "%HASH%"=="%BRANCH% %SHA1%" (
echo C++ build seems up to date, skipping
exit /B 0
)

REM Check C++
which.exe cmake || exit 1
which.exe cmake | tee.exe -a build.log

REM clean everything
echo clean everything... | tee.exe -a build.log
make.exe clean_third_party || exit 1
make.exe clean || exit 1

REM THIRD PARTY
echo make third_party: ... | tee.exe -a build.log
make.exe third_party WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make third_party: DONE | tee.exe -a build.log

echo make cc: ... | tee.exe -a build.log
make.exe cc WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make cc: DONE | tee.exe -a build.log
REM make.exe test_cc WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_cc: DONE | tee.exe -a build.log

echo make fz: ... | tee.exe -a build.log
make.exe fz WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make fz: DONE | tee.exe -a build.log

echo %BRANCH% %SHA1%>build_cxx.log
exit /B 0

:BUILD_JAVA
title Build Java
set HASH=
for /F "tokens=* delims=" %%x in (build_java.log) do (set HASH=%%x)
if "%HASH%"=="%BRANCH% %SHA1%" (
echo Java build seems up to date, skipping
exit /B 0
)

REM Check Java
echo JAVA_HOME: %JAVA_HOME% | tee.exe -a build.log
which.exe java || exit 1
which.exe java | tee.exe -a build.log
which.exe mvn || exit 1
which.exe mvn | tee.exe -a build.log

which.exe gpg || exit 1
which.exe gpg | tee.exe -a build.log
which.exe openssl || exit 1
which.exe openssl | tee.exe -a build.log

REM Install Java GPG
echo Install Java GPG: ... | tee.exe -a build.log
openssl aes-256-cbc -iter 42 -pass pass:%ORTOOLS_TOKEN% -in tools\release\private-key.gpg.enc -out private-key.gpg -d
gpg --batch --import private-key.gpg
del private-key.gpg
mkdir -p %userprofile%/.m2
openssl aes-256-cbc -iter 42 -pass pass:%ORTOOLS_TOKEN% -in tools\release\settings.xml.enc -out %userprofile%/.m2/settings.xml -d
echo Install Java GPG: DONE | tee -a build.log

echo make java: ... | tee.exe -a build.log
make.exe java WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make java: DONE | tee.exe -a build.log
REM make.exe test_java WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_java: DONE | tee.exe -a build.log

for %%i in (temp_java\ortools-win32-x86-64\target\*.jar*) do copy %%i export\.
for %%i in (temp_java\ortools-java\target\*.jar*) do copy %%i export\.
echo %BRANCH% %SHA1%>build_java.log
exit /B 0

:BUILD_DOTNET
title Build .Net
set HASH=
for /F "tokens=* delims=" %%x in (build_dotnet.log) do (set HASH=%%x)
if "%HASH%"=="%BRANCH% %SHA1%" (
echo .Net build seems up to date, skipping
exit /B 0
)

REM Check .Net
which.exe dotnet || exit 1
which.exe dotnet | tee.exe -a build.log

REM Install .Net snk
echo Install .Net snk | tee.exe -a build.log
openssl aes-256-cbc -iter 42 -pass pass:%ORTOOLS_TOKEN% -in tools\release\or-tools.snk.enc -out or-tools.snk -d
set DOTNET_SNK=or-tools.snk

echo make dotnet: ... | tee.exe -a build.log
make.exe dotnet WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make dotnet: DONE | tee.exe -a build.log
REM make.exe test_dotnet WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
REM echo make test_dotnet: DONE | tee.exe -a build.log

for %%i in (packages\*nupkg*) do copy %%i export\.
echo %BRANCH% %SHA1%>build_dotnet.log
exit /B 0

REM Create Archive
:BUILD_ARCHIVE
title Build archives
set HASH=
for /F "tokens=* delims=" %%x in (build_archive.log) do (set HASH=%%x)
if "%HASH%"=="%BRANCH% %SHA1%" (
echo Archive build seems up to date, skipping
exit /B 0
)

make.exe archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make archive: DONE | tee.exe -a build.log
make.exe test_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make test_archive: DONE | tee.exe -a build.log
make.exe fz_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make fz_archive: DONE | tee.exe -a build.log
make.exe test_fz_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo make test_fz_archive: DONE | tee.exe -a build.log

echo %BRANCH% %SHA1%>build_archive.log
exit /B 0

REM Build Examples Archives
:BUILD_EXAMPLES
title Build examples
set HASH=
for /F "tokens=* delims=" %%x in (build_examples.log) do (set HASH=%%x)
if "%HASH%"=="%BRANCH% %SHA1%" (
echo Examples build seems up to date, skipping
exit /B 0
)

rm.exe -rf temp *.zip || exit 1
echo Build examples archives... | tee.exe -a build.log
echo   C++ examples archive... | tee.exe -a build.log
make.exe cc_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo   Python examples archive... | tee.exe -a build.log
make.exe python_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo   Java examples archive... | tee.exe -a build.log
make.exe java_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo   .Net examples archive... | tee.exe -a build.log
make.exe dotnet_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python39-64 || exit 1
echo DONE | tee.exe -a build.log

echo %BRANCH% %SHA1%>build_examples.log
exit /B 0

REM PYTHON 3.6,3.7,3.8,3.9
:BUILD_PYTHON
title Build Python
set HASH=
for /F "tokens=* delims=" %%x in (build_python.log) do (set HASH=%%x)
if "%HASH%"=="%BRANCH% %SHA1%" (
echo Python build seems up to date, skipping
exit /B 0
)

for %%v in (6 7 8 9) do (
title Build Python 3.%%v
REM Check Python
which.exe C:\python3%%v-64\python.exe || exit 1
echo C:\python3%%v-64\python.exe: FOUND | tee.exe -a build.log
C:\python3%%v-64\python.exe -m pip install --user absl-py mypy-protobuf

echo Cleaning Python... | tee.exe -a build.log
make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python3%%v-64
echo Cleaning Python...DONE | tee.exe -a build.log

REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python3%%v-64 || exit 1
REM echo make python3.%%v: DONE | tee.exe -a build.log
REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python3%%v-64 || exit 1
REM echo make test_python3.%%v: DONE | tee.exe -a build.log
echo Rebuild Python3.%%v pypi archive... | tee.exe -a build.log
make.exe package_python WINDOWS_PATH_TO_PYTHON=c:\python3%%v-64 || exit 1
echo Rebuild Python3.%%v pypi archive...DONE | tee.exe -a build.log
echo Test Python3.%%v pypi archive... | tee.exe -a build.log
make.exe test_package_python WINDOWS_PATH_TO_PYTHON=c:\python3%%v-64 || exit 1
echo Test Python3.%%v pypi archive...DONE | tee.exe -a build.log

set TEMP_DIR=temp_python3%%v
for %%i in (%TEMP_DIR%\ortools\dist\*.whl) do copy %%i export\.
)

echo %BRANCH% %SHA1%>build_python.log
exit /B 0

Update windows build script

release: Update windows build script


@echo off

:: change directory to etherpad-lite root
cd /D "%~dp0\.."

:: Is node installed?
cmd /C node -e "" || ( echo "Please install node.js ( http://nodejs.org )" && exit /B 1 )

echo _
echo Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
cmd /C npm install src/ --loglevel warn || exit /B 1

echo _
echo Copying custom templates...
set custom_dir=node_modules\ep_etherpad-lite\static\custom
FOR %%f IN (index pad timeslider) DO (
  if NOT EXIST "%custom_dir%\%%f.js" copy "%custom_dir%\js.template" "%custom_dir%\%%f.js"
  if NOT EXIST "%custom_dir%\%%f.css" copy "%custom_dir%\css.template" "%custom_dir%\%%f.css"
)

echo _
echo Clearing cache...
del /S var\minified*

echo _
echo Setting up settings.json...
IF NOT EXIST settings.json (
  echo Can't find settings.json.
  echo Copying settings.json.template...
  cmd /C copy settings.json.template settings.json || exit /B 1
)

echo _
echo Installed Etherpad!  To run Etherpad type start.bat

@echo off

:: change directory to etherpad-lite root
cd /D "%~dp0.."

:: Is node installed?
cmd /C node -e "" || ( echo "Please install node.js ( http://nodejs.org )" && exit /B 1 )

echo _
echo Ensure that all dependencies are up to date... If this is the first time you have run Etherpad please be patient.

mkdir node_modules
cd /D node_modules
mklink /D "ep_etherpad-lite" "..\src"

cd /D "ep_etherpad-lite"
cmd /C npm install --loglevel warn || exit /B 1

cd /D "%~dp0.."

echo _
echo Copying custom templates...
set custom_dir=node_modules\ep_etherpad-lite\static\custom
FOR %%f IN (index pad timeslider) DO (
    if NOT EXIST "%custom_dir%%%f.js" copy "%custom_dir%\js.template" "%custom_dir%%%f.js"
        if NOT EXIST "%custom_dir%%%f.css" copy "%custom_dir%\css.template" "%custom_dir%%%f.css"
)

echo _
echo Clearing cache...
del /S var\minified*

echo _
echo Setting up settings.json...
IF NOT EXIST settings.json (
    echo Can't find settings.json.
    echo Copying settings.json.template...
    cmd /C copy settings.json.template settings.json || exit /B 1
)

echo _
echo Installed Etherpad! To run Etherpad type start.bat

FIX fix provide by skupfer from github, It fix the installOnWindows problem


python setup.py --single-version-externally-managed --record record.txt

Add build.bat although the standard command will be used on windows


@echo off
setlocal

REM Script for building the LLVM installer on Windows,
REM used for the the weekly snapshots at http://www.llvm.org/builds.
REM
REM Usage: build_llvm_package.bat <revision>

REM Prerequisites:
REM
REM   Visual Studio 2017, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
REM   NSIS with the strlen_8192 patch,
REM   Visual Studio 2017 SDK and Nuget (for the clang-format plugin),
REM   Perl (for the OpenMP run-time).
REM
REM
REM   For LLDB, SWIG version <= 3.0.8 needs to be used to work around
REM   https://github.com/swig/swig/issues/769

REM You need to modify the paths below:
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat

set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36-32
set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36

set revision=%1
set branch=trunk
set package_version=9.0.0-r%revision%
set clang_format_vs_version=9.0.0.%revision%
set build_dir=llvm_package_%revision%

echo Branch: %branch%
echo Revision: %revision%
echo Package version: %package_version%
echo Clang format plugin version: %clang_format_vs_version%
echo Build dir: %build_dir%
echo.
pause

mkdir %build_dir%
cd %build_dir%

echo Checking out %branch% at r%revision%...
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/llvm/%branch% llvm || exit /b
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/cfe/%branch% llvm/tools/clang || exit /b
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/%branch% llvm/tools/clang/tools/extra || exit /b
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b
REM svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm/tools/lldb || exit /b

REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCMAKE_INSTALL_UCRT_LIBRARIES=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "

REM TODO: Run the "check-all" tests.

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=x86
set CC=
set CXX=
mkdir build32_stage0
cd build32_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
cd..

mkdir build32
cd build32
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
ninja package || exit /b
cd ..

REM The plug-in is built separately as it uses a statically linked clang-format.exe.
mkdir build_vsix
cd build_vsix
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja clang_format_vsix || exit /b
copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
cd ..

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=amd64
set CC=
set CXX=
mkdir build64_stage0
cd build64_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
cd..

mkdir build64
cd build64
set CC=..\build64_stage0\bin\clang-cl
set CXX=..\build64_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
ninja package || exit /b
cd ..

@echo off
setlocal

REM Script for building the LLVM installer on Windows,
REM used for the the weekly snapshots at http://www.llvm.org/builds.
REM
REM Usage: build_llvm_package.bat <revision>

REM Prerequisites:
REM
REM   Visual Studio 2017, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
REM   NSIS with the strlen_8192 patch,
REM   Visual Studio 2017 SDK and Nuget (for the clang-format plugin),
REM   Perl (for the OpenMP run-time).
REM
REM
REM   For LLDB, SWIG version <= 3.0.8 needs to be used to work around
REM   https://github.com/swig/swig/issues/769

REM You need to modify the paths below:
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat

set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36-32
set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36

set revision=%1
set branch=trunk
set package_version=9.0.0-r%revision%
set clang_format_vs_version=9.0.0.%revision%
set build_dir=llvm_package_%revision%

echo Branch: %branch%
echo Revision: %revision%
echo Package version: %package_version%
echo Clang format plugin version: %clang_format_vs_version%
echo Build dir: %build_dir%
echo.
pause

mkdir %build_dir%
cd %build_dir%

echo Checking out %branch% at r%revision%...
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/llvm/%branch% llvm || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/cfe/%branch% llvm/tools/clang || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/%branch% llvm/tools/clang/tools/extra || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm/tools/lldb || exit /b

REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCMAKE_INSTALL_UCRT_LIBRARIES=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "

REM TODO: Run the "check-all" tests.

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=x86
set CC=
set CXX=
mkdir build32_stage0
cd build32_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
cd..

mkdir build32
cd build32
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
ninja package || exit /b
cd ..

REM The plug-in is built separately as it uses a statically linked clang-format.exe.
mkdir build_vsix
cd build_vsix
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja clang_format_vsix || exit /b
copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
cd ..

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=amd64
set CC=
set CXX=
mkdir build64_stage0
cd build64_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
cd..

mkdir build64
cd build64
set CC=..\build64_stage0\bin\clang-cl
set CXX=..\build64_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
ninja package || exit /b
cd ..

Revert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present"

This reverts commit b358cbb9b78389e20f7be36e1a98e26515c3ecce.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@356030 91177308-0d34-0410-b5e6-96231b3b80d8


mkdir %DEPLOYMENT%
mkdir %DEPLOYMENT%\src\
mkdir src\WhiteLibrary\bin\

copy %NUGET%\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.0.13.3\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.Reporting.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.ScreenObjects.dll src\WhiteLibrary\bin\

rmdir docs /s /q

python src/WhiteLibrary/version.py > temp.txt
set /p CMDOUT=<temp.txt

IF "%CMDOUT%" == "True" (
    mkdir docs
    python -m robot.libdoc src\WhiteLibrary docs\keywords.html
    xcopy docs %DEPLOYMENT%\docs\ /s /a
)

xcopy src %DEPLOYMENT%\src\ /s /a
copy setup.py %DEPLOYMENT%\
copy build.info %DEPLOYMENT%\

mkdir %DEPLOYMENT%
mkdir %DEPLOYMENT%\src\
mkdir src\WhiteLibrary\bin\

copy %NUGET%\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.0.13.3\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\

rmdir docs /s /q

python src/WhiteLibrary/version.py > temp.txt
set /p CMDOUT=<temp.txt

IF "%CMDOUT%" == "True" (
    mkdir docs
    python -m robot.libdoc src\WhiteLibrary docs\keywords.html
    xcopy docs %DEPLOYMENT%\docs\ /s /a
)

xcopy src %DEPLOYMENT%\src\ /s /a
copy setup.py %DEPLOYMENT%\
copy build.info %DEPLOYMENT%\

Remove unnecessary .dll files from installation


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
@echo Started: %date% %time%

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.12
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)
echo "Deployment Source: %DEPLOYMENT_SOURCE%"

IF NOT DEFINED DEPLOYMENT_DIST (
    SET DEPLOYMENT_DIST=%DEPLOYMENT_SOURCE%\dist
) ELSE (
    ECHO "Deployement Dist already set"
)
echo "Deployment Dist: %DEPLOYMENT_DIST%"

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)
echo "Deployment Target: %DEPLOYMENT_TARGET%"

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)

for /F "tokens=5 delims=.\" %%a in ("%PREVIOUS_MANIFEST_PATH%") do SET PREVIOUS_SCM_COMMIT_ID=%%a

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Pre-Deployment
:: ----------
@echo "Initiating Pre-Deployment: %date% %time%"
:: .deploy initial install if node_modules doesn't exist.
IF NOT EXIST "%DEPLOYMENT_SOURCE%\.deploy\node_modules" (
    echo "NPM Install: %DEPLOYMENT_SOURCE%\.deploy\package.json"
    pushd "%DEPLOYMENT_SOURCE%\.deploy\"
    npm install --production --progress=false --cache-min=432000
    popd
)

::Initial install if node_modules doesn't exist.
IF EXIST "%DEPLOYMENT_SOURCE%\package.json" (
 echo "Main package.json exists."
    IF NOT EXIST "%DEPLOYMENT_SOURCE%\node_modules" (
        echo "NPM Install: %DEPLOYMENT_SOURCE%\package.json"
        pushd "%DEPLOYMENT_SOURCE%"
        npm install --production --progress=false --cache-min=432000
        npm install --save json-loader --progress=false --cache-min=432000
        popd
    ) ELSE (
        echo "Main node_modules exists"
    )
)

@echo "Previous Commit: %PREVIOUS_SCM_COMMIT_ID%  Current Commit: %SCM_COMMIT_ID%"
:: Only do npm install if there was a change in package.json
for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGEJSON=%%~f
    SET PKGFOLDER=!DEPLOYMENT_SOURCE!\!PACKAGEJSON:package.json=!
    echo "NPM Install: !PKGFOLDER!package.json"
    pushd "!PKGFOLDER!"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

@echo "Initiating Deployment: %date% %time%"

:: 1. Build Script
node %DEPLOYMENT_SOURCE%\.deploy\deploy.js
IF !ERRORLEVEL! NEQ 0 goto error

:: 2. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_DIST%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Cleanup
:: ----------
echo."Removing %DEPLOYMENT_TARGET%\%DEPLOY_DIST_FOLDER%"
del /f/s/q "%DEPLOYMENT_TARGET%\%DEPLOY_DIST_FOLDER%" > nul
rmdir /s/q "%DEPLOYMENT_TARGET%\%DEPLOY_DIST_FOLDER%"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
@echo Started: %date% %time%

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.12
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)
echo "Deployment Source: %DEPLOYMENT_SOURCE%"

IF NOT DEFINED DEPLOYMENT_DIST (
    SET DEPLOYMENT_DIST=%DEPLOYMENT_SOURCE%\dist
) ELSE (
    ECHO "Deployement Dist already set"
)
echo "Deployment Dist: %DEPLOYMENT_DIST%"

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)
echo "Deployment Target: %DEPLOYMENT_TARGET%"

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)

for /F "tokens=5 delims=.\" %%a in ("%PREVIOUS_MANIFEST_PATH%") do SET PREVIOUS_SCM_COMMIT_ID=%%a

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Pre-Deployment
:: ----------
@echo "Initiating Pre-Deployment: %date% %time%"
:: .deploy initial install if node_modules doesn't exist.
IF NOT EXIST "%DEPLOYMENT_SOURCE%\.deploy\node_modules" (
    echo "NPM Install: %DEPLOYMENT_SOURCE%\.deploy\package.json"
    pushd "%DEPLOYMENT_SOURCE%\.deploy\"
    npm install --production --progress=false --cache-min=432000
    popd
)

::Initial install if node_modules doesn't exist.
IF EXIST "%DEPLOYMENT_SOURCE%\package.json" (
 echo "Main package.json exists."
    IF NOT EXIST "%DEPLOYMENT_SOURCE%\node_modules" (
        echo "NPM Install: %DEPLOYMENT_SOURCE%\package.json"
        pushd "%DEPLOYMENT_SOURCE%"
        npm install --production --progress=false --cache-min=432000
        npm install --save json-loader --progress=false --cache-min=432000
        popd
    ) ELSE (
        echo "Main node_modules exists"
    )
) ELSE (
 echo "No main package.json."
)

@echo "Previous Commit: %PREVIOUS_SCM_COMMIT_ID%  Current Commit: %SCM_COMMIT_ID%"
:: Only do npm install if there was a change in package.json
for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGEJSON=%%~f
    SET PKGFOLDER=!DEPLOYMENT_SOURCE!\!PACKAGEJSON:package.json=!
    echo "NPM Install: !PKGFOLDER!package.json"
    pushd "!PKGFOLDER!"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

@echo "Initiating Deployment: %date% %time%"

:: 1. Build Script
node %DEPLOYMENT_SOURCE%\.deploy\deploy.js
IF !ERRORLEVEL! NEQ 0 goto error

:: 2. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_DIST%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Cleanup
:: ----------
echo."Removing %DEPLOYMENT_TARGET%\%DEPLOY_DIST_FOLDER%"
del /f/s/q "%DEPLOYMENT_TARGET%\%DEPLOY_DIST_FOLDER%" > nul
rmdir /s/q "%DEPLOYMENT_TARGET%\%DEPLOY_DIST_FOLDER%"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Build Master:2017-03-03T21:32:15.138Z

Build Master:2017-03-03T21:32:15.138Z


@echo off
REM ================================================================
REM   Licensed to the Apache Software Foundation (ASF) under one
REM   or more contributor license agreements.  See the NOTICE file
REM   distributed with this work for additional information
REM   regarding copyright ownership.  The ASF licenses this file
REM   to you under the Apache License, Version 2.0 (the
REM   "License"); you may not use this file except in compliance
REM   with the License.  You may obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM   Unless required by applicable law or agreed to in writing,
REM   software distributed under the License is distributed on an
REM   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
REM   KIND, either express or implied.  See the License for the
REM   specific language governing permissions and limitations
REM   under the License.
REM ================================================================

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

CALL ..\svn-config.cmd
IF ERRORLEVEL 1 EXIT /B 1

IF "%SVN_BRANCH%" LEQ "1.6.x" (
    ECHO --- Building 1.6.x or older: Skipping bindings ---
    EXIT /B 0
)

IF "%SVN_BRANCH%" LSS "1.9." (
    IF NOT EXIST "%TESTDIR%\bin" MKDIR "%TESTDIR%\bin"
    xcopy /y /i ..\deps\release\bin\*.dll "%TESTDIR%\bin"

    PATH %TESTDIR%\bin;!PATH!
)

SET result=0

python win-tests.py -d -f fsfs --javahl "%TESTDIR%\tests"
IF ERRORLEVEL 1 (
    ECHO [JavaHL test runner reported error !ERRORLEVEL!] 1>&2
    SET result=1
)

EXIT /b %result%

@echo off
REM ================================================================
REM   Licensed to the Apache Software Foundation (ASF) under one
REM   or more contributor license agreements.  See the NOTICE file
REM   distributed with this work for additional information
REM   regarding copyright ownership.  The ASF licenses this file
REM   to you under the Apache License, Version 2.0 (the
REM   "License"); you may not use this file except in compliance
REM   with the License.  You may obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM   Unless required by applicable law or agreed to in writing,
REM   software distributed under the License is distributed on an
REM   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
REM   KIND, either express or implied.  See the License for the
REM   specific language governing permissions and limitations
REM   under the License.
REM ================================================================

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

CALL ..\svn-config.cmd
IF ERRORLEVEL 1 EXIT /B 1

IF "%SVN_BRANCH%" LEQ "1.6.x" (
    ECHO --- Building 1.6.x or older: Skipping JavaHL ---
    EXIT /B 0
)

IF "%SVN_BRANCH%" LSS "1.9." (
    IF NOT EXIST "%TESTDIR%\bin" MKDIR "%TESTDIR%\bin"
    xcopy /y /i ..\deps\release\bin\*.dll "%TESTDIR%\bin"

    PATH %TESTDIR%\bin;!PATH!;!JAVADIR!
)

SET result=0

python win-tests.py -d -f fsfs --javahl "%TESTDIR%\tests"
IF ERRORLEVEL 1 (
    ECHO [JavaHL test runner reported error !ERRORLEVEL!] 1>&2
    SET result=1
)

EXIT /b %result%

Fix comment and add directory to path for <= 1.8

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1568670 13f79535-47bb-0310-9956-ffa450edef68


@setlocal

@echo Creating a package of files for easy use of ETW/WPT.

set UIforETW=%~dp0
set destdir=%UIforETW%etwpackage
set symboldir=%UIforETW%etwsymbols

rmdir %destdir% /s/q
rmdir %symboldir% /s/q
@if exist %destdir%\bin\UIforETW.exe goto pleasecloseUIforETW
@if exist %destdir%\bin\ETWProviders.dll goto pleasecloseSomething
mkdir %destdir%\bin
mkdir %destdir%\include
mkdir %destdir%\lib
mkdir %destdir%\third_party
mkdir %symboldir%

set wptredistmsi=Windows Performance Toolkit\Redistributables\WPTx64-x86_en-us.msi
set oldwptredistmsi=Windows Performance Toolkit\OldRedistributables\WPTx64-x86_en-us.msi

set wpt10=c:\Program Files (x86)\Windows Kits\10\
if not exist "%wpt10%%wptredistmsi%" goto nowpt10
if not exist "%wpt10%%oldwptredistmsi%" goto nooldwpt10
mkdir %destdir%\third_party\wpt10
mkdir %destdir%\third_party\oldwpt10
xcopy "%wpt10%%wptredistmsi%" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
xcopy "%wpt10%%oldwptredistmsi%" %destdir%\third_party\oldwpt10
@if errorlevel 1 goto copyfailure
xcopy "%wpt10%Licenses\10.0.15063.0\sdk_license.rtf" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
ren %destdir%\third_party\wpt10\sdk_license.rtf LICENSE.rtf

@rem Add VS tools to the path. Also adds signtool.exe to the path.
set vcvars32="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
if exist %vcvars32% goto community_installed
set vcvars32="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
:community_installed
call %vcvars32%

@rem Build DelayedCreateProcess.exe to the bin directory
call DelayedCreateProcess\make.bat

cd /d %UIforETW%ETWInsights
devenv /rebuild "release|Win32" ETWInsights.sln
@if ERRORLEVEL 1 goto BuildFailure
xcopy Release\flame_graph.exe %UIforETW%\bin /y

cd /d %UIforETW%UIforETW
@rem Modify the UIforETW project to be statically linked and build that version
@rem so that it will run without any extra install requirements.
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
@echo First do a test build with ETW marks disabled to test the inline functions.
sed "s/_WINDOWS/_WINDOWS;DISABLE_ETW_MARKS/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure

@rem Now prepare for the real builds
sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
if exist Release rmdir Release /s/q
if exist x64\Release rmdir x64\Release /s/q
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
devenv /rebuild "release|x64" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
@rem Clean up after building the static version.
rmdir Release /s/q
rmdir x64\Release /s/q
del UIforETWStatic.vcxproj
del UIforETWStatic.sln

cd %UIforETW%\EventEmitter
devenv /rebuild "Release|x86" EventEmitter.sln
@if ERRORLEVEL 1 goto BuildFailure
devenv /rebuild "Release|x64" EventEmitter.sln
@if ERRORLEVEL 1 goto BuildFailure

xcopy %UIforETW%CONTRIBUTING %destdir%
xcopy %UIforETW%CONTRIBUTORS %destdir%
xcopy %UIforETW%AUTHORS %destdir%
xcopy %UIforETW%LICENSE %destdir%
xcopy %UIforETW%README %destdir%

xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%bin %destdir%\bin /s
xcopy %UIforETW%ETWProviders\etwproviders.man %destdir%\bin /y
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%include %destdir%\include /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%lib %destdir%\lib /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%third_party %destdir%\third_party /s
@rem Get the destinations to exist so that the xcopy proceeds without a question.
echo >%destdir%\bin\UIforETW.exe
echo >%destdir%\bin\UIforETW32.exe
xcopy %UIforETW%bin\UIforETWStatic_devrel32.exe %destdir%\bin\UIforETW32.exe /y
xcopy %UIforETW%bin\UIforETWStatic_devrel.exe %destdir%\bin\UIforETW.exe /y
xcopy %UIforETW%bin\EventEmitter.exe %destdir%\bin /y
xcopy %UIforETW%bin\EventEmitter64.exe %destdir%\bin /y
xcopy %UIforETW%third_party\dbghelp.dll %destdir%\bin /y
xcopy %UIforETW%third_party\symsrv.dll %destdir%\bin /y

@rem Sign the important (requiring elevation) binaries
set bindir=%~dp0etwpackage\bin
signtool sign /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 %bindir%\UIforETW.exe %bindir%\UIforETW32.exe %bindir%\EventEmitter.exe %bindir%\EventEmitter64.exe %bindir%\flame_graph.exe %bindir%\RetrieveSymbols.exe %bindir%\DelayedCreateProcess.exe %bindir%\DummyChrome.dll %bindir%\ETWProviders.dll %bindir%\ETWProviders64.dll %bindir%\ETWProvidersARM64.dll
@if not %errorlevel% equ 0 goto signing_failure

@rem Copy the official binaries back to the local copy, for development purposes.
xcopy /exclude:%UIforETW%excludecopy.txt %destdir%\bin\UIforETW*.exe %UIforETW%bin /y
@if ERRORLEVEL 1 goto BuildFailure

@rem Grab all of the lab scripts
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%LabScripts %destdir%\LabScripts /y /i /s
@if ERRORLEVEL 1 goto BuildFailure

xcopy %UIforETW%\bin\UIforETWStatic_devrel*.pdb %symboldir%

cd /d %UIforETW%

@rem Source indexing as described here:
@rem http://hamishgraham.net/post/GitHub-Source-Symbol-Indexer.aspx
@rem The next steps assume that you have cloned https://github.com/Haemoglobin/GitHub-Source-Indexer.git
@rem into the parent directory of the UIforETW repo.
@rem You also have to enable execution of power-shell scripts, by running something
@rem like this from an administrator command prompt:
@rem powershell Set-ExecutionPolicy Unrestricted
@rem Note that -dbgToolsPath and -verifyLocalRepo had to be added to the command line
@rem to get the script to behave. -dbgToolsPath is tricky because the default path has
@rem spaces and the script can't handle that, so I copy it to %temp%. God help you if
@rem that has spaces.
@rem verifyLocalRepo comes with its own challenges since github-sourceindexer.ps1 does
@rem a weak job of looking for git.exe. I had to edit FindGitExe to tell it exactly where
@rem to look - something like this:
@rem function FindGitExe {
@rem  	$gitexe = "c:\src\chromium\depot_tools\git-2.8.3-64_bin\cmd\git.exe"
@rem     if (Test-Path $gitexe) {
@rem         return $gitexe
@rem     }
if not exist ..\GitHub-Source-Indexer\github-sourceindexer.ps1 goto NoSourceIndexing
if exist %temp%\srcsrv rmdir %temp%\srcsrv /s/q
mkdir %temp%\srcsrv
xcopy /s /y "c:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv" %temp%\srcsrv

@rem Crazy gymnastics to get the current git hash into an environment variable:
echo|set /p="set hash=">sethash.bat
call git log -1 --pretty=%%%%H >>sethash.bat
call sethash.bat
del sethash.bat

@rem We need to create this sort of URL:
@rem https://raw.githubusercontent.com/google/UIforETW/ea1129d25ba58efd03ef649829348ca553f82383/.gitignore
@rem From this template:
@rem HTTP_EXTRACT_TARGET=%HTTP_ALIAS%/%var2%/%var3%/raw/%var4%/%var5%
@rem With these sort of arguments:
@rem c:\github\uiforetw\uiforetw\utility.h*google*UIforETW*master*UIforETW/utility.h

powershell ..\GitHub-Source-Indexer\github-sourceindexer.ps1 -symbolsFolder etwsymbols -userID "google" ^
    -repository UIforETW -branch %hash% -sourcesRoot %UIforETW% -dbgToolsPath %temp%\srcsrv ^
    -verifyLocalRepo -gitHubUrl https://raw.githubusercontent.com -serverIsRaw
@echo Run these commands if you want to verify what has been indexed:
@echo %temp%\srcsrv\pdbstr -r -p:etwsymbols\UIforETWStatic_devrel.pdb -s:srcsrv
@echo %temp%\srcsrv\pdbstr -r -p:etwsymbols\UIforETWStatic_devrel32.pdb -s:srcsrv
:NoSourceIndexing

@rem Copy the critical PE files to the symbol server as well, to demonstrate best practices.
copy etwpackage\bin\UIforETW*.exe etwsymbols

@rem Add the PE and PDB files to a local symbol server directory, to get the
@rem required directory structure:
if exist etwsymserver rmdir /s/q etwsymserver
"c:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe" add /r /f etwsymbols /s etwsymserver /t uiforetw
@rem Delete the excess files.
rmdir etwsymserver\000Admin /s/q
del etwsymserver\pingme.txt
del etwsymserver\refs.ptr /s

@rem Make the redistributable .zip file
del *.zip 2>nul
call python make_zip_file.py etwpackage.zip etwpackage
@echo on

@rem Rename to the current version.
call python rename_to_version.py UIforETW\Version.h
@echo on

@echo Now upload the new etwpackage*.zip
@echo But make sure that the PersistedPresets section from startup10.wpaProfile
@echo been deleted to avoid shipping modified presets and bloating the file.
@echo After releasing a version with an updated version number be sure to trigger
@echo the new version checking by running:
@echo xcopy UIforETW\Version.h UIforETW\VersionCopy.h /y
@echo git add UIforETW\VersionCopy.h
@echo git commit -m "Updating VersionCopy.h for updated version checking"
@echo git push

cd etwsymserver
@rem Upload to the randomascii-symbols public symbol server.
@echo Final step - ready to upload the symbols?
@pause
call python c:\src\depot_tools\gsutil.py cp -Z -R  . gs://randomascii-symbols
cd ..
@echo on

@exit /b

:pleasecloseUIforETW
@echo UIforETW is running. Please close it and try again.
@exit /b

:pleasecloseSomething
@echo Something is running with ETWProviders.dll loaded. Please close it and try again.
@exit /b

:nowpt10
@echo WPT 10 redistributables not found. Aborting.
@exit /b

:nooldwpt10
@echo Old WPT 10 redistributables not found. Aborting.
@exit /b

:BuildFailure
@echo Build failure of some sort. Aborting.
@exit /b

:copyfailure
@echo Failed to copy file. Aborting.
@exit /b

:signing_failure
@echo Failed to sign files. Aborting.
@exit /b

@setlocal

@echo Creating a package of files for easy use of ETW/WPT.

set UIforETW=%~dp0
set destdir=%UIforETW%etwpackage
set symboldir=%UIforETW%etwsymbols

rmdir %destdir% /s/q
rmdir %symboldir% /s/q
@if exist %destdir%\bin\UIforETW.exe goto pleasecloseUIforETW
@if exist %destdir%\bin\ETWProviders.dll goto pleasecloseSomething
mkdir %destdir%\bin
mkdir %destdir%\include
mkdir %destdir%\lib
mkdir %destdir%\third_party
mkdir %symboldir%

set wptredistmsi=Windows Performance Toolkit\Redistributables\WPTx64-x86_en-us.msi
set oldwptredistmsi=Windows Performance Toolkit\OldRedistributables\WPTx64-x86_en-us.msi

set wpt10=c:\Program Files (x86)\Windows Kits\10\
if not exist "%wpt10%%wptredistmsi%" goto nowpt10
if not exist "%wpt10%%oldwptredistmsi%" goto nooldwpt10
mkdir %destdir%\third_party\wpt10
mkdir %destdir%\third_party\oldwpt10
xcopy "%wpt10%%wptredistmsi%" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
xcopy "%wpt10%%oldwptredistmsi%" %destdir%\third_party\oldwpt10
@if errorlevel 1 goto copyfailure
xcopy "%wpt10%Licenses\10.0.15063.0\sdk_license.rtf" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
ren %destdir%\third_party\wpt10\sdk_license.rtf LICENSE.rtf

@rem Add VS tools to the path. Also adds signtool.exe to the path.
set vcvars32="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
if exist %vcvars32% goto community_installed
set vcvars32="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
:community_installed
call %vcvars32%

@rem Build DelayedCreateProcess.exe to the bin directory
call DelayedCreateProcess\make.bat

cd /d %UIforETW%ETWInsights
devenv /rebuild "release|Win32" ETWInsights.sln
@if ERRORLEVEL 1 goto BuildFailure
xcopy Release\flame_graph.exe %UIforETW%\bin /y

cd /d %UIforETW%UIforETW
@rem Modify the UIforETW project to be statically linked and build that version
@rem so that it will run without any extra install requirements.
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
@echo First do a test build with ETW marks disabled to test the inline functions.
sed "s/_WINDOWS/_WINDOWS;DISABLE_ETW_MARKS/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure

@rem Now prepare for the real builds
sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
if exist Release rmdir Release /s/q
if exist x64\Release rmdir x64\Release /s/q
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
devenv /rebuild "release|x64" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
@rem Clean up after building the static version.
rmdir Release /s/q
rmdir x64\Release /s/q
del UIforETWStatic.vcxproj
del UIforETWStatic.sln

cd %UIforETW%\EventEmitter
devenv /rebuild "Release|x86" EventEmitter.sln
@if ERRORLEVEL 1 goto BuildFailure
devenv /rebuild "Release|x64" EventEmitter.sln
@if ERRORLEVEL 1 goto BuildFailure

xcopy %UIforETW%CONTRIBUTING %destdir%
xcopy %UIforETW%CONTRIBUTORS %destdir%
xcopy %UIforETW%AUTHORS %destdir%
xcopy %UIforETW%LICENSE %destdir%
xcopy %UIforETW%README %destdir%

xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%bin %destdir%\bin /s
xcopy %UIforETW%ETWProviders\etwproviders.man %destdir%\bin /y
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%include %destdir%\include /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%lib %destdir%\lib /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%third_party %destdir%\third_party /s
@rem Get the destinations to exist so that the xcopy proceeds without a question.
echo >%destdir%\bin\UIforETW.exe
echo >%destdir%\bin\UIforETW32.exe
xcopy %UIforETW%bin\UIforETWStatic_devrel32.exe %destdir%\bin\UIforETW32.exe /y
xcopy %UIforETW%bin\UIforETWStatic_devrel.exe %destdir%\bin\UIforETW.exe /y
xcopy %UIforETW%bin\EventEmitter.exe %destdir%\bin /y
xcopy %UIforETW%bin\EventEmitter64.exe %destdir%\bin /y
xcopy %UIforETW%third_party\dbghelp.dll %destdir%\bin /y
xcopy %UIforETW%third_party\symsrv.dll %destdir%\bin /y

@rem Sign the important (requiring elevation) binaries
set bindir=%~dp0etwpackage\bin
signtool sign /a /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 %bindir%\UIforETW.exe %bindir%\UIforETW32.exe %bindir%\EventEmitter.exe %bindir%\EventEmitter64.exe %bindir%\flame_graph.exe %bindir%\RetrieveSymbols.exe %bindir%\DelayedCreateProcess.exe %bindir%\DummyChrome.dll %bindir%\ETWProviders.dll %bindir%\ETWProviders64.dll %bindir%\ETWProvidersARM64.dll
@if not %errorlevel% equ 0 goto signing_failure

@rem Copy the official binaries back to the local copy, for development purposes.
xcopy /exclude:%UIforETW%excludecopy.txt %destdir%\bin\UIforETW*.exe %UIforETW%bin /y
@if ERRORLEVEL 1 goto BuildFailure

@rem Grab all of the lab scripts
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%LabScripts %destdir%\LabScripts /y /i /s
@if ERRORLEVEL 1 goto BuildFailure

xcopy %UIforETW%\bin\UIforETWStatic_devrel*.pdb %symboldir%

cd /d %UIforETW%

@rem Source indexing as described here:
@rem http://hamishgraham.net/post/GitHub-Source-Symbol-Indexer.aspx
@rem The next steps assume that you have cloned https://github.com/Haemoglobin/GitHub-Source-Indexer.git
@rem into the parent directory of the UIforETW repo.
@rem You also have to enable execution of power-shell scripts, by running something
@rem like this from an administrator command prompt:
@rem powershell Set-ExecutionPolicy Unrestricted
@rem Note that -dbgToolsPath and -verifyLocalRepo had to be added to the command line
@rem to get the script to behave. -dbgToolsPath is tricky because the default path has
@rem spaces and the script can't handle that, so I copy it to %temp%. God help you if
@rem that has spaces.
@rem verifyLocalRepo comes with its own challenges since github-sourceindexer.ps1 does
@rem a weak job of looking for git.exe. I had to edit FindGitExe to tell it exactly where
@rem to look - something like this:
@rem function FindGitExe {
@rem  	$gitexe = "c:\src\chromium\depot_tools\git-2.8.3-64_bin\cmd\git.exe"
@rem     if (Test-Path $gitexe) {
@rem         return $gitexe
@rem     }
if not exist ..\GitHub-Source-Indexer\github-sourceindexer.ps1 goto NoSourceIndexing
if exist %temp%\srcsrv rmdir %temp%\srcsrv /s/q
mkdir %temp%\srcsrv
xcopy /s /y "c:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv" %temp%\srcsrv

@rem Crazy gymnastics to get the current git hash into an environment variable:
echo|set /p="set hash=">sethash.bat
call git log -1 --pretty=%%%%H >>sethash.bat
call sethash.bat
del sethash.bat

@rem We need to create this sort of URL:
@rem https://raw.githubusercontent.com/google/UIforETW/ea1129d25ba58efd03ef649829348ca553f82383/.gitignore
@rem From this template:
@rem HTTP_EXTRACT_TARGET=%HTTP_ALIAS%/%var2%/%var3%/raw/%var4%/%var5%
@rem With these sort of arguments:
@rem c:\github\uiforetw\uiforetw\utility.h*google*UIforETW*master*UIforETW/utility.h

powershell ..\GitHub-Source-Indexer\github-sourceindexer.ps1 -symbolsFolder etwsymbols -userID "google" ^
    -repository UIforETW -branch %hash% -sourcesRoot %UIforETW% -dbgToolsPath %temp%\srcsrv ^
    -verifyLocalRepo -gitHubUrl https://raw.githubusercontent.com -serverIsRaw
@echo Run these commands if you want to verify what has been indexed:
@echo %temp%\srcsrv\pdbstr -r -p:etwsymbols\UIforETWStatic_devrel.pdb -s:srcsrv
@echo %temp%\srcsrv\pdbstr -r -p:etwsymbols\UIforETWStatic_devrel32.pdb -s:srcsrv
:NoSourceIndexing

@rem Copy the critical PE files to the symbol server as well, to demonstrate best practices.
copy etwpackage\bin\UIforETW*.exe etwsymbols

@rem Add the PE and PDB files to a local symbol server directory, to get the
@rem required directory structure:
if exist etwsymserver rmdir /s/q etwsymserver
"c:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe" add /r /f etwsymbols /s etwsymserver /t uiforetw
@rem Delete the excess files.
rmdir etwsymserver\000Admin /s/q
del etwsymserver\pingme.txt
del etwsymserver\refs.ptr /s

@rem Make the redistributable .zip file
del *.zip 2>nul
call python make_zip_file.py etwpackage.zip etwpackage
@echo on

@rem Rename to the current version.
call python rename_to_version.py UIforETW\Version.h
@echo on

@echo Now upload the new etwpackage*.zip
@echo But make sure that the PersistedPresets section from startup10.wpaProfile
@echo been deleted to avoid shipping modified presets and bloating the file.
@echo After releasing a version with an updated version number be sure to trigger
@echo the new version checking by running:
@echo xcopy UIforETW\Version.h UIforETW\VersionCopy.h /y
@echo git add UIforETW\VersionCopy.h
@echo git commit -m "Updating VersionCopy.h for updated version checking"
@echo git push

cd etwsymserver
@rem Upload to the randomascii-symbols public symbol server.
@echo Final step - ready to upload the symbols?
@pause
call python c:\src\depot_tools\gsutil.py cp -Z -R  . gs://randomascii-symbols
cd ..
@echo on

@exit /b

:pleasecloseUIforETW
@echo UIforETW is running. Please close it and try again.
@exit /b

:pleasecloseSomething
@echo Something is running with ETWProviders.dll loaded. Please close it and try again.
@exit /b

:nowpt10
@echo WPT 10 redistributables not found. Aborting.
@exit /b

:nooldwpt10
@echo Old WPT 10 redistributables not found. Aborting.
@exit /b

:BuildFailure
@echo Build failure of some sort. Aborting.
@exit /b

:copyfailure
@echo Failed to copy file. Aborting.
@exit /b

:signing_failure
@echo Failed to sign files. Aborting.
@exit /b

Add /a to signtool invocation

Add /a to signtool invocation

The /a option tells signtool to use the best certificate.


@echo off
AStyleHelper\AStyleHelper.exe Silent

Add code-format.bat

Add code-format.bat


@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Fest Assertions generator Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a Java home dir
@REM
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto error

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto runGenerator

echo.
echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = "%JAVA_HOME%"
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto error

@REM ==== END VALIDATION ====

@REM Start generator
:runGenerator
SET JAVA_EXE=%JAVA_HOME%\bin\java.exe
set CMD_LINE_ARGS=%*

%JAVA_EXE% -classpath ".;lib/*" org.fest.assertions.generator.cli.AssertionGeneratorLauncher %CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
echo Failed to execute Fest Assertions Generator

:end

@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Fest Assertions generator Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a Java home dir
@REM
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto error

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto runGenerator

echo.
echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = "%JAVA_HOME%"
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto error

@REM ==== END VALIDATION ====

@REM Start generator
:runGenerator
SET JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set CMD_LINE_ARGS=%*

%JAVA_EXE% -classpath ".;lib/*" org.fest.assertions.generator.cli.AssertionGeneratorLauncher %CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
echo Failed to execute Fest Assertions Generator

:end

fix bug with win script, doesn't work when JAVA_HOME contains space

Signed-off-by: Marcin Stachniuk <38f832933dfc131fd10806561659979b84fd2e89@gmail.com>


:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
:: Echo with no arguments prints whether echo is turned on, so echo dot.
echo .

echo # Building compilers and Go bootstrap tool.
.\cmd\dist\dist bootstrap -a -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe %GOTOOLDIR%\dist.exe
%GOTOOLDIR%\go_bootstrap clean -i std
echo .

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
%GOTOOLDIR%\go_bootstrap install -v std
endlocal
if errorlevel 1 goto fail
echo .

:mainbuild
echo # Building packages and commands.
%GOTOOLDIR%\go_bootstrap install -a -v std
if errorlevel 1 goto fail
del %GOTOOLDIR%\go_bootstrap.exe
echo .

if x%1==x--no-banner goto nobanner
%GOTOOLDIR%\dist banner
:nobanner

goto end

:fail
set GOBUILDFAIL=1

:end

:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
:: Echo with no arguments prints whether echo is turned on, so echo dot.
echo .

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe %GOTOOLDIR%\dist.exe
%GOTOOLDIR%\go_bootstrap clean -i std
echo .

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
%GOTOOLDIR%\go_bootstrap install -v std
endlocal
if errorlevel 1 goto fail
echo .

:mainbuild
echo # Building packages and commands.
%GOTOOLDIR%\go_bootstrap install -a -v std
if errorlevel 1 goto fail
del %GOTOOLDIR%\go_bootstrap.exe
echo .

if x%1==x--no-banner goto nobanner
%GOTOOLDIR%\dist banner
:nobanner

goto end

:fail
set GOBUILDFAIL=1

:end

implement --no-clean

make.bat: implement --no-clean

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/5656070


### application.bat - 2015 - Mickael Hubert ###
version = "1.2"
build_hour = "11H00"

echo "Build ${build_hour}"
echo "version ${version}"

Add partner name

Add partner name


@echo on
if %TYPE% == "zpm" (
    cd test

    zpm install-package --allow-install --allow-module || exit /b 1
    zpm vs2015 --allow-install || exit /b 1

    msbuild zpm/CoreLib-ZPM.sln || exit /b 1

    test\bin\x86\core-zpm-test.exe || exit /b 1
) else (
    zpm install-package --allow-install --allow-module  || exit /b 1
    zpm %VSTUD% --allow-install || exit /b 1

    msbuild core/CoreLib.sln /property:Configuration=Release /property:Platform=%PLAT% || exit /b 1

    if %TYPE% == "debug" (
        bin\%ARCH%\core-testd
    ) else (
        bin\%ARCH%\core-test
    )
)

if %TYPE% == "zpm" (
    cd test

    zpm install-package --allow-install --allow-module || exit /b 1
    zpm vs2015 --allow-install

    msbuild zpm/CoreLib-ZPM.sln || exit /b 1

    test\bin\x86\core-zpm-test.exe || exit /b 1
) else (
    zpm install-package --allow-install --allow-module  || exit /b 1
    zpm %VSTUD% --allow-install || exit /b 1

    msbuild core/CoreLib.sln /property:Configuration=Release /property:Platform=%PLAT% || exit /b 1

    if %TYPE% == "debug" (
        bin\%ARCH%\core-testd
    ) else (
        bin\%ARCH%\core-test
    )
)

Fix zpm build

Fix zpm build


@ECHO OFF

REM       Copyright 2016-2018 Replay SDK (http://www.replay-sdk.com)
REM
REM   Licensed under the Apache License, Version 2.0 (the "License");
REM   you may not use this file except in compliance with the License.
REM   You may obtain a copy of the License at
REM
REM      http://www.apache.org/licenses/LICENSE-2.0
REM
REM   Unless required by applicable law or agreed to in writing, software
REM   distributed under the License is distributed on an "AS IS" BASIS,
REM   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM   See the License for the specific language governing permissions and
REM   limitations under the License.

SET BACKUP_SQL=%~1

IF NOT "%BACKUP_SQL%" == "" IF EXIST "%BACKUP_SQL%" GOTO RESTORE_SQL

REM Backup files must be in folder just above source code (bcdlibre/..)
FOR %%F IN (%~dp0..\..\*.bibliopuce.backup.sql) DO SET BACKUP_SQL=%%F

IF NOT EXIST "%BACKUP_SQL%" GOTO ERROR_NOT_FOUND

:RESTORE_SQL
ECHO [%DATE% %TIME%] Restore sql "%BACKUP_SQL%"...
mysql --user=root --password=%MYSQL_ROOT_PASSWORD% --database=bibliopuce < %BACKUP_SQL%
PAUSE

:ERROR_NOT_FOUND
ECHO [%DATE% %TIME%] ERROR: File not found: "%BACKUP_SQL%"
PAUSE
EXIT /b 1

@ECHO OFF

REM       Copyright 2016-2018 Replay SDK (http://www.replay-sdk.com)
REM
REM   Licensed under the Apache License, Version 2.0 (the "License");
REM   you may not use this file except in compliance with the License.
REM   You may obtain a copy of the License at
REM
REM      http://www.apache.org/licenses/LICENSE-2.0
REM
REM   Unless required by applicable law or agreed to in writing, software
REM   distributed under the License is distributed on an "AS IS" BASIS,
REM   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM   See the License for the specific language governing permissions and
REM   limitations under the License.

SET BACKUP_SQL=%~1

IF NOT "%BACKUP_SQL%" == "" IF EXIST "%BACKUP_SQL%" GOTO RESTORE_SQL

REM Backup files must be in folder just above source code (bcdlibre/..)
REM Note: sort by date (DIR /OD) and take the last file found
FOR /F "usebackq" %%F IN (`DIR /OD/B %~dps0..\..\*.bibliopuce.backup.sql`) DO SET BACKUP_SQL=%~dps0..\..\%%F

IF NOT EXIST "%BACKUP_SQL%" GOTO ERROR_NOT_FOUND

:RESTORE_SQL
ECHO [%DATE% %TIME%] Restore sql "%BACKUP_SQL%"...
mysql --user=root --password=%MYSQL_ROOT_PASSWORD% --database=bibliopuce < %BACKUP_SQL%
PAUSE
EXIT /b 0

:ERROR_NOT_FOUND
ECHO [%DATE% %TIME%] ERROR: File not found: "%BACKUP_SQL%"
PAUSE
EXIT /b 1

fix restore script on windows

fix restore script on windows


Create toclip.bat

Create toclip.bat


@ECHO OFF&PUSHD %~DP0 &TITLE Upload
SetLocal EnableDelayedExpansion

:Menu
echo.&echo 0  Exist
echo.&echo 1  Alipay
echo.&echo 2  MiPush
echo.&echo.
set /p a=Pls Enter:
IF NOT "%a%"=="" SET a=%a:~0,1%
if "%a%"=="0" Goto Exist
if "%a%"=="1" Goto Alipay
if "%a%"=="2" Goto MiPush
echo.&echo Unknown number！
PAUSE >NUL && CLS && GOTO Menu

:Exist
exist
CLS && ECHO.&ECHO Finish, Press Any key to back! &&PAUSE>NUL && CLS && GOTO MENU

:Alipay
gradlew :Alipay:bintrayUpload
CLS && ECHO.&ECHO Finish, Press Any key to back! &&PAUSE>NUL && CLS && GOTO MENU

:MiPush
gradlew :MiPush:bintrayUpload
CLS && ECHO.&ECHO Finish, Press Any key to back! &&PAUSE>NUL && CLS && GOTO MENU

add upload bat

add upload bat


rem Nand Flash Write amplification Factor Measurement using iometer
rem WorkFlow:
rem Secure erase Nand Flash => Precondition => Write amplification Factor Measurement ==> Get smart data using CrystalDiskInfo app
rem Tool nees:
rem 1. CrystalDiskinfo 2. Iometer

cls
@echo off

echo **  Nand flash Write amplification Factor Measurement using iometer
echo **  Version 1.3
echo **
IF [%1] EQU [] GOTO END
echo **  Test using DriveNum=%1
echo **
echo on
@echo off

REM ==================================================
REM Profile
REM ==================================================
set DriveNum=%1%
set config_zero=4KRW_32_6.icf
set config_one=4KRW_32_2.icf
set result_zero=Pre_4KRW_32_6
set result_one=Run_4KRW_32_2
set smart_zero=PreSMT_4KRW_32_6
set smart_one=RunSMT_4KRW_32_2

REM ==================================================
REM MAIN PROG.
REM ==================================================

pause

echo STEP0: * Secure Erase Disk %DriveNum%
echo.
se -n %DriveNum%
pause

echo STEP1: * Precondition - 4K_RW x 6 hr - iometer /c %config_zero%
echo.
iometer /c %config_zero% /r %result_zero%.txt

echo STEP2: * Precondition - Gather SMART value in %smart_zero% file
.\CrystalDiskInfoPortable\App\CrystalDiskInfo\DiskInfo.exe /CopyExit
move .\CrystalDiskInfoPortable\App\CrystalDiskInfo\diskinfo.txt %smart_zero%
echo.
echo STEP3: * Run - 4KRW_2hr - iometer /c %config_one%
iometer /c %config_one% /r %result_one%.txt
echo.
echo STEP4: * Precondition - Gather SMART value in %smart_one% file
.\CrystalDiskInfoPortable\App\CrystalDiskInfo\DiskInfo.exe /CopyExit
move .\CrystalDiskInfoPortable\App\CrystalDiskInfo\diskinfo.txt %smart_one%
echo.
pause

GOTO EXIT

:END
echo ** usage:
echo **
echo ** wafmio [DiskPhysicalNum]
echo **
echo ** wafmio 1
echo **
echo.
wmic diskdrive get deviceID,model
exit /b 5

:EXIT
echo !!! Finished !!!

Create wafmio.cmd

Create wafmio.cmd


cd ..
del/q scintilla.zip
zip scintilla.zip scintilla\*.* scintilla\*\*.* -x *.o -x *.obj -x *.dll -x *.lib
cd scintilla

cd ..
del/q scintilla.zip
zip scintilla.zip scintilla\*.* scintilla\*\*.* -x *.o -x *.obj -x *.dll -x *.lib -x *.res
cd scintilla

Remove *.res from files zipped.

Remove *.res from files zipped.


build CleanInternetCaches
build All
build NuGet

Add command line for TeamCity

Add command line for TeamCity


@echo off

setlocal
set OUTDIR=%1
set INTDIR=%2
set CYGWIN_ROOT=%~dp0..\..\..\third_party\cygwin\
set GNU_ROOT=%~dp0..\..\..\third_party\gnu\files

set PATH=%CYGWIN_ROOT%bin;%GNU_ROOT%;%SystemRoot%;%SystemRoot%\system32

:: Ensure that the cygwin mount points are defined
CALL %CYGWIN_ROOT%setup_mount.bat > NUL

:: Copy files that the V8 bindings share with the KJS bindings.
call copy_files.bat %IntDir%\SharedSources

:: Build the generated files from IDL files.
bash build-generated-files.sh ..\..\..\third_party\WebKit\WebCore ..\..\port "%OUTDIR%" "%INTDIR%"

@echo off

setlocal
set OUTDIR=%1
set INTDIR=%2
set CYGWIN_ROOT=%~dp0..\..\..\third_party\cygwin\
set GNU_ROOT=%~dp0..\..\..\third_party\gnu\files

set PATH=%CYGWIN_ROOT%bin;%GNU_ROOT%;%SystemRoot%;%SystemRoot%\system32

:: Ensure that the cygwin mount points are defined
CALL %CYGWIN_ROOT%setup_mount.bat > NUL

:: Fix file access on vista: without this flag, the files may not be accessible.
set CYGWIN=nontsec

:: Copy files that the V8 bindings share with the KJS bindings.
call copy_files.bat %IntDir%\SharedSources

:: Build the generated files from IDL files.
bash build-generated-files.sh ..\..\..\third_party\WebKit\WebCore ..\..\port "%OUTDIR%" "%INTDIR%"

Fix cygwin posix access control emulation on Vista. It's broken.
Review URL: http://codereview.chromium.org/3033

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@2160 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


mkdir ..\..\..\workingdir
mkdir ..\..\..\workingdir\components

xcopy ..\..\..\das-collectionearnings-opa-calculator ..\..\..\workingdir\components /E
xcopy ..\..\..\das-collectionearnings-datalock ..\..\..\workingdir\components /E
xcopy ..\..\..\das-providerpayments-calculator ..\..\..\workingdir\components /E

xcopy ..\..\..\das-payment-reference-commitments ..\..\..\workingdir\components /E
xcopy ..\..\..\das-payment-reference-accounts ..\..\..\workingdir\components /E
xcopy ..\..\..\das-providerevents-components ..\..\..\workingdir\components /E

Add missing components to prepare script


@echo off

rem This script installs OpenSC
rem Parameters:
rem     user - Install for this user only.

setlocal

set MODE=%1

set KEY=HKEY_LOCAL_MACHINE
if "%MODE%" == "user" set KEY=HKEY_CURRENT_USER

cd %0\..\..

if not exist bin\opensc-tool.exe goto error

for /f %%f in (".") do set OPENSC_HOME=%%~ff

set OPENSC_HOME_ESCAPED=%OPENSC_HOME:\=\\%
set REG_FILE=%TEMP%\opensc-install.reg

echo Windows Registry Editor Version 5.00 > %REG_FILE%
echo [%KEY%\SOFTWARE\OpenSC] >> %REG_FILE%
echo "ConfigFile"="%OPENSC_HOME_ESCAPED%\\etc\\opensc.conf" >> %REG_FILE%
echo [%KEY%\SOFTWARE\PKCS11-Spy] >> %REG_FILE%
echo "Module"="%OPENSC_HOME_ESCAPED%\\bin\\opensc-pkcs11.dll" >> %REG_FILE%

regedit /s %REG_FILE%
del /q %REG_FILE%

"%OPENSC_HOME%\bin\opensc-tool" -S "app:default:profile_dir:%OPENSC_HOME%\share\opensc"

goto end

:error
echo Invalid installation
goto end

:end

endlocal

@echo off

rem This script installs OpenSC
rem Parameters:
rem     user - Install for this user only.

setlocal

set MODE=%1

set KEY=HKEY_LOCAL_MACHINE
if "%MODE%" == "user" set KEY=HKEY_CURRENT_USER

cd %0\..\..

if not exist bin\opensc-tool.exe goto error

for /f %%f in (".") do set OPENSC_HOME=%%~ff

set OPENSC_HOME_ESCAPED=%OPENSC_HOME:\=\\%
set REG_FILE=%TEMP%\opensc-install.reg

echo Windows Registry Editor Version 5.00 > %REG_FILE%
echo [%KEY%\SOFTWARE\OpenSC] >> %REG_FILE%
echo "ConfigFile"="%OPENSC_HOME_ESCAPED%\\etc\\opensc.conf" >> %REG_FILE%
echo [%KEY%\SOFTWARE\PKCS11-Spy] >> %REG_FILE%
echo "Module"="%OPENSC_HOME_ESCAPED%\\bin\\opensc-pkcs11.dll" >> %REG_FILE%

regedit /s %REG_FILE%
del /q %REG_FILE%

"%OPENSC_HOME%\bin\opensc-tool" -S "app:default:profile_dir:%OPENSC_HOME%\share\opensc"

echo You may also want to add "%OPENSC_HOME%\bin" to your PATH, for use by other applications.

goto end

:error
echo Invalid installation
goto end

:end

endlocal

Add PATH comment for Windows users

Add PATH comment for Windows users

git-svn-id: 444ed946b9c2220da791e84c3dd156a05f92db99@3489 c6295689-39f2-0310-b995-f0e70906c6a9


:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
::
:: To build extensions for 64 bit Python 2, we need to configure environment
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
::
:: 32 bit builds do not require specific environment configurations.
::
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
@ECHO OFF

SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows

SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
IF %MAJOR_PYTHON_VERSION% == "2" (
    SET WINDOWS_SDK_VERSION="v7.0"
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
    SET WINDOWS_SDK_VERSION="v7.1"
) ELSE (
    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
    EXIT 1
)

IF "%PYTHON_ARCH%"=="64" (
    ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
    ECHO Executing: %COMMAND_TO_RUN%
    call %COMMAND_TO_RUN% || EXIT 1
) ELSE (
    ECHO Using default MSVC build environment for 32 bit architecture
    ECHO Executing: %COMMAND_TO_RUN%
    call %COMMAND_TO_RUN% || EXIT 1
)

Add missing windows configuration script


@echo off
setlocal

set VERSION=1.0.0

set OUTPUT=c:\NuGet\

%OUTPUT%nuget push %OUTPUT%Packages\MMaitre.IpCamera.%VERSION%.nupkg
%OUTPUT%nuget push %OUTPUT%Symbols\MMaitre.IpCamera.Symbols.%VERSION%.nupkg -Source http://nuget.gw.symbolsource.org/Public/NuGet

@echo off
setlocal

set VERSION=1.0.1

set OUTPUT=c:\NuGet\

%OUTPUT%nuget push %OUTPUT%Packages\MMaitre.IpCamera.%VERSION%.nupkg
%OUTPUT%nuget push %OUTPUT%Symbols\MMaitre.IpCamera.Symbols.%VERSION%.nupkg -Source http://nuget.gw.symbolsource.org/Public/NuGet

Fix NuGet package version

Fix NuGet package version


@ECHO OFF
REM  Mon Nov  6 15:03:49 2017 GW script run by locally on your Windows machine
REM
REM    If run on local Developer workstation, ensure that you have Environment variables set
REM    for $DATABASE_PASSWORD, %DATABASE_NAME%, %DATABASE_USER%, it is assumed that you use
REM	   the Postgresql server on your localhost
REM
echo "Running Post-Deploy tasks..."
set PGPASSWORD=%DATABASE_PASSWORD%
cd ../scripts/
echo ". Creating additional DB objects (e.g. spatial indices, stored functions)"
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f post-deploy.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f populate-xform-gwells-well.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_bcgs.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f populate-gwells-well-from-xform.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_screens.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_production_data.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_casings.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_perforations.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_aquifer_wells.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_lithology_descriptions.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f db_replicate.sql

cd ../code-tables/
REM Refresh Code lookup tables, including the well table
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f clear-tables.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f data-load-static-codes.sql

echo ". Running DB Replication from Legacy Database, as per DB_REPLICATION flag"
cd ../cron/
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f db_replicate.sql

echo "Completed Post-Deploy tasks."
@ECHO ON

@ECHO OFF
REM  Mon Nov  6 15:03:49 2017 GW script run by locally on your Windows machine
REM
REM    If run on local Developer workstation, ensure that you have Environment variables set
REM    for $DATABASE_PASSWORD, %DATABASE_NAME%, %DATABASE_USER%, it is assumed that you use
REM	   the Postgresql server on your localhost
REM
echo "Running Post-Deploy tasks..."
set PGPASSWORD=%DATABASE_PASSWORD%
cd ..\..\scripts\
echo ". Creating additional DB objects (e.g. spatial indices, stored functions)"
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f post-deploy.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f populate-xform-gwells-well.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_bcgs.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f populate-gwells-well-from-xform.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_screens.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_production_data.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_casings.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_perforations.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_aquifer_wells.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f replicate_lithology_descriptions.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f db_replicate.sql

cd ..\code-tables\
REM Refresh Code lookup tables, including the well table
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f clear-tables.sql
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f data-load-static-codes.sql

echo ". Running DB Replication from Legacy Database, as per DB_REPLICATION flag"
cd ..\cron\
psql -d %DATABASE_NAME% -U %DATABASE_USER% -f db_replicate.sql

echo "Completed Post-Deploy tasks."
@ECHO ON

Update to Windows script - Path

Update to Windows script - Path


REM Based on, and thanks to, https://github.com/shanselman/march-is-for-makers/blob/master/getruby.cmd

@echo ON

REM Put Ruby in Path
REM You can also use %TEMP% but it is cleared on site restart. Tools is persistent.
SET PATH=%PATH%;D:\home\site\deployments\tools\r\ruby-2.1.5-x64-mingw32\bin

SET _7ZIP="%PROGRAMFILES%\7-Zip\7z.exe"
if not exist %_7ZIP% SET _7ZIP=d:\7zip\7za

REM I am in the repository folder
pushd D:\home\site\deployments\tools
if not exist r md r
cd r
if exist ruby-2.1.5-x64-mingw32 goto end

echo No Ruby, need to get it!

REM Get Ruby and Rails
REM 32bit
REM curl -o rubyrails193.zip http://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.5-i386-mingw32.7z?direct
REM 64bit
curl -o ruby215.zip -L http://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.5-x64-mingw32.7z?direct
REM Azure puts 7zip here!
echo START Unzipping Ruby
%_7ZIP% x -y ruby215.zip > rubyout
echo DONE Unzipping Ruby

REM Get DevKit to build Ruby native gems
REM If you don't need DevKit, rem this out.
curl -o DevKit.zip http://cdn.rubyinstaller.org/archives/devkits/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
echo START Unzipping DevKit
%_7ZIP% x -y -oDevKit DevKit.zip > devkitout
echo DONE Unzipping DevKit

REM Init DevKit
ruby DevKit\dk.rb init

REM Tell DevKit where Ruby is
echo --- > config.yml
echo - D:/home/site/deployments/tools/r/ruby-2.1.5-x64-mingw32 >> config.yml

REM Setup DevKit
ruby DevKit\dk.rb install

REM Update Gem223 until someone fixes the Ruby Windows installer https://github.com/oneclick/rubyinstaller/issues/261
curl -L -o update.gem https://github.com/rubygems/rubygems/releases/download/v2.2.3/rubygems-update-2.2.3.gem
call gem install --local update.gem
call update_rubygems --no-ri --no-rdoc > updaterubygemsout
echo What's our new Rubygems version?
call gem --version
call gem uninstall rubygems-update -x

popd

:end

REM Need to be in Reposistory
cd %DEPLOYMENT_SOURCE%
cd

call gem install bundler

echo Bundler install (not update!)
call bundle install

cd %DEPLOYMENT_SOURCE%
cd

REM KuduSync is after this!

REM Based on, and thanks to, https://github.com/shanselman/march-is-for-makers/blob/master/getruby.cmd

@echo ON

REM Put Ruby in Path
REM You can also use %TEMP% but it is cleared on site restart. Tools is persistent.
SET PATH=%PATH%;D:\home\site\deployments\tools\r\ruby-2.2.2-x64-mingw32\bin

SET _7ZIP="%PROGRAMFILES%\7-Zip\7z.exe"
if not exist %_7ZIP% SET _7ZIP=d:\7zip\7za

REM I am in the repository folder
pushd D:\home\site\deployments\tools
if not exist r md r
cd r
if exist ruby-2.2.2-x64-mingw32 goto end

echo No Ruby, need to get it!

REM Get Ruby and Rails
curl -o ruby222.zip -L http://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.2-x64-mingw32.7z?direct
REM Azure puts 7zip here!
echo START Unzipping Ruby
%_7ZIP% x -y ruby222.zip > rubyout
echo DONE Unzipping Ruby

REM Get DevKit to build Ruby native gems
REM If you don't need DevKit, rem this out.
curl -o DevKit.zip http://cdn.rubyinstaller.org/archives/devkits/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
echo START Unzipping DevKit
%_7ZIP% x -y -oDevKit DevKit.zip > devkitout
echo DONE Unzipping DevKit

REM Init DevKit
ruby DevKit\dk.rb init

REM Tell DevKit where Ruby is
echo --- > config.yml
echo - D:/home/site/deployments/tools/r/ruby-2.2.2-x64-mingw32 >> config.yml

REM Setup DevKit
ruby DevKit\dk.rb install

REM Update Gem223 until someone fixes the Ruby Windows installer https://github.com/oneclick/rubyinstaller/issues/261
curl -L -o update.gem https://github.com/rubygems/rubygems/releases/download/v2.2.3/rubygems-update-2.2.3.gem
call gem install --local update.gem
call update_rubygems --no-ri --no-rdoc > updaterubygemsout
echo What's our new Rubygems version?
call gem --version
call gem uninstall rubygems-update -x

popd

:end

REM Need to be in Reposistory
cd %DEPLOYMENT_SOURCE%
cd

call gem install bundler

echo Bundler install (not update!)
call bundle install

cd %DEPLOYMENT_SOURCE%
cd

REM KuduSync is after this!

Update to Ruby 2.2.2.

Update to Ruby 2.2.2.


REM  install Anaconda 2018.2 in C:\anaconda3 (without VS, without PATH)
REM  Start->Anaconda3->Anaconda-Prompt

pip install numpy==1.16.0
pip install pyqt5==5.11.3
pip install hdf5plugin
pip install silx

mkdir soft-conda
cd soft-conda

git clone https://github.com/panosc-vinyl/orange-canvas
cd orange-canvas
pip install .
cd ..

git clone https://github.com/panosc-vinyl/orange-widget-core
cd orange-widget-core
pip install .
cd ..

pip install srxraylib
pip install syned
pip install wofry

git clone https://github.com/panosc-vinyl/oasys1
cd oasys1
pip install . --no-deps
cd ..

REM
REM   try: python -m oasys.canvas -l4 --force-discovery
REM   Oasys should start (with no add-ons)
REM
REM  If it works, use the install_addons_windows.bat file to install manually the addons
REM
REM  ** IMPORTANT: DO NOT USE THE ADD-ONS MENU IN THE OASYS MENU -- DO NOT UPGRADE ADDONS USING THE OASYS MENU ***

REM  install Anaconda 2018.2 in C:\anaconda3 (without VS, without PATH)
REM  Start->Anaconda3->Anaconda-Prompt

pip install numpy==1.16.0
pip install pyqt5==5.11.3
pip install hdf5plugin
pip install silx

pip install srxraylib
pip install syned
pip install wofry

pip install oasys-canvas-core
pip install oasys-widget-core

pip install oasys1

REM
REM   try: python -m oasys.canvas -l4 --force-discovery
REM   Oasys should start (with no add-ons)
REM
REM  If it works, use the install_addons_windows.bat file to install manually the addons
REM
REM  ** IMPORTANT: DO NOT USE THE ADD-ONS MENU IN THE OASYS MENU -- DO NOT UPGRADE ADDONS USING THE OASYS MENU ***

Update install_oasys_windows.bat

Update install_oasys_windows.bat


@echo off

setlocal EnableDelayedExpansion

set registryRoot=HKCU\Software\Classes
set key=OfficeScan NT

reg add "%registryRoot%\*\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\Drive\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\Directory\shellex\ContextMenuHandlers\%key%" /d "---" /f

Disable officescan context menu on directories