@echo off

REM This file is part of the DITA Open Toolkit project.
REM See the accompanying license.txt file for applicable licenses.

REM Derived from Apache Ant command line tool.

REM  Licensed to the Apache Software Foundation (ASF) under one or more
REM  contributor license agreements.  See the NOTICE file distributed with
REM  this work for additional information regarding copyright ownership.
REM  The ASF licenses this file to You under the Apache License, Version 2.0
REM  (the "License"); you may not use this file except in compliance with
REM  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, 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.

if "%HOME%"=="" goto homeDrivePathPre
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"

:homeDrivePathPre
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"

:userProfilePre
if "%USERPROFILE%"=="" goto alpha
if "%USERPROFILE%"=="%HOME%" goto alpha
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"

:alpha

if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

if "%DITA_HOME%"=="" goto setDefaultAntHome

:stripAntHome
if not _%DITA_HOME:~-1%==_\ goto checkClasspath
set DITA_HOME=%DITA_HOME:~0,-1%
goto stripAntHome

:setDefaultAntHome
rem %~dp0 is expanded pathname of the current script under NT
set DITA_HOME=%~dp0..

:checkClasspath
set _USE_CLASSPATH=yes
rem CLASSPATH must not be used if it is equal to ""
if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
if "%CLASSPATH%"=="" set _USE_CLASSPATH=no

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
set DITA_CMD_LINE_ARGS=
:setupArgs
if ""%1""=="""" goto doneStart
if ""%1""==""-noclasspath"" goto clearclasspath
set DITA_CMD_LINE_ARGS=%DITA_CMD_LINE_ARGS% %1
shift
goto setupArgs

rem here is there is a -noclasspath in the options
:clearclasspath
set _USE_CLASSPATH=no
shift
goto setupArgs

rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

:doneStart

if "%_USE_CLASSPATH%"=="no" goto findDitaHome

:stripClasspath
if not _%CLASSPATH:~-1%==_\ goto findDitaHome
set CLASSPATH=%CLASSPATH:~0,-1%
goto stripClasspath

:findDitaHome
rem find DITA_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if exist "%DITA_HOME%\lib\ant.jar" goto checkJava

rem check for ant in Program Files
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
set DITA_HOME=%ProgramFiles%\ant
goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
set DITA_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\lib\ant.jar goto noAntHome
set DITA_HOME=C:\ant
goto checkJava

:noAntHome
echo DITA_HOME is set incorrectly or ant could not be located. Please set DITA_HOME.
goto fend

:checkJava
rem Set environment variables
call "%DITA_HOME%\resources\env.bat"

set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe

:runAnt
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
:runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:runAntNoClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:onError
rem Windows 9x way of checking the error code.  It matches via brute force.
for %%i in (1 10 100) do set err%%i=
for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
if %err100%==2 goto onError200
if %err100%==0 set err100=
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
if "%err100%"=="" if %err10%==0 set err10=
:onError1
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
goto onErrorEnd
:onError200
for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
if not err10==5 goto onError1
:onErrorEnd
set ANT_ERROR=%err100%%err10%%err1%
for %%i in (1 10 100) do set err%%i=

:end
rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
if not "%_JAVACMD%"=="" set _JAVACMD=
if not "%_DITA_CMD_LINE_ARGS%"=="" set DITA_CMD_LINE_ARGS=

if "%ANT_ERROR%"=="0" goto mainEnd

goto omega

:mainEnd

rem If there were no errors, we run the post script.
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal

if "%HOME%"=="" goto homeDrivePathPost
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

:homeDrivePathPost
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"

:userProfilePost
if "%USERPROFILE%"=="" goto omega
if "%USERPROFILE%"=="%HOME%" goto omega
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"

:omega

exit /b %ANT_ERROR%

@echo off

REM This file is part of the DITA Open Toolkit project.
REM See the accompanying license.txt file for applicable licenses.

REM Derived from Apache Ant command line tool.

REM  Licensed to the Apache Software Foundation (ASF) under one or more
REM  contributor license agreements.  See the NOTICE file distributed with
REM  this work for additional information regarding copyright ownership.
REM  The ASF licenses this file to You under the Apache License, Version 2.0
REM  (the "License"); you may not use this file except in compliance with
REM  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, 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.

if "%HOME%"=="" goto homeDrivePathPre
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"

:homeDrivePathPre
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"

:userProfilePre
if "%USERPROFILE%"=="" goto alpha
if "%USERPROFILE%"=="%HOME%" goto alpha
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"

:alpha

if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

if "%DITA_HOME%"=="" goto setDefaultAntHome

:stripAntHome
if not _%DITA_HOME:~-1%==_\ goto checkClasspath
set DITA_HOME=%DITA_HOME:~0,-1%
goto stripAntHome

:setDefaultAntHome
rem %~dp0 is expanded pathname of the current script under NT
set DITA_HOME=%~dp0..

:checkClasspath
set _USE_CLASSPATH=yes
rem CLASSPATH must not be used if it is equal to ""
if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
if "%CLASSPATH%"=="" set _USE_CLASSPATH=no

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
set DITA_CMD_LINE_ARGS=
:setupArgs
if ""%1""=="""" goto doneStart
if ""%1""==""-noclasspath"" goto clearclasspath
set DITA_CMD_LINE_ARGS=%DITA_CMD_LINE_ARGS% %1
shift
goto setupArgs

rem here is there is a -noclasspath in the options
:clearclasspath
set _USE_CLASSPATH=no
shift
goto setupArgs

rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

:doneStart

if "%_USE_CLASSPATH%"=="no" goto findDitaHome

:stripClasspath
if not _%CLASSPATH:~-1%==_\ goto findDitaHome
set CLASSPATH=%CLASSPATH:~0,-1%
goto stripClasspath

:findDitaHome
rem find DITA_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if exist "%DITA_HOME%\lib\ant.jar" goto checkJava

rem check for ant in Program Files
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
set DITA_HOME=%ProgramFiles%\ant
goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
set DITA_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\lib\ant.jar goto noAntHome
set DITA_HOME=C:\ant
goto checkJava

:noAntHome
echo DITA_HOME is set incorrectly or ant could not be located. Please set DITA_HOME.
goto end

:checkJava
rem Set environment variables
call "%DITA_HOME%\resources\env.bat"

set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe

:runAnt
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
:runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:runAntNoClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:onError
rem Windows 9x way of checking the error code.  It matches via brute force.
for %%i in (1 10 100) do set err%%i=
for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
if %err100%==2 goto onError200
if %err100%==0 set err100=
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
if "%err100%"=="" if %err10%==0 set err10=
:onError1
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
goto onErrorEnd
:onError200
for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
if not err10==5 goto onError1
:onErrorEnd
set ANT_ERROR=%err100%%err10%%err1%
for %%i in (1 10 100) do set err%%i=

:end
rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
if not "%_JAVACMD%"=="" set _JAVACMD=
if not "%_DITA_CMD_LINE_ARGS%"=="" set DITA_CMD_LINE_ARGS=

if "%ANT_ERROR%"=="0" goto mainEnd

goto omega

:mainEnd

rem If there were no errors, we run the post script.
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal

if "%HOME%"=="" goto homeDrivePathPost
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

:homeDrivePathPost
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"

:userProfilePost
if "%USERPROFILE%"=="" goto omega
if "%USERPROFILE%"=="%HOME%" goto omega
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"

:omega

exit /b %ANT_ERROR%

Fix typo on batch CLI

Fix typo on batch CLI


echo ON

:: Set the right msvc version according to Python version
if "%PY_VER%"=="2.7" (
    set MSVC_VER=9.0
    set LIB_VER=90
) else if "%PY_VER%"=="3.4" (
    set MSVC_VER=10.0
    set LIB_VER=100
) else (
    set MSVC_VER=14.0
    set LIB_VER=140
)

call bootstrap.bat
if errorlevel 1 exit 1

CALL b2 install toolset=msvc-%MSVC_VER% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        define=BOOST_ALL_NO_LIB ^
        -j%CPU_COUNT% ^
        --layout=system ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1

move %LIBRARY_LIB%\boost_*.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

echo ON

:: Set the right msvc version according to Python version
if "%PY_VER%"=="2.7" (
    set MSVC_VER=9.0
    set LIB_VER=90
) else if "%PY_VER%"=="3.4" (
    set MSVC_VER=10.0
    set LIB_VER=100
) else (
    set MSVC_VER=14.0
    set LIB_VER=140
)

call bootstrap.bat
if errorlevel 1 exit 1

echo Architecture: %ARCH%

CALL b2 install toolset=msvc-%MSVC_VER% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        define=BOOST_ALL_NO_LIB ^
        -j%CPU_COUNT% ^
        --layout=system ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1

move %LIBRARY_LIB%\boost_*.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


@REM       app="metrics"
@REM       java=/usr/java/default/bin/java
@REM       jarPath=`find $PWD -name $app-*.jar -print -quit`
@REM       logback="${app}-logback-persistent.xml"
@REM       if [ ! -e $logback ]
@REM       then
@REM          unzip -q -c $jarPath logback-persistent.xml > $logback
@REM          fi
@REM          exec /bin/sh -c "$java -Dlogback.configurationFile=$logback -jar $jarPath"
SET APP=rift
./rift.exe
goto :finally

:err
echo JAVA_HOME environment variable must be set!
pause

REM -----------------------------------------------------------------------------
:finally

ENDLOCAL

@REM       app="metrics"
@REM       java=/usr/java/default/bin/java
@REM       jarPath=`find $PWD -name $app-*.jar -print -quit`
@REM       logback="${app}-logback-persistent.xml"
@REM       if [ ! -e $logback ]
@REM       then
@REM          unzip -q -c $jarPath logback-persistent.xml > $logback
@REM          fi
@REM          exec /bin/sh -c "$java -Dlogback.configurationFile=$logback -jar $jarPath"
SET APP=rift
rift.exe
goto :finally

:err
echo JAVA_HOME environment variable must be set!
pause

REM -----------------------------------------------------------------------------
:finally

ENDLOCAL

fix rift cmd

fix rift cmd


:: Run the bedework dump/restore program
:: First arg defines the action, dump, restore etc
:: Second arg should be the filename

:: JAVA_HOME needs to be defined

@echo off
setlocal

if not "%JAVA_HOME%"=="" goto noJavaWarn
ECHO
ECHO
ECHO ***************************************************************************
ECHO          Warning: JAVA_HOME is not set - results unpredictable
ECHO ***************************************************************************
ECHO
ECHO
:noJavaWarn

SET cp=@CP@

SET DUMPCMD="%JAVA_HOME%/bin/java" -cp %cp% @DUMP-CLASS@
SET RESTORECMD="%JAVA_HOME%/bin/java" -cp %cp% @RESTORE-CLASS@
SET SCHEMACMD="%JAVA_HOME%/bin/java" -cp %cp% org.hibernate.tool.hbm2ddl.SchemaExport

SET APPNAME=@BW-APP-NAME@

ECHO.
ECHO.
ECHO   Bedework Database Tools
ECHO   -----------------------
ECHO.

:branch
  if "%1" == "dump" GOTO dump
  if "%1" == "restore" GOTO restore
  if "%1" == "restore-for-quickstart" GOTO restore-for-quickstart
  if "%1" == "backup" GOTO backup
  if "%1" == "initdb" GOTO initdb
  if "%1" == "drop" GOTO drop
  if "%1" == "drop-export" GOTO drop-export
  if "%1" == "schema" GOTO schema
  if "%1" == "schema-export" GOTO schema-export

:usage
  ECHO   Usage:
  ECHO.
  ECHO     schema-export [--haltonerror]
  ECHO        Create a schema from the xml schema.
  ECHO        Also create the database tables, indexes etc.
  ECHO.
  ECHO     initdb [--indexroot={lucene-index-root}]
  ECHO        Populate the database using the provided initial data.
  ECHO.
  ECHO     newsys [ -ndebug]
  ECHO        Create a new empty system based on the build configuration.
  ECHO.
  ECHO     dump {filename}
  ECHO        Dump the database in xml format suitable for restore.
  ECHO.
  ECHO     restore {filename}
  ECHO        Restore the database from an xml formatted dump.
  ECHO.
  ECHO     backup {directory} {prefix}
  ECHO        Dump the database in xml format suitable for restore.
  ECHO        Files will have a name built from the prefix and the current date/time.
  ECHO.
  ECHO     drop [--haltonerror]
  ECHO        Create a file in the current directory with sql drop statements
  ECHO.
  ECHO     drop-export [--haltonerror]
  ECHO        Drop tables in the database. Note this may not work if the schema
  ECHO        was changed.
  ECHO.
  ECHO     schema [--haltonerror]
  ECHO        Create a schema from the xml schema. Placed in a file in the
  ECHO        current directory
  ECHO.

  GOTO end

:dump
  ECHO   Dumping data:
  ECHO.
  ECHO   %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:restore
  ECHO   Restoring data:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:restore-for-quickstart
  ECHO   Restoring data for quickstart:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:backup
  :: first strip out delimeters from date and time
  echo %date% > temp.txt
  for /f "tokens=1-4 delims=/ " %%a in (temp.txt) do (
    set dname=%%a
    set mm=%%b
    set dd=%%c
    set yy=%%d
  )
  echo %time% > temp.txt
  for /f "tokens=1-3 delims=: " %%a in (temp.txt) do (
    set hh=%%a
    set mn=%%b
    set ss=%%c
  )
  echo %hh%%mn%%ss% > temp.txt
  for /f "tokens=1-2 delims=. " %%a in (temp.txt) do (
    set tm=%%a
    set ms=%%b
  )
  SET TARGET=%2\%3%yy%%mm%%dd%_%tm%%ms%.xml

  :: now backup the data
  ECHO   Backing up data into:
  ECHO   %TARGET%
  ECHO.
  ECHO   %DUMPCMD% -appname %APPNAME% -f %TARGET%
  %DUMPCMD% -appname %APPNAME% -f %TARGET%
  GOTO end
  ::
:initdb
  ECHO   Initializing the database:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:drop
  ECHO   Creating drop sql
  ECHO.
  ECHO   %SCHEMACMD% --text --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --text --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::
:drop-export
  ECHO   Exporting drop sql:
  ECHO.
  ECHO   %SCHEMACMD% --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::
:schema
  ECHO   Creating the schema:
  ECHO.
  ECHO   %SCHEMACMD% --text --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --text --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::
:schema-export
  ECHO   Exporting the schema:
  ECHO.
  ECHO   %SCHEMACMD% --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::

:end
ECHO.
ECHO.

:: Run the bedework dump/restore program
:: First arg defines the action, dump, restore etc
:: Second arg should be the filename

:: JAVA_HOME needs to be defined

@echo off
setlocal

if not "%JAVA_HOME%"=="" goto noJavaWarn
ECHO
ECHO
ECHO ***************************************************************************
ECHO          Warning: JAVA_HOME is not set - results unpredictable
ECHO ***************************************************************************
ECHO
ECHO
:noJavaWarn

SET cp=@CP@

SET DUMPCMD="%JAVA_HOME%/bin/java" -cp %cp% @DUMP-CLASS@
SET RESTORECMD="%JAVA_HOME%/bin/java" -cp %cp% @RESTORE-CLASS@
SET SCHEMACMD="%JAVA_HOME%/bin/java" -cp %cp% org.hibernate.tool.hbm2ddl.SchemaExport

SET APPNAME=@BW-APP-NAME@

ECHO.
ECHO.
ECHO   Bedework Database Tools
ECHO   -----------------------
ECHO.

:branch
  if "%1" == "dump" GOTO dump
  if "%1" == "restore" GOTO restore
  if "%1" == "restore-for-quickstart" GOTO restore-for-quickstart
  if "%1" == "backup" GOTO backup
  if "%1" == "initdb" GOTO initdb
  if "%1" == "newsys" GOTO newsys
  if "%1" == "drop" GOTO drop
  if "%1" == "drop-export" GOTO drop-export
  if "%1" == "schema" GOTO schema
  if "%1" == "schema-export" GOTO schema-export

:usage
  ECHO   Usage:
  ECHO.
  ECHO     schema-export [--haltonerror]
  ECHO        Create a schema from the xml schema.
  ECHO        Also create the database tables, indexes etc.
  ECHO.
  ECHO     initdb [--indexroot={lucene-index-root}]
  ECHO        Populate the database using the provided initial data.
  ECHO.
  ECHO     newsys <root-user> [-ndebug]
  ECHO        Create a new empty system based on the build configuration with a
  ECHO        single root user
  ECHO.
  ECHO     dump {filename}
  ECHO        Dump the database in xml format suitable for restore.
  ECHO.
  ECHO     restore {filename}
  ECHO        Restore the database from an xml formatted dump.
  ECHO.
  ECHO     backup {directory} {prefix}
  ECHO        Dump the database in xml format suitable for restore.
  ECHO        Files will have a name built from the prefix and the current date/time.
  ECHO.
  ECHO     drop [--haltonerror]
  ECHO        Create a file in the current directory with sql drop statements
  ECHO.
  ECHO     drop-export [--haltonerror]
  ECHO        Drop tables in the database. Note this may not work if the schema
  ECHO        was changed.
  ECHO.
  ECHO     schema [--haltonerror]
  ECHO        Create a schema from the xml schema. Placed in a file in the
  ECHO        current directory
  ECHO.

  GOTO end

:dump
  ECHO   Dumping data:
  ECHO.
  ECHO   %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:restore
  ECHO   Restoring data:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:restore-for-quickstart
  ECHO   Restoring data for quickstart:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::
:backup
  :: first strip out delimeters from date and time
  echo %date% > temp.txt
  for /f "tokens=1-4 delims=/ " %%a in (temp.txt) do (
    set dname=%%a
    set mm=%%b
    set dd=%%c
    set yy=%%d
  )
  echo %time% > temp.txt
  for /f "tokens=1-3 delims=: " %%a in (temp.txt) do (
    set hh=%%a
    set mn=%%b
    set ss=%%c
  )
  echo %hh%%mn%%ss% > temp.txt
  for /f "tokens=1-2 delims=. " %%a in (temp.txt) do (
    set tm=%%a
    set ms=%%b
  )
  SET TARGET=%2\%3%yy%%mm%%dd%_%tm%%ms%.xml

  :: now backup the data
  ECHO   Backing up data into:
  ECHO   %TARGET%
  ECHO.
  ECHO   %DUMPCMD% -appname %APPNAME% -f %TARGET%
  %DUMPCMD% -appname %APPNAME% -f %TARGET%
  GOTO end
  ::

:initdb
  ECHO   Initializing the database:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::

:newsys
  ECHO   Creating new system database:
  ECHO.
  ECHO   %RESTORECMD% -appname %APPNAME% -newSystem rootid %2 %3 %4 %5 %6 %7 %8 %9
  %RESTORECMD% -appname %APPNAME% -newSystem rootid %2 %3 %4 %5 %6 %7 %8 %9
  GOTO end
  ::

:drop
  ECHO   Creating drop sql
  ECHO.
  ECHO   %SCHEMACMD% --text --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --text --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::
:drop-export
  ECHO   Exporting drop sql:
  ECHO.
  ECHO   %SCHEMACMD% --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::
:schema
  ECHO   Creating the schema:
  ECHO.
  ECHO   %SCHEMACMD% --text --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --text --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::
:schema-export
  ECHO   Exporting the schema:
  ECHO.
  ECHO   %SCHEMACMD% --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  %SCHEMACMD% --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql
  GOTO end
  ::

:end
ECHO.
ECHO.

Add newsys option to windows dump/restore bat file


java -classpath target/microbe-1.0-SNAPSHOT.jar;lib/ru.yandex-bolts-jar-20121016122946.jar;target/dependency/* ru.lj.alamar.microbe.Model %*

java -Xmx1792M -classpath target/microbe-1.0-SNAPSHOT.jar;lib/ru.yandex-bolts-jar-20121016122946.jar;target/dependency/* ru.lj.alamar.microbe.Model %*

Add -Xmx

Add -Xmx


@rem Tests currently only work on `Release` build.
@if "%config%" == "" set config=Release

call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"

msbuild GitHubVS.sln /p:Configuration=%Config%
VSTest.Console.exe src\UnitTests\bin\%Config%\UnitTests.dll /TestAdapterPath:"."
VSTest.Console.exe src\TrackingCollectionTests\bin\%Config%\TrackingCollectionTests.dll /TestAdapterPath:"."

Add `test.cmd` to run unit tests

Add `test.cmd` to run unit tests

Running tests in `Debug` configuration doesn't currently work.


export LIBPQ_INC=../ngx_postgres-1.0rc7/include
export LIBPQ_LIB=../ngx_postgres-1.0rc7/lib
export LUAJIT_INC=../luajit-root/luajit/include/luajit-2.1
export LUAJIT_LIB=../luajit-root/luajit/lib

./configure --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=32768 --with-pcre=objs/lib/pcre-8.31 --with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1p --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-mail --with-stream --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module --with-http_spdy_module --with-ipv6 --add-module=../ngx_devel_kit-0.2.19 --add-module=../echo-nginx-module-0.58 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.29 --add-module=../ngx_postgres-1.0rc7 --add-module=../form-input-nginx-module-0.11 --add-module=../encrypted-session-nginx-module-0.04 --add-module=../ngx_lua --add-module=../ngx_lua_upstream-0.03 --add-module=../headers-more-nginx-module-0.26 --add-module=../array-var-nginx-module-0.04 --add-module=../nginx-http-concat-module --add-module=../rds-json-nginx-module-0.14  --add-module=../redis2-nginx-module-0.12

export LIBPQ_INC=../ngx_postgres-1.0rc7/include
export LIBPQ_LIB=../ngx_postgres-1.0rc7/lib
export LUAJIT_INC=../luajit-root/luajit/include/luajit-2.1
export LUAJIT_LIB=../luajit-root/luajit/lib

./configure --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=32768 --with-pcre=objs/lib/pcre-8.37 --with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.2d --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-mail --with-stream --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module --with-http_spdy_module --with-ipv6 --add-module=../ngx_devel_kit-0.2.19 --add-module=../echo-nginx-module-0.58 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.29 --add-module=../ngx_postgres-1.0rc7 --add-module=../form-input-nginx-module-0.11 --add-module=../encrypted-session-nginx-module-0.04 --add-module=../ngx_lua --add-module=../ngx_lua_upstream-0.03 --add-module=../headers-more-nginx-module-0.26 --add-module=../array-var-nginx-module-0.04 --add-module=../nginx-http-concat-module --add-module=../rds-json-nginx-module-0.14  --add-module=../redis2-nginx-module-0.12

update config.bat for openssl 1.0.2d and pcre 8.37

Signed-off-by: zqzjz0911 <ddfdd5fdebc89f7a0d0aba4c5c06c8f1e3f38030@gmail.com>


nuget push NetStitch.Client.0.1.2-alpha.nupkg -Source https://www.nuget.org/api/v2/package
nuget push NetStitch.Server.0.1.2-alpha.nupkg -Source https://www.nuget.org/api/v2/package
nuget push NetStitch.Analyzer.0.0.5-alpha.nupkg -Source https://www.nuget.org/api/v2/package

nuget push NetStitch.Client.0.1.3-alpha.nupkg -Source https://www.nuget.org/api/v2/package
nuget push NetStitch.Server.0.1.3-alpha.nupkg -Source https://www.nuget.org/api/v2/package
nuget push NetStitch.Analyzer.0.0.5-alpha.nupkg -Source https://www.nuget.org/api/v2/package

change serializer

change serializer


REM Internal script to sign binaries before publishing a release on github
REM This will *NOT* work on your computer without the excepted driver signing certificate!

REM Because of various code signing certificates on our build machines, this script use explicitly a code signing certificate issued by GoDaddy (/i Daddy).

REM Sign dll/exe files
signtool sign /v /i Daddy /t http://timestamp.verisign.com/scripts/timstamp.dll Release\*.dll
signtool sign /v /i Daddy /t http://timestamp.verisign.com/scripts/timstamp.dll Release\*.exe

REM Sign driver files...
signtool sign /v /i Daddy /t http://timestamp.verisign.com/scripts/timstamp.dll Win7Release\dokan.sys
signtool sign /v /i Daddy /t http://timestamp.verisign.com/scripts/timstamp.dll Win8Release\dokan.sys
signtool sign /v /i Daddy /t http://timestamp.verisign.com/scripts/timstamp.dll Win8.1Release\dokan.sys

Add sign script

Add sign script


mkdir build

IF "%TARGET%"  == "" SET TARGET=x86
IF "%WIN_SDK%" == "" SET WIN_SDK="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd"
IF "%LUA_LIB%" == "" SET LUA_LIB=E:\luajit\%TARGET%
call %WIN_SDK% /%TARGET% /release

::set INCLUDE=D:\work\luars232\librs232.git\include;E:\luajit\x86;E:\luajit\luajit-2.0\src;%INCLUDE%
set INCLUDE=%CD%\include;%LUA_LIB%;%INCLUDE%
pushd build
cl /O2 /DUNICODE /D_UNICODE /DWIN32 /DRS232_EXPORT ..\bindings\lua\luars232.c ..\src\rs232.c ..\src\rs232_windows.c %LUA_LIB%\lua51.lib /O2 /LD /link /dll
pause
copy ..\bindings\lua\test.lua .
::E:\luajit\x86\luajit test.lua
%LUA_LIB%\luajit test.lua
popd
pause

mkdir build

IF "%TARGET%"  == "" SET TARGET=x86
IF '%WIN_SDK%' == '' SET WIN_SDK="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd"
IF "%LUA_LIB%" == "" SET LUA_LIB=E:\luajit\%TARGET%
call %WIN_SDK% /%TARGET% /release

::set INCLUDE=D:\work\luars232\librs232.git\include;E:\luajit\x86;E:\luajit\luajit-2.0\src;%INCLUDE%
set INCLUDE=%CD%\include;%LUA_LIB%;%INCLUDE%
pushd build
cl /O2 /DUNICODE /D_UNICODE /DWIN32 /DRS232_EXPORT ..\bindings\lua\luars232.c ..\src\rs232.c ..\src\rs232_windows.c %LUA_LIB%\lua51.lib /O2 /LD /link /dll
pause
copy ..\bindings\lua\test.lua .
::E:\luajit\x86\luajit test.lua
%LUA_LIB%\luajit test.lua
popd
pause

change quote to hyphen for WIN_SDK

change quote to hyphen for WIN_SDK

Signed-off-by: Jean Jonethal <eaac1947116ebed7525d7738c6570a7d95ec22e4@gigaset.com>


@echo off
pushd "%~dp0"
call build && dotnet test --no-restore --no-build NCrontab.Tests
popd

@echo off
pushd "%~dp0"
call build ^
  && call :test Debug ^
  && call :test Release ^
popd
goto :EOF

:test
dotnet test --no-restore --no-build -c %1 NCrontab.Tests
goto :EOF

Test debug & release configs

Test debug & release configs


@echo off

set version=5_6_5

echo %PLATFORM% | findstr /C:"winrt" > nul && (
	set pkgName=%PLATFORM:~10%
)
if "%PLATFORM%" == "mingw53_32" (
	set pkgName=mingw
)
if "%pkgName%" == "" (
	set pkgName=%PLATFORM%
)

powershell -Command "Invoke-WebRequest https://github.com/Skycoder42/ci-builds/releases/download/cryptopp_%version%/cryptopp_%version%_%pkgName%.zip -OutFile %temp%\cryptopp.zip" || exit /B 1
7z x %temp%\cryptopp.zip -o.\src\3rdparty || exit /B 1

@echo off

set version=5_6_5

echo %PLATFORM% | findstr /C:"winrt_x64" > nul && (
	set pkgName=%PLATFORM:~10%_64
)
echo %PLATFORM% | findstr /C:"winrt_x86" > nul && (
	set pkgName=%PLATFORM:~10%
)
if "%PLATFORM%" == "mingw53_32" (
	set pkgName=mingw
)
if "%pkgName%" == "" (
	set pkgName=%PLATFORM%
)

powershell -Command "Invoke-WebRequest https://github.com/Skycoder42/ci-builds/releases/download/cryptopp_%version%/cryptopp_%version%_%pkgName%.zip -OutFile %temp%\cryptopp.zip" || exit /B 1
7z x %temp%\cryptopp.zip -o.\src\3rdparty || exit /B 1

fix cryptopp loading

fix cryptopp loading


PATH=C:\python26;C:\progra~2\7-zip;%PATH%
del /q /s dist\*.*
python setup.py py2exe
cd dist
7z d library.zip jinja2\* dns\* 'graphy\*
7z a namebench_for_Windows.zip -r *
namebench -x -O 8.8.8.8 -t5 -o test.html
start test.html

cd ..

Add release tool for windows

Add release tool for windows


@echo off
setlocal

set Configuration=Release

:: make sure at Unity project root directory
set NunitDirectory=packages\NUnit.Runners.2.6.4\tools
echo %NunitDirectory%
set ConsoleRunner=%NunitDirectory%\nunit-console.exe
echo %ConsoleRunner%

:: run tests
echo Running "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\Release\TestUtils.dll" %1
call %ConsoleRunner% "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\Release\TestUtils.dll" %1

endlocal

Add initial test.cmd script

Add initial test.cmd script


.nuget\NuGet.exe push src\DelegateDecompiler\bin\Release\*.nupkg -ApiKey %1

for /r %%x in (src\DelegateDecompiler\bin\Release\*.nupkg) do .nuget\NuGet.exe push %%x -ApiKey %1

Update push script to push packages separately


call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
msbuild /v:m /m BuildAndTest.proj /p:CIBuild=true

REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
msbuild /v:m /m BuildAndTest.proj /p:CIBuild=true
if ERRORLEVEL 1 (
    echo Build failed
    exit /b 1
)

REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe

REM It is okay and expected for taskkill to fail (it's a cleanup routine).  Ensure
REM caller sees successful exit.
exit /b 0

Fix cibuild.cmd

Fix cibuild.cmd

Make sure the error checking is done properly.

- msbuild needs to be checked for failure
- taskkill failure shouldn't matter


:: Start with bootstrap
cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
IF errorlevel 1 exit 1
ECHO cd %SRCDIR%
cd %SRCDIR%
IF errorlevel 1 exit 1
set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
IF errorlevel 1 exit 1
ECHO b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
CALL b2 toolset=gcc ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

:: Start with bootstrap
cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
IF errorlevel 1 exit 1
ECHO cd %SRCDIR%
cd %SRCDIR%
IF errorlevel 1 exit 1
set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
IF errorlevel 1 exit 1
ECHO b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
CALL b2 toolset=gcc ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


@echo off
setlocal

if '%Configuration%' == '' if not '%1' == '' set Configuration=%1
if '%Configuration%' == '' set Configuration=Debug

if exist "%~dp0\build\coverage" rd /s /q "%~dp0\build\coverage"
md "%~dp0\build\coverage"

"%~dp0\packages\OpenCover.4.5.3723\OpenCover.Console.exe" -register:user -output:"%~dp0\build\coverage\results.xml" -target:"%~dp0\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe" -targetargs:"%~dp0\JeremyAnsel.Media.An8.Tests\bin\%Configuration%\JeremyAnsel.Media.An8.Tests.dll -noshadow" "-filter:+[JeremyAnsel.Media.An8]* -[*.Tests]*" -hideskipped:File;Filter;Attribute -returntargetcode

"%~dp0\packages\ReportGenerator.2.1.4.0\ReportGenerator.exe" -reports:"%~dp0\build\coverage\results.xml" -targetdir:"%~dp0\build\coverage" -verbosity:Info

@echo off
setlocal

if '%Configuration%' == '' if not '%1' == '' set Configuration=%1
if '%Configuration%' == '' set Configuration=Debug

if exist "%~dp0\build\coverage" rd /s /q "%~dp0\build\coverage"
md "%~dp0\build\coverage"

"%~dp0\packages\OpenCover.4.5.3723\OpenCover.Console.exe" -register:user -output:"%~dp0\build\coverage\results.xml" -target:"%~dp0\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe" -targetargs:"%~dp0\JeremyAnsel.Media.An8.Tests\bin\%Configuration%\JeremyAnsel.Media.An8.Tests.dll -noshadow" "-filter:+[JeremyAnsel.Media.An8]* -[*.Tests]*" -hideskipped:File;Filter;Attribute -returntargetcode
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

"%~dp0\packages\ReportGenerator.2.1.4.0\ReportGenerator.exe" -reports:"%~dp0\build\coverage\results.xml" -targetdir:"%~dp0\build\coverage" -verbosity:Info

Update run-tests script

Update run-tests script


:: As taken from the README for zpaq
cl /O2 /EHsc zpaq.cpp libzpaq.cpp advapi32.lib || exit 1
copy zpaq.exe %PREFIX%\bin || exit 1

:: As taken from the README for zpaq
cl /O2 /EHsc zpaq.cpp libzpaq.cpp advapi32.lib || exit 1
copy /B zpaq.exe %LIBRARY_BIN% || exit 1

copy zpaq.exe to the correct place

copy zpaq.exe to the correct place


@echo off

set LEIN_VERSION=1.4.1

setLocal EnableExtensions EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" set LEIN_JAR="%~dp0%leiningen-!LEIN_VERSION!-standalone.jar"

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if "x%LEIN_HOME%" == "x" set LEIN_HOME=%USERPROFILE%\.lein

set ORIGINAL_PWD=%CD%
rem If ORIGINAL_PWD ends with a backslash (such as C:\),
rem we need to escape it with a second backslash.
if "%ORIGINAL_PWD:~-1%x" == "\x" set "ORIGINAL_PWD=%ORIGINAL_PWD%\"

call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (".\lib\dev\*.jar") do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in ("%LEIN_HOME%\plugins\*.jar") do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH=%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;test;src;"%CLASSPATH%"

if exist "%~f0\..\..\src\leiningen\core.clj" (
    rem Running from source checkout.
    call :SET_LEIN_ROOT "%~f0\..\.."

    set LEIN_LIBS="
    for %%j in ("!LEIN_ROOT!\lib\*") do set LEIN_LIBS=!LEIN_LIBS!;%%~fj
    set LEIN_LIBS=!LEIN_LIBS!"

    if "x!LEIN_LIBS!" == "x" if not exist %LEIN_JAR% goto NO_DEPENDENCIES

    set CLASSPATH=!LEIN_LIBS!;%CLASSPATH%;"!LEIN_ROOT!\src";"!LEIN_ROOT!\resources";%LEIN_JAR%
) else (
    rem Not running from a checkout.
    if not exist %LEIN_JAR% goto NO_LEIN_JAR
    set CLASSPATH=%LEIN_JAR%;%CLASSPATH%
)

if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
rem ##################################################

if not "x%INSIDE_EMACS%" == "x" goto SKIP_JLINE
if "x%1" == "xrepl"             goto SET_JLINE
if "x%1" == "xinteractive"      goto SET_JLINE
if "x%1" == "xint"              goto SET_JLINE
goto :SKIP_JLINE

:SET_JLINE
set JLINE=jline.ConsoleRunner
:SKIP_JLINE

if "x%JAVA_CMD%" == "x" set JAVA_CMD="java"
set CLOJURE_JAR=%USERPROFILE%\.m2\repository\org\clojure\clojure\1.2.0\clojure-1.2.0.jar
goto RUN

:NO_LEIN_JAR
echo.
echo %LEIN_JAR% can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:NO_DEPENDENCIES
echo.
echo Leiningen is missing its dependencies.
echo Please see "Building" in the README.
echo.
goto EOF

:SELF_INSTALL
if exist %LEIN_JAR% (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget --no-check-certificate -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl --insecure -f -L -o
)
set LEIN_JAR_URL=https://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% %LEIN_JAR% %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del %LEIN_JAR%>nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

:SET_LEIN_ROOT
set LEIN_ROOT=%~f1
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:RUN
rem Need to disable delayed expansion because the %* variable
rem may contain bangs (as in test!).
setLocal DisableDelayedExpansion

%JAVA_CMD% -client %JAVA_OPTS% -Xbootclasspath/a:"%CLOJURE_JAR%" ^
 -Dleiningen.original.pwd="%ORIGINAL_PWD%" ^
 -cp %CLASSPATH% %JLINE% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:EOF

@echo off

set LEIN_VERSION=1.4.1

setLocal EnableExtensions EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_HOME%" == "x" set LEIN_HOME=%USERPROFILE%\.lein
if "x%LEIN_JAR%" == "x" set LEIN_JAR="!LEIN_HOME!\self-installs\leiningen-!LEIN_VERSION!-standalone.jar"

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

set ORIGINAL_PWD=%CD%
rem If ORIGINAL_PWD ends with a backslash (such as C:\),
rem we need to escape it with a second backslash.
if "%ORIGINAL_PWD:~-1%x" == "\x" set "ORIGINAL_PWD=%ORIGINAL_PWD%\"

call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (".\lib\dev\*.jar") do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in ("%LEIN_HOME%\plugins\*.jar") do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH=%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;test;src;"%CLASSPATH%"

if exist "%~f0\..\..\src\leiningen\core.clj" (
    rem Running from source checkout.
    call :SET_LEIN_ROOT "%~f0\..\.."

    set LEIN_LIBS="
    for %%j in ("!LEIN_ROOT!\lib\*") do set LEIN_LIBS=!LEIN_LIBS!;%%~fj
    set LEIN_LIBS=!LEIN_LIBS!"

    if "x!LEIN_LIBS!" == "x" if not exist %LEIN_JAR% goto NO_DEPENDENCIES

    set CLASSPATH=!LEIN_LIBS!;%CLASSPATH%;"!LEIN_ROOT!\src";"!LEIN_ROOT!\resources";%LEIN_JAR%
) else (
    rem Not running from a checkout.
    if not exist %LEIN_JAR% goto NO_LEIN_JAR
    set CLASSPATH=%LEIN_JAR%;%CLASSPATH%
)

if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
rem ##################################################

if not "x%INSIDE_EMACS%" == "x" goto SKIP_JLINE
if "x%1" == "xrepl"             goto SET_JLINE
if "x%1" == "xinteractive"      goto SET_JLINE
if "x%1" == "xint"              goto SET_JLINE
goto :SKIP_JLINE

:SET_JLINE
set JLINE=jline.ConsoleRunner
:SKIP_JLINE

if "x%JAVA_CMD%" == "x" set JAVA_CMD="java"
set CLOJURE_JAR=%USERPROFILE%\.m2\repository\org\clojure\clojure\1.2.0\clojure-1.2.0.jar
goto RUN

:NO_LEIN_JAR
echo.
echo %LEIN_JAR% can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:NO_DEPENDENCIES
echo.
echo Leiningen is missing its dependencies.
echo Please see "Building" in the README.
echo.
goto EOF

:SELF_INSTALL
if exist %LEIN_JAR% (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
for %%f in (%LEIN_JAR%) do set LEIN_INSTALL_DIR="%%~dpf"
if not exist %LEIN_INSTALL_DIR% mkdir %LEIN_INSTALL_DIR%

set HTTP_CLIENT=wget --no-check-certificate -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl --insecure -f -L -o
)
set LEIN_JAR_URL=https://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% %LEIN_JAR% %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del %LEIN_JAR%>nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

:SET_LEIN_ROOT
set LEIN_ROOT=%~f1
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:RUN
rem Need to disable delayed expansion because the %* variable
rem may contain bangs (as in test!).
setLocal DisableDelayedExpansion

%JAVA_CMD% -client %JAVA_OPTS% -Xbootclasspath/a:"%CLOJURE_JAR%" ^
 -Dleiningen.original.pwd="%ORIGINAL_PWD%" ^
 -cp %CLASSPATH% %JLINE% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:EOF

Make lein.bat save self-install jars into LEIN_HOME


add utf8.bat

add utf8.bat


echo off
cls
choice /d y /n /t 120 /m "Please Close Window to cancel"
pause
shutdown -l

Create logoff.bat

Create logoff.bat


FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S node_modules') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S Packages') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S .vs') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S TestResults') DO RMDIR /S /Q "%%G"
DEL /Q /F /S "Resource.designer.cs"
DEL /Q /F /S "*.csproj.user"
DEL /Q /F /S "*.Model.Context.d.ts"
DEL /Q /F /S "*.Model.Context.js"

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S node_modules') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S Packages') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S .vs') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S TestResults') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S AppPackages') DO RMDIR /S /Q "%%G"
DEL /Q /F /S "Resource.designer.cs"
DEL /Q /F /S "*.csproj.user"
DEL /Q /F /S "*.Model.Context.d.ts"
DEL /Q /F /S "*.Model.Context.js"

Delete uwp app packages too!

Delete uwp app packages too!


msbuild.exe AspNet.Mvc.Formatters.Protobuf.sln
cd ./src/AspNet.Mvc.Formatters.Protobuf
dnu restore
dnu build
dnu pack
dnu publish
cd ..
cd ..

Add msbuild

Add msbuild


rem Tool to assemble Windows builds
rem Requirements are 7-zip, py2exe, and FreeExtractor

PATH=C:\python27;C:\python26;C:\progra~1\7-zip;C:\progra~2\7-zip;%PATH%

rem ****** Clean out the old junk
rmdir /q /s dist\*.*
del /s /q dist\*.*

rem ****** Compile our executable and core zipfile
python setup.py py2exe

rem ****** Remove extras from core zipfile
cd dist
7z d namebench.zip tcl\*.*
rmdir /s /q tcl\tcl8.5\tzdata tcl\tk8.5\demos
del tcl\tk8.5\images\*.eps

rem ****** Final assembly of zipfile
copy ..\README.txt .
7z a namebench_for_Windows.zip -r * >nul

rem ****** Test assembled zipfile
namebench -x -O 8.8.8.8 -q5 -o test.html
start test.html

cd ..

rem Tool to assemble Windows builds
rem Requirements are 7-zip, py2exe, and FreeExtractor

PATH=C:\python27;C:\python26;C:\progra~1\7-zip;C:\progra~2\7-zip;%PATH%

rem ****** Clean out the old junk
del /s /f /q dist

rem ****** Compile our executable and core zipfile
python setup.py py2exe

rem ****** Remove extras from core zipfile
cd dist
7z d namebench.zip tcl\*.*
rmdir /s /q tcl\tcl8.5\tzdata tcl\tk8.5\demos
del tcl\tk8.5\images\*.eps

rem ****** Final assembly of zipfile
copy ..\README.txt .
7z a namebench_for_Windows.zip -r * >nul

rem ****** Test assembled zipfile
namebench -x -O 8.8.8.8 -q5 -o test.html
start test.html

cd ..

Remove wildcard from del statement

Remove wildcard from del statement


REM Setup (1)

REM Switch to branch 1700 (i.e. chromium beta)

REM   This part should only need to be done once, but it won't hurt to repeat it.  The first
REM   time might take a while because it fetches an extra 1/2 GB or so of branch commits.
gclient sync --with_branch_heads
git fetch

set BRANCH=1700
git config --replace-all svn-remote.svn_%BRANCH%.url svn://svn.chromium.org/chrome
git config --replace-all svn-remote.svn_%BRANCH%.fetch branches/%BRANCH%/src:refs/remotes/origin/%BRANCH%

REM   This "initializes" the %BRANCH% refspec, to prevent 'git svn fetch' from scanning
REM   the whole svn repo history for the branch commits we already synced above.
REM "ref: refs/remotes/branch-heads/%BRANCH%" > .git/refs/remotes/origin/%BRANCH%

REM   This should finish quickly, just doing a bit of git-svn housekeeping.
REM   It might fetch a few recent revisions, if the git mirror is slightly out-of-date,
REM   but it shouldn't be behind by much, and most of the time it shouldn't need to
REM   fetch anything. If it's taking a long time or looks like it's fetching a bunch of
REM   stuff from svn, something is probably wrong.
git svn fetch svn_%BRANCH%

REM   Checkout the branch 'src' tree.
git checkout -b branch_%BRANCH% origin/%BRANCH%
REM   Make git-cl happy.
git config branch.branch_%BRANCH%.merge refs/heads/%BRANCH%
git config branch.branch_%BRANCH%.remote branch-heads
REM   Checkout all the submodules at their branch DEPS revisions.
gclient sync --jobs 16
gclient runhooks --force

REM Setup (2)
REM remove all .git and .gitmodules directories that came with the chromium clone

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S ".git"') DO RMDIR /Q /S "%%G"

REM Step (3) init AMD repository and pull

cd ..

call git init
call git remote rm origin 2> nul
call git remote add origin https://github.com/amd/Chromium-WebCL.git
call git fetch
call git reset --hard origin/master
call git branch --set-upstream-to=origin/master master

cd src

REM Setup (1)

REM Switch to branch 1700 (i.e. chromium beta)

REM   This part should only need to be done once, but it won't hurt to repeat it.  The first
REM   time might take a while because it fetches an extra 1/2 GB or so of branch commits.
call gclient sync --with_branch_heads
call git fetch

set BRANCH=1700
call git config --replace-all svn-remote.svn_%BRANCH%.url svn://svn.chromium.org/chrome
call git config --replace-all svn-remote.svn_%BRANCH%.fetch branches/%BRANCH%/src:refs/remotes/origin/%BRANCH%

REM   This "initializes" the %BRANCH% refspec, to prevent 'git svn fetch' from scanning
REM   the whole svn repo history for the branch commits we already synced above.
REM "ref: refs/remotes/branch-heads/%BRANCH%" > .git/refs/remotes/origin/%BRANCH%

REM   This should finish quickly, just doing a bit of git-svn housekeeping.
REM   It might fetch a few recent revisions, if the git mirror is slightly out-of-date,
REM   but it shouldn't be behind by much, and most of the time it shouldn't need to
REM   fetch anything. If it's taking a long time or looks like it's fetching a bunch of
REM   stuff from svn, something is probably wrong.
call git svn fetch svn_%BRANCH%

REM   Checkout the branch 'src' tree.
call git checkout -b branch_%BRANCH% origin/%BRANCH%
REM   Make git-cl happy.
call git config branch.branch_%BRANCH%.merge refs/heads/%BRANCH%
call git config branch.branch_%BRANCH%.remote branch-heads
REM   Checkout all the submodules at their branch DEPS revisions.
call gclient sync --jobs 16
call gclient runhooks --force

REM Setup (2)
REM remove all .git and .gitmodules directories that came with the chromium clone

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S ".git"') DO RMDIR /Q /S "%%G"

REM Step (3) init AMD repository and pull

cd ..

call git init
call git remote rm origin 2> nul
call git remote add origin https://github.com/amd/Chromium-WebCL.git
call git fetch
call git reset --hard origin/master
call git branch --set-upstream-to=origin/master master

cd src

add call in front of all commands--some are scripts which will not return if there's no 'call'


@ECHO off
@setlocal enableextensions
@cd /d "%~dp0"

REM http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights

NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
   ECHO.
   ECHO "Administrator PRIVILEGES Detected!"
   ECHO.
) ELSE (
   ECHO.
   ECHO ##########################################################
   ECHO.
   ECHO.
   ECHO ######## ########  ########   #######  ########
   ECHO ##       ##     ## ##     ## ##     ## ##     ##
   ECHO ##       ##     ## ##     ## ##     ## ##     ##
   ECHO ######   ########  ########  ##     ## ########
   ECHO ##       ##   ##   ##   ##   ##     ## ##   ##
   ECHO ##       ##    ##  ##    ##  ##     ## ##    ##
   ECHO ######## ##     ## ##     ##  #######  ##     ##
   ECHO.
   ECHO.
   ECHO ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED #########
   ECHO This script must be run as administrator to work properly!
   ECHO If you're seeing this after clicking on a start menu icon,
   ECHO then right click on the shortcut and select
   ECHO "Run As Administrator".
   ECHO ##########################################################
   ECHO.
   PAUSE
   EXIT /B 1
)

if not exist "packages" mkdir packages

REM ===========================================================================
REM SET EXECUTION POLICY
REM ===========================================================================

ECHO "Set Execution Policy..."
ECHO.

powershell -command "Set-ExecutionPolicy Unrestricted"

REM ===========================================================================
REM DOWNLOAD TOOLS
REM ===========================================================================

set MSYSTOOLS="MSYS-20111123.zip"

if not exist "packages\%MSYSTOOLS%" (
     ECHO "Downloading msys..."
     powershell -command ". .\mingle\Get-WebFile.ps1; Get-WebFile -url 'http://sourceforge.net/projects/mingw-w64/files/External binary packages (Win64 hosted)/MSYS (32-bit)/%MSYSTOOLS%/download' -fileName 'packages\\%MSYSTOOLS%'"
)

if not exist "packages\%MSYSTOOLS%" (
    ECHO "Failed to download MSYS!"
    ECHO.
    EXIT /B 1
)

REM Best so far.
set GCCCOMPILER=x86_64-w64-mingw32-gcc-4.7.2-release-win64_rubenvb.7z
set GCCURL="'http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/rubenvb/gcc-4.7-release/%GCCCOMPILER%/download'"

REM set GCCCOMPILERUPDATE=x86_64-w64-mingw32-mingw-w64-update-trunk-20130115_rubenvb.7z
REM set GCCUPDATEURL="'http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/rubenvb/update/%GCCCOMPILERUPDATE%/download'"

REM set GCCCOMPILER=mingw-w64-bin-x86_64-20130104.7z
REM set GCCURL="'http://www.drangon.org/mingw/mirror.php?num=2&fname=mingw-w64-bin-x86_64-20130104.7z'"

REM set GCCCOMPILER=x64-4.7.2-release-posix-sjlj-rev9.7z
REM set GCCURL="'http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/64-bit/threads-posix/sjlj/%GCCCOMPILER%/download'"

if not exist "packages\%GCCCOMPILER%" (
    ECHO "Downloading %GCCCOMPILER%..."
    powershell -command ". .\mingle\Get-WebFile.ps1; Get-WebFile -url %GCCURL% -fileName 'packages\\%GCCCOMPILER%'"
)

REM if not exist "packages\%GCCCOMPILERUPDATE%" (
REM     ECHO "Downloading %GCCCOMPILERUPDATE%..."
REM     powershell -command ". .\mingle\Get-WebFile.ps1; Get-WebFile -url %GCCUPDATEURL% -fileName 'packages\\%GCCCOMPILERUPDATE%'"
REM )

if not exist "packages\%GCCCOMPILER%" (
    ECHO "Failed to download compiler!"
    ECHO.
    EXIT /B 1
)

REM ===========================================================================
REM EXTRACTING TOOLS
REM ===========================================================================

if not exist "msys" (
    ECHO "Extracting MSYS..."
    ECHO.
    mingle\unzip packages\MSYS-20111123.zip
)

if not exist "mingw64" (
    ECHO "Extracting GCC..."
    ECHO.
    mingle\7za x packages\%GCCCOMPILER%
REM     mingle\7za x -y packages\%GCCCOMPILERUPDATE% -ir!*mingw64\x86_64-w64-mingw32*
)

IF EXIST "mingw" (
    MOVE mingw mingw64
)

IF NOT EXIST "mingw64\bin\gcc.exe" (
    ECHO "Failed to install GCC!"
    ECHO.
    EXIT /B 1
)

IF EXIST "mingw64\bin\lib" (
    ECHO Not sure why these python libraries exist in bin. We will remove and reinstall later after we build Python. Otherwise, this will interfere with the msvc lib command.
    DEL /s /Q mingw64\bin\lib
    RMDIR /S /Q mingw64\bin\lib
)

IF NOT EXIST "msys.lnk" (
ECHO "Creating shortcut..."
ECHO.
powershell -command ". .\mingle\createShortcut.ps1; createShortcut -TargetPath '%CD%\msys\msys.bat' -LinkPath '.\msys.lnk'"
)

REM ===========================================================================
REM RESET EXECUTION POLICY
REM ===========================================================================

ECHO "Reset Execution Policy..."
ECHO.

powershell -command "Set-ExecutionPolicy Restricted"

REM ===========================================================================
REM SETUP FSTAB
REM ===========================================================================
msys\bin\bash -l -c "grep '/mingw' /etc/fstab>/dev/null"
IF %ERRORLEVEL% EQU 1 (
    ECHO "Setup MSYS..."
    ECHO.

    msys\bin\bash -l -c "ECHO '%CD%\mingw64' /mingw>/etc/fstab"
    if not exist "msys\home\developer" mkdir "%CD%\msys\home\developer"
)

REM ===========================================================================
REM GET BUILD SCRIPTS IN ORDER
REM ===========================================================================
ECHO.
ECHO "Copy build scripts and configs..."
ECHO.

XCOPY /Y /Q /D mingle\mingw.jam msys\home\developer\
XCOPY /Y /Q /D mingle\mingle.sh mingw64\bin

IF EXIST "mingw64\bin\mingle.sh" (
MOVE /Y mingw64\bin\mingle.sh mingw64\bin\mingle
)

IF NOT EXIST "msys\home\developer\patches" MKDIR msys\home\developer\patches
XCOPY /S /Y /Q /D patches msys\home\developer\patches

REM ===========================================================================
REM PROCESS ARGUMENTS
REM ===========================================================================
set MINGLE_SUITE=0
:Loop
IF "%1"=="" GOTO Continue
IF "%1"=="-s" GOTO SUITE
IF "%1"=="--suite" GOTO SUITE
IF "%1"=="/?" (
  GOTO HELP
) ELSE (
  GOTO INVALID
)

SHIFT
GOTO Loop

:HELP
ECHO.
ECHO ===========================================================================
ECHO Mingle - HELP
ECHO ===========================================================================
ECHO.
ECHO This is the Windoes command shell wrapper which deploys the MinGW 64bit
ECHO development environment. Please select from one of the following options:
ECHO.
ECHO Usage: setup.bat [--suite=#selection]
ECHO.
ECHO   -s, --suite Specify a reference number from one of the suites listed below.
ECHO.

msys\bin\bash -l -c "/mingw/bin/mingle -l"

GOTO EXIT

:INVALID

ECHO.
ECHO Invalid Option
ECHO.

GOTO HELP

:SUITE

set MINGLE_SUITE=%2

ECHO.
ECHO.
ECHO Deploying selected development environment (%MINGLE_SUITE%):
ECHO.

msys\bin\bash -l -c "/mingw/bin/mingle -m %MINGLE_SUITE%"

IF %MINGLE_SUITE% GTR %ERRORLEVEL% (
ECHO.
ECHO Invalid selection! You can only choose from one of the following:
ECHO.
msys\bin\bash -l -c "cd /mingw/bin;./mingle -l"
GOTO EXIT
)

msys\bin\bash -l -c "/mingw/bin/mingle -k %MINGLE_SUITE%"
ECHO.

GOTO Continue

REM ===========================================================================
REM CONTINUE
REM ===========================================================================
:Continue

ECHO "Make Sure Previous PYTHONPATH is cleared..."
ECHO.

COPY mingle\profile msys\etc

ECHO "Checking for Visual Studio 2012 Express for Windows Desktop..."
ECHO.
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0"
ECHO.

if ERRORLEVEL 1 (
ECHO "Please Install Visual Studio 2012 Express for Windows Desktop before proceeding"
ECHO "VS includes MASM, ml64.exe, which is used to build boost libraries."

ECHO Visit: http://www.microsoft.com/visualstudio/eng/downloads
ECHO Direct Link: http://go.microsoft.com/?linkid=9816758
ECHO.

pause
EXIT /B 1
)

if not exist "mingw64\bin\ml64.exe" (
    ECHO "Retrieve MASM..."

    if not exist "%VS110COMNTOOLS%..\..\VC\bin\x86_amd64" (
       ECHO.
       ECHO ##########################################################
       ECHO.
       ECHO.
       ECHO ######## ########  ########   #######  ########
       ECHO ##       ##     ## ##     ## ##     ## ##     ##
       ECHO ##       ##     ## ##     ## ##     ## ##     ##
       ECHO ######   ########  ########  ##     ## ########
       ECHO ##       ##   ##   ##   ##   ##     ## ##   ##
       ECHO ##       ##    ##  ##    ##  ##     ## ##    ##
       ECHO ######## ##     ## ##     ##  #######  ##     ##
       ECHO.
       ECHO.
       ECHO ###### ERROR: VISUAL STUDIO 2012 EXPRESS REQUIRED ########
       ECHO Something is quirky on your machine. Did you not install
       ECHO to the typicl path? You will have to manually copy MASM
       ECHO to your install. Look for the files in your VS2012 install:
       ECHO "Microsoft Visual Studio 11.0\VC\bin\x86_amd64".
       ECHO ##########################################################
       ECHO.
       PAUSE
       EXIT /B 1
    )

    REM BUG!!!copy "%VS110COMNTOOLS%..\IDE\mspdb110.dll" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\amd64\mspdbsrv.exe" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\amd64\mspdbcore.dll" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\amd64\mspdb110.dll" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\x86_amd64\*.*" mingw64\bin\
)

ECHO.
ECHO "Create windows 64bit library directory..."
ECHO.

IF NOT EXIST mingw64\win64bitlibs (
    mkdir mingw64\win64bitlibs
)

ECHO.
ECHO "Copy 64 bit system libraries..."
ECHO.

COPY %WINDIR%\System32\gdi32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\msimg32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\ws2_32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\crypt32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\Wldap32.dll mingw64\win64bitlibs /y

move mingw64\win64bitlibs\gdi32.dll mingw64\win64bitlibs\libgdi32.dll
move mingw64\win64bitlibs\msimg32.dll mingw64\win64bitlibs\libmsimg32.dll
move mingw64\win64bitlibs\ws2_32.dll mingw64\win64bitlibs\libws2_32.dll
move mingw64\win64bitlibs\crypt32.dll mingw64\win64bitlibs\libcrypt32.dll
move mingw64\win64bitlibs\Wldap32.dll mingw64\win64bitlibs\libwldap32.dll

ECHO.
ECHO "Copy 32 bit system libraries..."
ECHO.

IF NOT EXIST mingw64\win32bitlibs (
    mkdir mingw64\win32bitlibs
)

COPY %WINDIR%\SysWOW64\gdi32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\msimg32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\ws2_32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\crypt32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\Wldap32.dll mingw64\win32bitlibs /y

move mingw64\win32bitlibs\gdi32.dll mingw64\win32bitlibs\libgdi32.dll
move mingw64\win32bitlibs\msimg32.dll mingw64\win32bitlibs\libmsimg32.dll
move mingw64\win32bitlibs\ws2_32.dll mingw64\win32bitlibs\libws2_32.dll
move mingw64\win32bitlibs\crypt32.dll mingw64\win32bitlibs\libcrypt32.dll
move mingw64\win32bitlibs\Wldap32.dll mingw64\win32bitlibs\libwldap32.dll

REM ===========================================================================
REM STARTBUILD
REM ===========================================================================
ECHO.
ECHO "Getting Started..."
ECHO.

IF %MINGLE_SUITE% EQU 0 (
msys\bin\mintty msys/bin/bash -l -c "/mingw/bin/mingle | tee /home/developer/build.log"
) ELSE (
msys\bin\mintty msys/bin/bash -l -c "/mingw/bin/mingle --suite=%MINGLE_SUITE% 2>&1 | tee /home/developer/build.log"
)

IF EXIST msys\home\developer\build.log (
    COPY /Y msys\home\developer\build.log .
)

ECHO.
ECHO "Setup Complete."
ECHO.

:EXIT

@ECHO off
@setlocal enableextensions
@cd /d "%~dp0"

REM http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights

NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
   ECHO.
   ECHO "Administrator PRIVILEGES Detected!"
   ECHO.
) ELSE (
   ECHO.
   ECHO ##########################################################
   ECHO.
   ECHO.
   ECHO ######## ########  ########   #######  ########
   ECHO ##       ##     ## ##     ## ##     ## ##     ##
   ECHO ##       ##     ## ##     ## ##     ## ##     ##
   ECHO ######   ########  ########  ##     ## ########
   ECHO ##       ##   ##   ##   ##   ##     ## ##   ##
   ECHO ##       ##    ##  ##    ##  ##     ## ##    ##
   ECHO ######## ##     ## ##     ##  #######  ##     ##
   ECHO.
   ECHO.
   ECHO ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED #########
   ECHO This script must be run as administrator to work properly!
   ECHO If you're seeing this after clicking on a start menu icon,
   ECHO then right click on the shortcut and select
   ECHO "Run As Administrator".
   ECHO ##########################################################
   ECHO.
   PAUSE
   EXIT /B 1
)

if not exist "packages" mkdir packages

REM ===========================================================================
REM SET EXECUTION POLICY
REM ===========================================================================

ECHO "Set Execution Policy..."
ECHO.

powershell -command "Set-ExecutionPolicy Unrestricted"

REM ===========================================================================
REM DOWNLOAD TOOLS
REM ===========================================================================

set MSYSTOOLS="MSYS-20111123.zip"

if not exist "packages\%MSYSTOOLS%" (
     ECHO "Downloading msys..."
     powershell -command ". .\mingle\Get-WebFile.ps1; Get-WebFile -url 'http://sourceforge.net/projects/mingw-w64/files/External binary packages (Win64 hosted)/MSYS (32-bit)/%MSYSTOOLS%/download' -fileName 'packages\\%MSYSTOOLS%'"
)

if not exist "packages\%MSYSTOOLS%" (
    ECHO "Failed to download MSYS!"
    ECHO.
    EXIT /B 1
)

REM Best so far.
set GCCCOMPILER=x86_64-w64-mingw32-gcc-4.7.2-release-win64_rubenvb.7z
set GCCURL="'http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/rubenvb/gcc-4.7-release/%GCCCOMPILER%/download'"

REM set GCCCOMPILERUPDATE=x86_64-w64-mingw32-mingw-w64-update-trunk-20130115_rubenvb.7z
REM set GCCUPDATEURL="'http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/rubenvb/update/%GCCCOMPILERUPDATE%/download'"

REM set GCCCOMPILER=mingw-w64-bin-x86_64-20130104.7z
REM set GCCURL="'http://www.drangon.org/mingw/mirror.php?num=2&fname=mingw-w64-bin-x86_64-20130104.7z'"

REM set GCCCOMPILER=x64-4.7.2-release-posix-sjlj-rev9.7z
REM set GCCURL="'http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/64-bit/threads-posix/sjlj/%GCCCOMPILER%/download'"

if not exist "packages\%GCCCOMPILER%" (
    ECHO "Downloading %GCCCOMPILER%..."
    powershell -command ". .\mingle\Get-WebFile.ps1; Get-WebFile -url %GCCURL% -fileName 'packages\\%GCCCOMPILER%'"
)

REM if not exist "packages\%GCCCOMPILERUPDATE%" (
REM     ECHO "Downloading %GCCCOMPILERUPDATE%..."
REM     powershell -command ". .\mingle\Get-WebFile.ps1; Get-WebFile -url %GCCUPDATEURL% -fileName 'packages\\%GCCCOMPILERUPDATE%'"
REM )

if not exist "packages\%GCCCOMPILER%" (
    ECHO "Failed to download compiler!"
    ECHO.
    EXIT /B 1
)

REM ===========================================================================
REM EXTRACTING TOOLS
REM ===========================================================================

if not exist "msys" (
    ECHO "Extracting MSYS..."
    ECHO.
    mingle\unzip packages\MSYS-20111123.zip
)

if not exist "mingw64" (
    ECHO "Extracting GCC..."
    ECHO.
    mingle\7za x packages\%GCCCOMPILER%
REM     mingle\7za x -y packages\%GCCCOMPILERUPDATE% -ir!*mingw64\x86_64-w64-mingw32*
)

IF EXIST "mingw" (
    MOVE mingw mingw64
)

IF NOT EXIST "mingw64\bin\gcc.exe" (
    ECHO "Failed to install GCC!"
    ECHO.
    EXIT /B 1
)

IF EXIST "mingw64\bin\lib" (
    ECHO Not sure why these python libraries exist in bin. We will remove and reinstall later after we build Python. Otherwise, this will interfere with the msvc lib command.
    DEL /s /Q mingw64\bin\lib
    RMDIR /S /Q mingw64\bin\lib
)

IF NOT EXIST "msys.lnk" (
ECHO "Creating shortcut..."
ECHO.
powershell -command ". .\mingle\createShortcut.ps1; createShortcut -TargetPath '%CD%\msys\msys.bat' -LinkPath '.\msys.lnk'"
)

REM ===========================================================================
REM RESET EXECUTION POLICY
REM ===========================================================================

ECHO "Reset Execution Policy..."
ECHO.

powershell -command "Set-ExecutionPolicy Restricted"

REM ===========================================================================
REM SETUP FSTAB
REM ===========================================================================
IF NOT EXIST "msys/etc/fstab" (
    ECHO "Setup MSYS..."
    ECHO.
    msys\bin\bash -l -c "ECHO '%CD%\mingw64' /mingw>/etc/fstab"
    if not exist "msys\home\developer" mkdir "%CD%\msys\home\developer"
) ELSE (
    msys\bin\bash -l -c "grep '/mingw' /etc/fstab>/dev/null"
    IF %ERRORLEVEL% EQU 1 (
        ECHO "Setup MSYS..."
        ECHO.

        msys\bin\bash -l -c "ECHO '%CD%\mingw64' /mingw>/etc/fstab"
        if not exist "msys\home\developer" mkdir "%CD%\msys\home\developer"
    )
)

REM ===========================================================================
REM GET BUILD SCRIPTS IN ORDER
REM ===========================================================================
ECHO.
ECHO "Copy build scripts and configs..."
ECHO.

XCOPY /Y /Q /D mingle\mingw.jam msys\home\developer\
XCOPY /Y /Q /D mingle\mingle.sh mingw64\bin

IF EXIST "mingw64\bin\mingle.sh" (
MOVE /Y mingw64\bin\mingle.sh mingw64\bin\mingle
)

IF NOT EXIST "msys\home\developer\patches" MKDIR msys\home\developer\patches
XCOPY /S /Y /Q /D patches msys\home\developer\patches

REM ===========================================================================
REM PROCESS ARGUMENTS
REM ===========================================================================
set MINGLE_SUITE=0
:Loop
IF "%1"=="" GOTO Continue
IF "%1"=="-s" GOTO SUITE
IF "%1"=="--suite" GOTO SUITE
IF "%1"=="/?" (
  GOTO HELP
) ELSE (
  GOTO INVALID
)

SHIFT
GOTO Loop

:HELP
ECHO.
ECHO ===========================================================================
ECHO Mingle - HELP
ECHO ===========================================================================
ECHO.
ECHO This is the Windoes command shell wrapper which deploys the MinGW 64bit
ECHO development environment. Please select from one of the following options:
ECHO.
ECHO Usage: setup.bat [--suite=#selection]
ECHO.
ECHO   -s, --suite Specify a reference number from one of the suites listed below.
ECHO.

msys\bin\bash -l -c "/mingw/bin/mingle -l"

GOTO EXIT

:INVALID

ECHO.
ECHO Invalid Option
ECHO.

GOTO HELP

:SUITE

set MINGLE_SUITE=%2

ECHO.
ECHO.
ECHO Deploying selected development environment (%MINGLE_SUITE%):
ECHO.

msys\bin\bash -l -c "/mingw/bin/mingle -m %MINGLE_SUITE%"

IF %MINGLE_SUITE% GTR %ERRORLEVEL% (
ECHO.
ECHO Invalid selection! You can only choose from one of the following:
ECHO.
msys\bin\bash -l -c "cd /mingw/bin;./mingle -l"
GOTO EXIT
)

msys\bin\bash -l -c "/mingw/bin/mingle -k %MINGLE_SUITE%"
ECHO.

GOTO Continue

REM ===========================================================================
REM CONTINUE
REM ===========================================================================
:Continue

ECHO "Make Sure Previous PYTHONPATH is cleared..."
ECHO.

COPY mingle\profile msys\etc

ECHO "Checking for Visual Studio 2012 Express for Windows Desktop..."
ECHO.
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0"
ECHO.

if ERRORLEVEL 1 (
ECHO "Please Install Visual Studio 2012 Express for Windows Desktop before proceeding"
ECHO "VS includes MASM, ml64.exe, which is used to build boost libraries."

ECHO Visit: http://www.microsoft.com/visualstudio/eng/downloads
ECHO Direct Link: http://go.microsoft.com/?linkid=9816758
ECHO.

pause
EXIT /B 1
)

if not exist "mingw64\bin\ml64.exe" (
    ECHO "Retrieve MASM..."

    if not exist "%VS110COMNTOOLS%..\..\VC\bin\x86_amd64" (
       ECHO.
       ECHO ##########################################################
       ECHO.
       ECHO.
       ECHO ######## ########  ########   #######  ########
       ECHO ##       ##     ## ##     ## ##     ## ##     ##
       ECHO ##       ##     ## ##     ## ##     ## ##     ##
       ECHO ######   ########  ########  ##     ## ########
       ECHO ##       ##   ##   ##   ##   ##     ## ##   ##
       ECHO ##       ##    ##  ##    ##  ##     ## ##    ##
       ECHO ######## ##     ## ##     ##  #######  ##     ##
       ECHO.
       ECHO.
       ECHO ###### ERROR: VISUAL STUDIO 2012 EXPRESS REQUIRED ########
       ECHO Something is quirky on your machine. Did you not install
       ECHO to the typicl path? You will have to manually copy MASM
       ECHO to your install. Look for the files in your VS2012 install:
       ECHO "Microsoft Visual Studio 11.0\VC\bin\x86_amd64".
       ECHO ##########################################################
       ECHO.
       PAUSE
       EXIT /B 1
    )

    REM BUG!!!copy "%VS110COMNTOOLS%..\IDE\mspdb110.dll" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\amd64\mspdbsrv.exe" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\amd64\mspdbcore.dll" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\amd64\mspdb110.dll" mingw64\bin\
    REM copy "%VS110COMNTOOLS%..\..\VC\bin\x86_amd64\*.*" mingw64\bin\
)

ECHO.
ECHO "Create windows 64bit library directory..."
ECHO.

IF NOT EXIST mingw64\win64bitlibs (
    mkdir mingw64\win64bitlibs
)

ECHO.
ECHO "Copy 64 bit system libraries..."
ECHO.

COPY %WINDIR%\System32\gdi32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\msimg32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\ws2_32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\crypt32.dll mingw64\win64bitlibs /y
COPY %WINDIR%\System32\Wldap32.dll mingw64\win64bitlibs /y

move mingw64\win64bitlibs\gdi32.dll mingw64\win64bitlibs\libgdi32.dll
move mingw64\win64bitlibs\msimg32.dll mingw64\win64bitlibs\libmsimg32.dll
move mingw64\win64bitlibs\ws2_32.dll mingw64\win64bitlibs\libws2_32.dll
move mingw64\win64bitlibs\crypt32.dll mingw64\win64bitlibs\libcrypt32.dll
move mingw64\win64bitlibs\Wldap32.dll mingw64\win64bitlibs\libwldap32.dll

ECHO.
ECHO "Copy 32 bit system libraries..."
ECHO.

IF NOT EXIST mingw64\win32bitlibs (
    mkdir mingw64\win32bitlibs
)

COPY %WINDIR%\SysWOW64\gdi32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\msimg32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\ws2_32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\crypt32.dll mingw64\win32bitlibs /y
COPY %WINDIR%\SysWOW64\Wldap32.dll mingw64\win32bitlibs /y

move mingw64\win32bitlibs\gdi32.dll mingw64\win32bitlibs\libgdi32.dll
move mingw64\win32bitlibs\msimg32.dll mingw64\win32bitlibs\libmsimg32.dll
move mingw64\win32bitlibs\ws2_32.dll mingw64\win32bitlibs\libws2_32.dll
move mingw64\win32bitlibs\crypt32.dll mingw64\win32bitlibs\libcrypt32.dll
move mingw64\win32bitlibs\Wldap32.dll mingw64\win32bitlibs\libwldap32.dll

REM ===========================================================================
REM STARTBUILD
REM ===========================================================================
ECHO.
ECHO "Getting Started..."
ECHO.

IF %MINGLE_SUITE% EQU 0 (
msys\bin\mintty msys/bin/bash -l -c "/mingw/bin/mingle | tee /home/developer/build.log"
) ELSE (
msys\bin\mintty msys/bin/bash -l -c "/mingw/bin/mingle --suite=%MINGLE_SUITE% 2>&1 | tee /home/developer/build.log"
)

IF EXIST msys\home\developer\build.log (
    COPY /Y msys\home\developer\build.log .
)

ECHO.
ECHO "Setup Complete."
ECHO.

:EXIT

resolve etc setup issue.

resolve etc setup issue.


rem CMake/MinGW workaround - remove sh.exe from PATH
where sh
set MINGW=C:\Qt\Tools\mingw530_32
set QTDIR=C:\Qt\5.7\mingw53_32
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
set CMAKE_PREFIX_PATH=%QTDIR%
set PATH=%MINGW%\bin;%PATH%;%QTDIR%\bin
:: Qt needs to find the windows platform plugin to run tests
set QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../INSTALL .. || goto :error
cmake --build . --target install || goto :error
ctest -VV || goto :error

goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

rem CMake/MinGW workaround - remove sh.exe from PATH
where sh
set MINGW=C:\Qt\Tools\mingw530_32
set QTDIR=C:\Qt\5.11.0\mingw53_32
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
set CMAKE_PREFIX_PATH=%QTDIR%
set PATH=%MINGW%\bin;%PATH%;%QTDIR%\bin
:: Qt needs to find the windows platform plugin to run tests
set QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../INSTALL .. || goto :error
cmake --build . --target install || goto :error
ctest -VV || goto :error

goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

Bump Qt/MSVC version to 5.11

Appveyor: Bump Qt/MSVC version to 5.11


@echo off

:: This wrapper calls the LifePool manifest parser

set MF_HOST=mediaflux.vicnode.org.au
set MF_PORT=443
set MF_TRANSPORT=HTTPS
set MF_TOKEN=***REMOVED***
set CID=1128.1.3
set JAR=%~dp0daris-lifepool-parse-1.0-jar-with-dependencies.jar

:: check if the jar file exists
if not exist %JAR% (
    echo "Error: could not find %JAR%"
    exit 1
)

:: execute the jar
java -Dmf.host=%MF_HOST% -Dmf.port=%MF_PORT% -Dmf.transport=%MF_TRANSPORT% -Dmf.domain=%MF_DOMAIN% -Dmf.user=%MF_USER% -Dmf.password=%MF_PASSWORD% -Dmf.token=%MF_TOKEN% -cp %JAR%  vicnode.daris.lifepool.ParseManifest -cid %CID% %*

Create parse-manifest.cmd

Create parse-manifest.cmd

dos batch wrapper


@echo off

set CURDIR=%CD%

cd /d %~dp0

set MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"

set TARGET=Build
set CONFIG=%1
set PLATFORM=%2

if not defined CONFIG (
    set CONFIG=Debug
)

if not defined PLATFORM (
    set PLATFORM=x64
)

rem glfw =============================

set BUILD_DIR=glfw\%PLATFORM%
set ROOT=..\..

if not exist %BUILD_DIR% (
    mkdir %BUILD_DIR%
)

if not exist %BUILD_DIR%\GLFW.sln (
    cd %BUILD_DIR%
    if %PLATFORM% == Win32 (
        %ROOT%\cmake\bin\cmake.exe -G "Visual Studio 14 2015" ..\
    ) else (
        %ROOT%\cmake\bin\cmake.exe -G "Visual Studio 14 2015 Win64" ..\
    )
    cd %ROOT%
)

%MSBUILD% %BUILD_DIR%\GLFW.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem glew =============================

set BUILD_DIR=glew\build\vc12

%MSBUILD% %BUILD_DIR%\glew.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem end ==============================

rem Copy files for Profile configuration ==============================
if %CONFIG% == Release (
   cd /d %~dp0
   xcopy /Y /D glfw\%PLATFORM%\src\Release glfw\%PLATFORM%\src\Profile\
   xcopy /Y /D glew\lib\Release\%PLATFORM% glew\lib\Profile\%PLATFORM%\
)

cd /d %CURDIR%

exit /b 0

:error
cd /d %CURDIR%
echo "Error====="
pause
exit /b 1

@echo off

set CURDIR=%CD%

cd /d %~dp0

set MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"

set TARGET=Build
set CONFIG=%1
set PLATFORM=%2

if not defined CONFIG (
    set CONFIG=Debug
)

if not defined PLATFORM (
    set PLATFORM=x64
)

rem glfw =============================

set BUILD_DIR=glfw\%PLATFORM%
set ROOT=..\..

if not exist %BUILD_DIR% (
    mkdir %BUILD_DIR%
)

if not exist %BUILD_DIR%\GLFW.sln (
    cd %BUILD_DIR%
    if %PLATFORM% == Win32 (
        %ROOT%\cmake\bin\cmake.exe -G "Visual Studio 14 2015" ..\
    ) else (
        %ROOT%\cmake\bin\cmake.exe -G "Visual Studio 14 2015 Win64" ..\
    )
    cd %ROOT%
)

%MSBUILD% %BUILD_DIR%\GLFW.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem glew =============================

set BUILD_DIR=glew\build\vc12

%MSBUILD% %BUILD_DIR%\glew.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem makeitso =========================

set BUILD_DIR=makeitso

%MSBUILD% %BUILD_DIR%\MakeItSoLib\MakeItSoLib.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error
%MSBUILD% %BUILD_DIR%\SolutionParser_VS2015\SolutionParser_VS2015.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error
%MSBUILD% %BUILD_DIR%\MakeItSo\MakeItSo.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error

rem end ==============================

rem Copy files for Profile configuration ==============================
if %CONFIG% == Release (
   cd /d %~dp0
   xcopy /Y /D glfw\%PLATFORM%\src\Release glfw\%PLATFORM%\src\Profile\
   xcopy /Y /D glew\lib\Release\%PLATFORM% glew\lib\Profile\%PLATFORM%\
)

cd /d %CURDIR%

exit /b 0

:error
cd /d %CURDIR%
echo "Error====="
pause
exit /b 1

Modify to build makeitso.

Modify to build makeitso.


:<<"::CMDLITERAL"
@ECHO OFF
REM  Usage:
REM powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/jgstew/tools/master/CMD/install_bigfix.bat', 'install_bigfix.bat') }" -ExecutionPolicy Bypass
REM install_bigfix.bat __FQDN_OF_ROOT_OR_RELAY__

REM    Source: https://github.com/jgstew/tools/blob/master/CMD/install_bigfix.bat
REM   Related: https://github.com/jgstew/tools/blob/master/bash/install_bigfix.sh

REM http://stackoverflow.com/questions/2541767/what-is-the-proper-way-to-test-if-variable-is-empty-in-a-batch-file-if-not-1
IF [%1] == [] ECHO please provide FQDN for root or relay && EXIT /B
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

@ECHO ON
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', '%BASEFOLDER%\actionsite.afxm') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', '%BASEFOLDER%\BESClient.exe') }" -ExecutionPolicy Bypass
@ECHO OFF

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
REM http://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if variable is set
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/ >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Log_Days=30 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000 >> %BASEFOLDER%\clientsettings.cfg

ECHO %0
ECHO %1
ECHO %MASTHEADURL%
ECHO
ECHO Installing BigFix now.
%BASEFOLDER%\BESClient.exe /s /v"/l*voicewarmup %BASEFOLDER%\install.log /qn"

EXIT /B
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
REM  Usage:
REM powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/jgstew/tools/master/CMD/install_bigfix.bat', 'install_bigfix.bat') }" -ExecutionPolicy Bypass
REM install_bigfix.bat __FQDN_OF_ROOT_OR_RELAY__

REM    Source: https://github.com/jgstew/tools/blob/master/CMD/install_bigfix.bat
REM   Related: https://github.com/jgstew/tools/blob/master/bash/install_bigfix.sh

REM http://stackoverflow.com/questions/2541767/what-is-the-proper-way-to-test-if-variable-is-empty-in-a-batch-file-if-not-1
IF [%1] == [] ECHO please provide FQDN for root or relay && EXIT /B
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

@ECHO ON
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', '%BASEFOLDER%\actionsite.afxm') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', '%BASEFOLDER%\BESClient.exe') }" -ExecutionPolicy Bypass
@ECHO OFF

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
REM http://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if variable is set
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/ >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Log_Days=30 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000 >> %BASEFOLDER%\clientsettings.cfg

ECHO
ECHO %0
ECHO %1
ECHO %MASTHEADURL%
ECHO
ECHO Installing BigFix now.
%BASEFOLDER%\BESClient.exe /s /v"/l*voicewarmup %BASEFOLDER%\install.log /qn"

EXIT /B
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
ECHO > C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:port/bfmirror/downloads/>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Log_Days=30>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000>> C:\Windows\Temp\clientsettings.cfg

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
ECHO > %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:port/bfmirror/downloads/>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Log_Days=30>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000>> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000>> C:\Windows\Temp\clientsettings.cfg

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat