cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -version 0.2.1-beta4-10133 -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f build.shade %*

cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f build.shade %*

Update build.cmd

Update build.cmd

H


@echo off

set nsis_compiler=

if defined NSIS_HOME (
    if exist "%NSIS_HOME%\makensis.exe" (
        set "nsis_compiler=%NSIS_HOME%"
    )
)

if %PROCESSOR_ARCHITECTURE%==x86 (
    set RegQry=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
) else (
    set RegQry=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
)

if not defined nsis_compiler (
    for /F "tokens=2*" %%a in ('reg query "%RegQry%" /v InstallLocation ^|findstr InstallLocation') do set nsis_compiler=%%b
)

if not defined nsis_compiler (
    for %%X in (makensis.exe) do (set nsis_compiler=%%~dp$PATH:X)
)

set args=
:loop
    set args=%args% %1
    shift
if not "%~1"=="" goto loop

if defined nsis_compiler (
    "%nsis_compiler%\makensis.exe" %args%
) else (
    echo "Error, build system cannot find NSIS! Please reinstall it, add makensis.exe to your PATH, or defined the NSIS_HOME environment variable."
)

@echo off

set nsis_compiler=

if defined NSIS_HOME (
    if exist "%NSIS_HOME%\makensis.exe" (
        set "nsis_compiler=%NSIS_HOME%"
    )
)

if %PROCESSOR_ARCHITECTURE%==x86 (
    set RegQry=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
) else (
    set RegQry=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
)

if not defined nsis_compiler (
    for /F "tokens=2*" %%a in ('reg query "%RegQry%" /v InstallLocation ^|findstr InstallLocation') do set nsis_compiler=%%b
)

if not defined nsis_compiler (
    for %%X in (makensis.exe) do (set nsis_compiler=%%~dp$PATH:X)
)

set args=
:loop
    set args=%args% %1
    shift
if not "%~1"=="" goto loop

if defined nsis_compiler (
    "%nsis_compiler%\makensis.exe" %args%
) else (
    echo "Error, build system cannot find NSIS! Please reinstall it, and make sure makensis.exe is in to your PATH or NSIS_HOME environment variable."
)

modify error message

modify error message


@echo off
cd %~dp0

SETLOCAL ENABLEEXTENSIONS
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

:run
CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86
CALL packages\KoreBuild\build\kpm restore
CALL packages\KoreBuild\build\kvm build

:end
exit /b %ERRORLEVEL%

Add build.cmd

Add build.cmd


@echo off
powershell.exe .\build.ps1 "%*"

Add build script for windows for running outside of PowerShell


@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
IF DEFINED BUILDCMD_RELEASE (
	.nuget\NuGet.exe install KoreBuild -version 0.2.1-%BUILDCMD_RELEASE% -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF DEFINED BUILDCMD_RELEASE (
	CALL packages\KoreBuild\build\dnvm install 1.0.0-%BUILDCMD_RELEASE% -runtime CLR -arch x86 -a default
) ELSE (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
	.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.nuget\NuGet.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Enable pinning build script

Enable pinning build script


@echo off
setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86
set GITROCKET_ZIP=git-rocket-filter-v1.0.zip
set GITROCKET_RELEASE_FOLDER=%~dp0\Bin\Release
RMDIR /S /Q "%GITROCKET_RELEASE_FOLDER%"
msbuild /tv:4.0 /t:Build /verbosity:quiet /clp:ErrorsOnly /fl /flp:logfile=BuildErrors.log;ErrorsOnly "/p:Configuration=Release;Platform=Any CPU" GitRocketFilter.sln
if %ERRORLEVEL% NEQ 0 GOTO :EXIT_ERROR
XCOPY /Y /D Readme.md "%GITROCKET_RELEASE_FOLDER%"
XCOPY /Y /D License.txt "%GITROCKET_RELEASE_FOLDER%"
DEL  "%GITROCKET_RELEASE_FOLDER%\*.xml" "%GITROCKET_RELEASE_FOLDER%\*.pdb"
PUSHD "%GITROCKET_RELEASE_FOLDER%"
DEL "%~dp0\%GITROCKET_ZIP%"
"%~dp0\external\7-Zip\7z.exe" a "%~dp0\%GITROCKET_ZIP%" .
POPD
goto :EOF
:EXIT_ERROR
echo "Unexpected errors while building git-rocket-filter"

Add the build.bat script

Add the build.bat script


@echo off
setlocal

@rem There is some funkiness wrt set command in a for statement in an if
@rem block when setlocal is true.  Consequently set set bld_root up here
@rem rather than in an if block.
set this_fqn=%~f0
for %%i in ( %this_fqn% ) do set bld_root=%%~dp%i

if defined JAVA_HOME (
  if not defined DEBUG_ENABLED set DEBUG_ENABLED=false
  if not defined WEBLOGIC_HOME set WEBLOGIC_HOME=C:\bea\weblogic700\server

  set default_target=orbeon-dist-packages
  set target=%1
  if not defined target (
    set target=!default_target!
    echo Defaulting to target !default_target!
    echo .
  )

  @rem set CLASSPATH=%bld_root%lib\junit.jar
  set PATH=%JAVA_HOME%\bin;%PATH%
  set ANT_HOME=%bld_root%tools\ant
  echo "!ANT_HOME!\bin\ant.bat" "-Djava.home=!JAVA_HOME!" "-Dant.home=!ANT_HOME!" "-Ddebug.enabled=!DEBUG_ENABLED!" "-Dweblogic.home=!WEBLOGIC_HOME!" !target! %2 %3 %4 %5 %6 %7 %8 %9
  "!ANT_HOME!\bin\ant.bat" "-Djava.home=!JAVA_HOME!" "-Dant.home=!ANT_HOME!" "-Ddebug.enabled=!DEBUG_ENABLED!" "-Dweblogic.home=!WEBLOGIC_HOME!" !target! %2 %3 %4 %5 %6 %7 %8 %9

) else (
  echo env var JAVA_HOME must be set to the location of a jdk.
  echo The jdk version must be 1.4 or higher.
)

@echo off
setlocal ENABLEDELAYEDEXPANSION

@rem There is some funkiness wrt set command in a for statement in an if
@rem block when setlocal is true.  Consequently set set bld_root up here
@rem rather than in an if block.
set this_fqn=%~f0
for %%i in ( %this_fqn% ) do set bld_root=%%~dp%i

if defined JAVA_HOME (
  if not defined DEBUG_ENABLED set DEBUG_ENABLED=false
  if not defined WEBLOGIC_HOME set WEBLOGIC_HOME=C:\bea\weblogic700\server

  set default_target=orbeon-dist-packages
  set target=%1
  if not defined target (
    set target=!default_target!
    echo Defaulting to target !default_target!
    echo .
  )

  @rem set CLASSPATH=%bld_root%lib\junit.jar
  set PATH=%JAVA_HOME%\bin;%PATH%
  set ANT_HOME=%bld_root%tools\ant
  echo "!ANT_HOME!\bin\ant.bat" "-Djava.home=!JAVA_HOME!" "-Dant.home=!ANT_HOME!" "-Ddebug.enabled=!DEBUG_ENABLED!" "-Dweblogic.home=!WEBLOGIC_HOME!" !target! %2 %3 %4 %5 %6 %7 %8 %9
  "!ANT_HOME!\bin\ant.bat" "-Djava.home=!JAVA_HOME!" "-Dant.home=!ANT_HOME!" "-Ddebug.enabled=!DEBUG_ENABLED!" "-Dweblogic.home=!WEBLOGIC_HOME!" !target! %2 %3 %4 %5 %6 %7 %8 %9

) else (
  echo env var JAVA_HOME must be set to the location of a jdk.
  echo The jdk version must be 1.4 or higher.
)

Set ENABLEDELAYEDEXPANSION

Set ENABLEDELAYEDEXPANSION


@echo off

powershell -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' %*;"

@echo off

pwsh -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' %*;"

Switch from running the build script with the Windows-only `powershell` commmand to the cross-platform Powershell 7 command `pwsh`.


@echo off
setlocal

: Check which branch we are on, or just assume master if we are not in a git repository
for /f %%z in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%z
if not defined GIT_BRANCH (
    set GIT_BRANCH=master
)

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="latest" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="update" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="compile" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage=current
    set _bootstrap_factor=0
) else if "%1"=="self-bootstrap" (
    set _git_pull=1
    set _compile_vm=0
    set _bootimage=make
    set _bootstrap_factor=1
) else if "%1"=="bootstrap" (
    set _git_pull=0
    set _compile_vm=0
    set _bootimage=current
    set _bootstrap_factor=1
) else if "%1"=="net-bootstrap" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

echo Deleting staging images from temp/...
del temp\staging.*.image

if "%_git_pull%"=="1" (
    echo Updating working copy from %GIT_BRANCH%...
    call git pull https://github.com/factor/factor %GIT_BRANCH%
    if errorlevel 1 goto fail
)

if "%_compile_vm%"=="1" (
    echo Building vm...
    nmake /nologo /f Nmakefile clean
    if errorlevel 1 goto fail

    nmake /nologo /f Nmakefile %_target%
    if errorlevel 1 goto fail
)

if "%_bootimage%"=="download" (
    echo Fetching %GIT_BRANCH% boot image...
    set boot_image_url=http://downloads.factorcode.org/images/%GIT_BRANCH%/%_bootimage% %_bootimage%
    echo URL: %boot_image_url%
    cscript /nologo misc\http-get.vbs %boot_image_url% %_bootimage%
    if errorlevel 1 goto fail
) else if "%_bootimage%"=="make" (
    echo Making boot image...
    .\factor.com -run=bootstrap.image %_bootimage%
    if errorlevel 1 goto fail
)

if "%_bootstrap_factor%"=="1" (
    echo Bootstrapping...
    .\factor.com -i=%_bootimage%
    if errorlevel 1 goto fail

    echo Copying fresh factor.image to factor.image.fresh.
    copy factor.image factor.image.fresh
    if errorlevel 1 goto fail
)

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build.cmd [command]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo:
echo     The branch that bootstraps is the one that is checked out locally.
echo:
echo     compile - recompile vm
echo     update - git pull, recompile vm, download a boot image, bootstrap
echo     self-bootstrap - git pull, make a boot image, bootstrap
echo     bootstrap - existing boot image, bootstrap
echo     net-bootstrap - recompile vm, download a boot image, bootstrap
goto :EOF

@echo off
setlocal

: Check which branch we are on, or just assume master if we are not in a git repository
for /f %%z in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%z
if not defined GIT_BRANCH (
    set GIT_BRANCH=master
)

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage_type=download
    set _bootstrap_factor=1
) else if "%1"=="latest" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage_type=download
    set _bootstrap_factor=1
) else if "%1"=="update" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage_type=download
    set _bootstrap_factor=1
) else if "%1"=="compile" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage_type=current
    set _bootstrap_factor=0
) else if "%1"=="self-bootstrap" (
    set _git_pull=1
    set _compile_vm=0
    set _bootimage_type=make
    set _bootstrap_factor=1
) else if "%1"=="bootstrap" (
    set _git_pull=0
    set _compile_vm=0
    set _bootimage_type=current
    set _bootstrap_factor=1
) else if "%1"=="net-bootstrap" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage_type=download
    set _bootstrap_factor=1
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

echo Deleting staging images from temp/...
del temp\staging.*.image

if "%_git_pull%"=="1" (
    echo Updating working copy from %GIT_BRANCH%...
    call git pull https://github.com/factor/factor %GIT_BRANCH%
    if errorlevel 1 goto fail
)

if "%_compile_vm%"=="1" (
    echo Building vm...
    nmake /nologo /f Nmakefile clean
    if errorlevel 1 goto fail

    nmake /nologo /f Nmakefile %_target%
    if errorlevel 1 goto fail
)

if "%_bootimage_type%"=="download" (
    echo Fetching %GIT_BRANCH% boot image...
    set boot_image_url=http://downloads.factorcode.org/images/%GIT_BRANCH%/%_bootimage% %_bootimage%
    echo URL: %boot_image_url%
    cscript /nologo misc\http-get.vbs %boot_image_url% %_bootimage%
    if errorlevel 1 goto fail
) else if "%_bootimage_type%"=="make" (
    echo Making boot image...
    .\factor.com -run=bootstrap.image %_bootimage%
    if errorlevel 1 goto fail
)

if "%_bootstrap_factor%"=="1" (
    echo Bootstrapping...
    .\factor.com -i=%_bootimage%
    if errorlevel 1 goto fail

    echo Copying fresh factor.image to factor.image.fresh.
    copy factor.image factor.image.fresh
    if errorlevel 1 goto fail
)

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build.cmd [command]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo:
echo     The branch that bootstraps is the one that is checked out locally.
echo:
echo     compile - recompile vm
echo     update - git pull, recompile vm, download a boot image, bootstrap
echo     self-bootstrap - git pull, make a boot image, bootstrap
echo     bootstrap - existing boot image, bootstrap
echo     net-bootstrap - recompile vm, download a boot image, bootstrap
goto :EOF

fix shadowed variable.

build.cmd: fix shadowed variable.


call "%VS100COMNTOOLS%vsvars32.bat"

mkdir libs
pushd libs
cmake -DWITH_TESTS=YES -G "Visual Studio 10" ../

popd

call "%VS100COMNTOOLS%vsvars32.bat"

mkdir libs
pushd libs
cmake -DWITH_TESTS=YES -G "Visual Studio 10" ../..

popd

Update build_vs10_test.bat

Update build_vs10_test.bat


@echo off
@REM NOTE:
@REM -----
@REM The "luacheck" and "busted" commands must be in the PATH variable

setlocal
SET oldDir=%CD%
SET projectPath=%~dp0..

@REM Run checks
cd %projectPath%
IF %ERRORLEVEL% NEQ 0 (
   exit /b %ERRORLEVEL%
)

call luacheck --quiet --std max+busted lua/LUA
IF %ERRORLEVEL% NEQ 0 (
    echo %ERRORLEVEL%
    exit /b %ERRORLEVEL%
)

call busted --verbose --coverage -o plainTerminal --
IF %ERRORLEVEL% NEQ 0 (
    echo %ERRORLEVEL%
    exit /b %ERRORLEVEL%
)

cd %oldDir%
endlocal

@echo off
@REM NOTE:
@REM -----
@REM The "luacheck" and "busted" commands must be in the PATH variable

setlocal
SET oldDir=%CD%
SET projectPath=%~dp0..

@REM Run checks
cd %projectPath%
IF %ERRORLEVEL% NEQ 0 (
   exit /b %ERRORLEVEL%
)

call luacheck --quiet --std max+busted lua/LUA
IF %ERRORLEVEL% NEQ 0 (
    echo %ERRORLEVEL%
    exit /b %ERRORLEVEL%
)

call busted --verbose --coverage -o plainTerminal -- .
IF %ERRORLEVEL% NEQ 0 (
    echo %ERRORLEVEL%
    exit /b %ERRORLEVEL%
)

cd %oldDir%
endlocal

busted: check lua dir recursively for _spec files


c:\python27\python2 cameo\launcher.py
ECHO
PAUSE
EXIT

add cameo.bat

add cameo.bat


@echo off
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.

rem ---------------------------------------------------------------------------
rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings
rem are valid and consistent with the selected start-up options and set up the
rem endorsed directory.
rem ---------------------------------------------------------------------------

rem Make sure prerequisite environment variables are set

rem In debug mode we need a real JDK (JAVA_HOME)
if ""%1"" == ""debug"" goto needJavaHome

rem Otherwise either JRE or JDK are fine
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit

:needJavaHome
rem Check if we have a usable JDK
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
set "JRE_HOME=%JAVA_HOME%"
goto okJava

:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly.
echo It is needed to run this program in debug mode.
echo NB: JAVA_HOME should point to a JDK not a JRE.
goto exit

:gotJavaHome
rem No JRE given, use JAVA_HOME as JRE_HOME
set "JRE_HOME=%JAVA_HOME%"

:gotJreHome
rem Check if we have a usable JRE
if not exist "%JRE_HOME%\bin\java.exe" goto noJreHome
if not exist "%JRE_HOME%\bin\javaw.exe" goto noJreHome
goto okJava

:noJreHome
rem Needed at least a JRE
echo The JRE_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit

:okJava
rem Don't override the endorsed dir if the user has set it previously
if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir
rem Set the default -Djava.endorsed.dirs argument
set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\endorsed"
:gotEndorseddir

rem Don't override _RUNJAVA if the user has set it previously
if not "%_RUNJAVA%" == "" goto gotRunJava
rem Set standard command for invoking Java.
rem Note that NT requires a window name argument when using start.
rem Also note the quoting as JAVA_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java"
:gotRunJava

rem Don't override _RUNJDB if the user has set it previously
if not "%_RUNJAVA%" == "" goto gotRunJdb
set _RUNJDB="%JAVA_HOME%\bin\jdb"
:gotRunJdb

goto end

:exit
exit /b 1

:end
exit /b 0

@echo off
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.

rem ---------------------------------------------------------------------------
rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings
rem are valid and consistent with the selected start-up options and set up the
rem endorsed directory.
rem ---------------------------------------------------------------------------

rem Make sure prerequisite environment variables are set

rem In debug mode we need a real JDK (JAVA_HOME)
if ""%1"" == ""debug"" goto needJavaHome

rem Otherwise either JRE or JDK are fine
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit

:needJavaHome
rem Check if we have a usable JDK
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
set "JRE_HOME=%JAVA_HOME%"
goto okJava

:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly.
echo It is needed to run this program in debug mode.
echo NB: JAVA_HOME should point to a JDK not a JRE.
goto exit

:gotJavaHome
rem No JRE given, use JAVA_HOME as JRE_HOME
set "JRE_HOME=%JAVA_HOME%"

:gotJreHome
rem Check if we have a usable JRE
if not exist "%JRE_HOME%\bin\java.exe" goto noJreHome
if not exist "%JRE_HOME%\bin\javaw.exe" goto noJreHome
goto okJava

:noJreHome
rem Needed at least a JRE
echo The JRE_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit

:okJava
rem Don't override the endorsed dir if the user has set it previously
if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir
rem Set the default -Djava.endorsed.dirs argument
set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\endorsed"
:gotEndorseddir

rem Don't override _RUNJAVA if the user has set it previously
if not "%_RUNJAVA%" == "" goto gotRunJava
rem Set standard command for invoking Java.
rem Also note the quoting as JRE_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java"
:gotRunJava

rem Don't override _RUNJDB if the user has set it previously
rem Also note the quoting as JAVA_HOME may contain spaces.
if not "%_RUNJAVA%" == "" goto gotRunJdb
set _RUNJDB="%JAVA_HOME%\bin\jdb"
:gotRunJdb

goto end

:exit
exit /b 1

:end
exit /b 0

Improve comments

Improve comments

git-svn-id: 79cef5a5a257cc9dbe40a45ac190115b4780e2d0@1617365 13f79535-47bb-0310-9956-ffa450edef68


@echo off
cls
if not exist tools\FAKE\tools\Fake.exe (
  src\.nuget\nuget.exe install FAKE -OutputDirectory tools -ExcludeVersion -Prerelease
)
tools\FAKE\tools\Fake.exe build.fsx %* Clean "logfile=build-log.xml"
pause

Create clean.bat

Create clean.bat


@echo off
REM @author Sebastian Thomschke, Vegard IT GmbH
REM
REM creates a new release in GitHub and haxelib.org

where zip.exe /Q
if %errorlevel% neq 0 (
    echo Required command 'zip' not found. Download from http://www.info-zip.org/Zip.html#Downloads
    exit /b 1
)

where wget.exe /Q
if %errorlevel% neq 0 (
    echo Required command 'wget' not found. Download from https://eternallybored.org/misc/wget/
    exit /b 1
)

if [%GITHUB_ACCESS_TOKEN%] == [] (
    echo Required environment variable GITHUB_ACCESS_TOKEN is not set!
    exit /b 1
)

setlocal
set DRAFT=false
set PREPRELEASE=false

REM cd into project root
cd %~dp0

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url haxelib.json' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract repo name from haxelib.json
set REPO_NAME=%REPO_URL:https://github.com/=%
echo REPO_NAME=%REPO_NAME%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version haxelib.json' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%
echo PROJECT_VERSION=%PROJECT_VERSION%

REM extract release note from haxelib.json
for /f "tokens=*" %%a in ( 'findstr releasenote haxelib.json' ) do (set textLine=%%a)
set RELEASE_NOTE=%textLine:"releasenote": "=%
set RELEASE_NOTE=%RELEASE_NOTE:",=%
set RELEASE_NOTE=%RELEASE_NOTE:"=%
echo RELEASE_NOTE=%RELEASE_NOTE%

if not exist target mkdir target

REM create haxelib release
if exist target\haxelib-upload.zip (
    del target\haxelib-upload.zip
)
echo Building haxelib release...
zip target\haxelib-upload.zip src haxelib.json LICENSE.txt CONTRIBUTING.md README.md -r -9 || goto :eof

REM create github release https://developer.github.com/v3/repos/releases/#create-a-release
echo Creating GitHub release https://github.com/%REPO_NAME%/releases/tag/v%PROJECT_VERSION%...
(
  echo {
  echo "tag_name":"v%PROJECT_VERSION%",
  echo "name":"v%PROJECT_VERSION%",
  echo "target_commitish":"master",
  echo "body":"%RELEASE_NOTE%",
  echo "draft":%DRAFT%,
  echo "prerelease":%PREPRELEASE%
  echo }
)>target\github_release.json
wget -qO- --post-file=target/github_release.json "https://api.github.com/repos/%REPO_NAME%/releases?access_token=%GITHUB_ACCESS_TOKEN%" || goto :eof

REM submit haxelib release
echo Submitting haxelib release...
haxelib submit target\haxelib-upload.zip

:eof
endlocal

@echo off
REM @author Sebastian Thomschke, Vegard IT GmbH
REM
REM creates a new release in GitHub and haxelib.org

where zip.exe /Q
if %errorlevel% neq 0 (
    echo Required command 'zip' not found. Download from http://www.info-zip.org/Zip.html#Downloads
    exit /b 1
)

where wget.exe /Q
if %errorlevel% neq 0 (
    echo Required command 'wget' not found. Download from https://eternallybored.org/misc/wget/
    exit /b 1
)

if [%GITHUB_ACCESS_TOKEN%] == [] (
    echo Required environment variable GITHUB_ACCESS_TOKEN is not set!
    exit /b 1
)

setlocal
set DRAFT=false
set PREPRELEASE=false

REM cd into project root
pushd .
cd %~dp0..

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url haxelib.json' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract repo name from haxelib.json
set REPO_NAME=%REPO_URL:https://github.com/=%
echo REPO_NAME=%REPO_NAME%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version haxelib.json' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%
echo PROJECT_VERSION=%PROJECT_VERSION%

REM extract release note from haxelib.json
for /f "tokens=*" %%a in ( 'findstr releasenote haxelib.json' ) do (set textLine=%%a)
set RELEASE_NOTE=%textLine:"releasenote": "=%
set RELEASE_NOTE=%RELEASE_NOTE:",=%
set RELEASE_NOTE=%RELEASE_NOTE:"=%
echo RELEASE_NOTE=%RELEASE_NOTE%

if not exist target mkdir target

REM create haxelib release
if exist target\haxelib-upload.zip (
    del target\haxelib-upload.zip
)
echo Building haxelib release...
zip target\haxelib-upload.zip src haxelib.json LICENSE.txt CONTRIBUTING.md README.md -r -9 || goto :eof

REM create github release https://developer.github.com/v3/repos/releases/#create-a-release
echo Creating GitHub release https://github.com/%REPO_NAME%/releases/tag/v%PROJECT_VERSION%...
(
  echo {
  echo "tag_name":"v%PROJECT_VERSION%",
  echo "name":"v%PROJECT_VERSION%",
  echo "target_commitish":"master",
  echo "body":"%RELEASE_NOTE%",
  echo "draft":%DRAFT%,
  echo "prerelease":%PREPRELEASE%
  echo }
)>target\github_release.json
wget -qO- --post-file=target/github_release.json "https://api.github.com/repos/%REPO_NAME%/releases?access_token=%GITHUB_ACCESS_TOKEN%" || goto :eof

REM submit haxelib release
echo Submitting haxelib release...
haxelib submit target\haxelib-upload.zip

:eof
popd
endlocal

fix directory navigation

fix directory navigation


cd VirtIO
call clean.bat
cd ..

cd NetKVM
call clean.bat
cd ..

cd viostor
call clean.bat
cd ..

cd vioscsi
call clean.bat
cd ..

cd Balloon
call cleanall.bat
cd ..

cd vioserial
call cleanall.bat
cd ..

cd viorng
call clean.bat
cd ..

cd pvpanic
call clean.bat
cd ..

cd VirtIO
call clean.bat
cd ..

cd NetKVM
call clean.bat
cd ..

cd viostor
call clean.bat
cd ..

cd vioscsi
call clean.bat
cd ..

cd Balloon
call cleanall.bat
cd ..

cd vioserial
call cleanall.bat
cd ..

cd viorng
call clean.bat
cd ..

cd vioinput
call cleanall.bat
cd ..

cd pvpanic
call clean.bat
cd ..

cd pciserial
call clean.bat
cd ..

cd packaging
call clean.bat
cd ..

add more targets to clean script

add more targets to clean script


@echo off
rem ---------- tools
SET CURL=tools\curl\curl.exe
SET ZIP=tools\7zip\7za.exe

rem ---------- components versions
SET ELASTIC_SEARCH_VERSION=2.3.2

rem ---------- Download packages ----------
if not exist "downloads" mkdir downloads

if not exist "downloads\elasticsearch-%ELASTIC_SEARCH_VERSION%.zip" %CURL% "https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/%ELASTIC_SEARCH_VERSION%/elasticsearch-%ELASTIC_SEARCH_VERSION%.zip" -o downloads\elasticsearch-%ELASTIC_SEARCH_VERSION%.zip
rem --------------------------------------

rem ---------- Unzip packages ----------
rmdir /Q /S temp
mkdir temp

%ZIP% x -otemp downloads\elasticsearch-%ELASTIC_SEARCH_VERSION%.zip

move temp\elasticsearch-%ELASTIC_SEARCH_VERSION% temp\elasticsearch
rem ------------------------------------

rem ---------- Install service ----------
CALL temp\elasticsearch\bin\service.bat install

rem ---------- Start service ----------
CALL temp\elasticsearch\bin\service.bat start

@echo off
rem ---------- tools
SET CURL=tools\curl\curl.exe
SET ZIP=tools\7zip\7za.exe

rem ---------- components versions
SET ELASTIC_SEARCH_VERSION=2.3.2

rem ---------- Download packages ----------
if not exist "downloads" mkdir downloads

if not exist "downloads\elasticsearch-%ELASTIC_SEARCH_VERSION%.zip" %CURL% "https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/%ELASTIC_SEARCH_VERSION%/elasticsearch-%ELASTIC_SEARCH_VERSION%.zip" -o downloads\elasticsearch-%ELASTIC_SEARCH_VERSION%.zip
rem --------------------------------------

rem ---------- Unzip packages ----------
rmdir /Q /S temp
mkdir temp

%ZIP% x -otemp downloads\elasticsearch-%ELASTIC_SEARCH_VERSION%.zip

move temp\elasticsearch-%ELASTIC_SEARCH_VERSION% temp\elasticsearch
rem ------------------------------------

rem ---------- Run Elasticsearch ----------
START temp\elasticsearch\bin\elasticsearch.bat

Fix for starting elasticsearch

Fix for starting elasticsearch


nuget restore -SolutionDirectory ../  ../RockLib.Configuration/RockLib.Configuration.csproj

msbuild /p:Configuration=Release /t:Clean ..\RockLib.Configuration\RockLib.Configuration.csproj

msbuild /p:Configuration=Release /t:Rebuild ..\RockLib.Configuration\RockLib.Configuration.csproj

msbuild /t:pack /p:PackageOutputPath=..\builtPackages  /p:Configuration=Release ..\RockLib.Configuration\RockLib.Configuration.csproj

Add build script

Add build script


cls
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
cl /c /DEBUG ring_opengl33.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl33.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl33.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl33.obj

cls
call ../../../src/locatevc.bat
cl /c /DEBUG ring_opengl33.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl33.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl33.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl33.obj

Update RingOpenGL3.3 - buildvc.bat - use locatevc.bat


CALL conda deactivate
CALL conda clean --all --yes
CALL conda config --set show_channel_urls true
CALL conda config --set channel_priority strict
CALL conda config --prepend channels conda-forge
CALL conda update conda -n base --yes
CALL conda env remove -n ox --yes
CALL conda create -n ox --file "../docker/requirements.txt" --yes
CALL conda activate ox
CALL pip uninstall osmnx --yes
CALL pip install -e ../../.
CALL pip install https://ocf.berkeley.edu/~gboeing/share/python_igraph-0.7.1.post6-cp38-cp38-win_amd64.whl
CALL python -m ipykernel install --user --name ox --display-name "Python (ox)"
CALL conda clean --all --yes
CALL conda env export > environment.yml
CALL conda list
CALL jupyter kernelspec list
CALL ipython -c "import osmnx; print(osmnx.__version__)"

CALL conda deactivate
CALL conda clean --all --yes
CALL conda config --set show_channel_urls true
CALL conda config --set channel_priority strict
CALL conda config --prepend channels conda-forge
CALL conda update conda -n base --yes
CALL conda env remove -n ox --yes
CALL conda create -n ox --file "../docker/requirements.txt" --yes
CALL conda activate ox
CALL pip uninstall osmnx --yes
CALL pip install -e ../../.
CALL pip install https://ocf.berkeley.edu/~gboeing/share/python_igraph-0.7.1.post6-cp38-cp38-win_amd64.whl
CALL python -m ipykernel install --user --name ox --display-name "Python (ox)"
CALL conda clean --all --yes
CALL conda env export > environment.yml
CALL conda list
CALL jupyter kernelspec list
CALL ipython -c "import osmnx; print('OSMnx version', osmnx.__version__)"

update script

update script


setlocal EnableDelayedExpansion

echo ON

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda!CONDA_VERSION!

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "!PLATFORM!"=="x86" set PLATFORM=x86_64

where curl
if !ERRORLEVEL! neq 0 (
    echo "You must first install the cURL program"
    exit /b !ERRORLEVEL!
)

if "%BATCH_MODE%"=="" set BATCH_MODE=false

if not exist !CONDA_DIR! (
    curl https://repo.continuum.io/miniconda/Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe -o miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    if "%BATCH_MODE%"=="true" (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=!CONDA_DIR!
    ) else (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /D=!CONDA_DIR!
    )
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    del miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
)

attrib +h !CONDA_DIR!
if !ERRORLEVEL! neq 0 echo Failed to hide the !CONDA_DIR! directory

set PATH=!CONDA_DIR!;!CONDA_DIR!\Scripts;%PATH%

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes !CONDA_ALWAYS_YES!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda config --set changeps1 !CONDA_CHANGE_PS1!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda update -q conda
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!

echo OFF

setlocal EnableDelayedExpansion

echo ON

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda!CONDA_VERSION!

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "!PLATFORM!"=="x86" set PLATFORM=x86_64

where curl
if !ERRORLEVEL! neq 0 (
    echo "You must first install the cURL program"
    exit /b !ERRORLEVEL!
)

if "%BATCH_MODE%"=="" set BATCH_MODE=false

if not exist !CONDA_DIR! (
    curl https://repo.continuum.io/miniconda/Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe -o miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    if "%BATCH_MODE%"=="true" (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=!CONDA_DIR!
    ) else (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /D=!CONDA_DIR!
    )
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    del miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
)

attrib +h !CONDA_DIR!
if !ERRORLEVEL! neq 0 echo Failed to hide the !CONDA_DIR! directory

set PATH=!CONDA_DIR!;!CONDA_DIR!\Scripts;%PATH%

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes !CONDA_ALWAYS_YES!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda config --set changeps1 !CONDA_CHANGE_PS1!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda update -q conda -y
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!

echo OFF

Update user_install.bat

Update user_install.bat


git clean -xdff
git reset --hard HEAD
git submodule update --init --recursive
dir
nuget.exe restore JSIL.sln
cd packages\Npm.3.5.2\node_modules\npm
npm install
cd ..\..\..\..
"C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\msbuild.exe" "JSIL.sln" /m /verbosity:minimal /P:Platform=NoXNA

git clean -xdff
git reset --hard HEAD
git submodule update --init --recursive
dir
nuget.exe restore JSIL.sln
cd packages\Npm.3.5.2\node_modules\npm
cmd /C "npm install"
cd ..\..\..\..
"C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\msbuild.exe" "JSIL.sln" /m /verbosity:minimal /P:Platform=NoXNA

isolate npm

isolate npm


@echo off
setlocal

set programDirectory=%~dp0
set logFile=%programDirectory%debug.log
set logLevel=debug

echo Running BRLTTY in debug mode. When done, close this window (for example, by
echo using the alt-space menu) and see %logFile%

"%programDirectory%bin\brltty" -n "-l%logLevel%" "-L%logFile%" %*

@echo off
setlocal

set programDirectory=%~dp0
set logFile=%programDirectory%debug.log
set logLevel=debug,serial,usb,bluetooth,inpkts,outpkts,brldrv

echo Running BRLTTY in debug mode. When done, close this window (for example, by
echo using the alt-space menu) and see %logFile%

"%programDirectory%bin\brltty" -n "-l%logLevel%" "-L%logFile%" %*

Enable useful log categories in run-debug.bat. (dm)


choco install docfx -y
choco update docfx -y
docfx docfx\docfx.json
del docs /s /q
REM the CNAME file is generated in the doc folder when added through the github
REM settings page. Apparently github uses this file to determine the custom
REM domain. The line above deletes the whole docs folder so we need we copy it
REM from the docfx folder. If we ever want to change the custom domain settings
REM we need to alter the docfx\CNAME file and not use the github settings page.
copy docfx\CNAME docs /Y
xcopy docfx\_site docs /E /Y

choco install docfx -y
choco update docfx -y
docfx docfx\docfx.json
del docs /s /q
REM the CNAME file is generated in the doc folder when added through the github
REM settings page. Apparently github uses this file to determine the custom
REM domain. The line above deletes the whole docs folder so we need to copy it
REM from the docfx folder. If we ever want to change the custom domain settings
REM we need to alter the docfx\CNAME file and not use the github settings page.
copy docfx\CNAME docs /Y
xcopy docfx\_site docs /E /Y

Comment fix

Comment fix


@echo off
echo Building the Windows Installer...
echo.
:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\MSBuild\14.0\Bin"

pushd %~dp0

CALL scripts\prepareBuild.cmd
if %errorlevel% neq 0 exit /b %errorlevel%

echo Building MSI...
msbuild /t:rebuild /p:Configuration=Release

echo.

if not "%1"=="-noprompt" (
   start .\out\
)
popd

@echo off
echo Building the Windows Installer...
echo.
:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set "PATH=%PATH%;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;"

pushd %~dp0

CALL scripts\prepareBuild.cmd
if %errorlevel% neq 0 exit /b %errorlevel%

echo Building MSI...
msbuild /t:rebuild /p:Configuration=Release

echo.

if not "%1"=="-noprompt" (
   start .\out\
)
popd

Fix msi path to include msbuild in path. (#2696)


setlocal EnableDelayedExpansion

if "%ARCH%"=="64" (
    set WIN64="WIN64=YES"
) else (
    set WIN64=
)

:: Work out MSVC_VER - needed for build process.
:: Currently guess from Python version
if  %vc% LEQ 9 set MSVC_VER=1500
if  %vc% GTR 9 set MSVC_VER=1900

:: Get the minor/major version of poppler from the %poppler% environment
:: variable that is set by conda-build
FOR /F "tokens=1,2 delims=." %%a IN ("%poppler%") DO (
  set POPPLER_MAJOR_VERSION=%%a
  set POPPLER_MINOR_VERSION=%%b
)

:: Need consistent flags between build and install.
set BLD_OPTS=%WIN64% ^
    MSVC_VER=%MSVC_VER% ^
    GDAL_HOME=%LIBRARY_PREFIX% ^
    BINDIR=%LIBRARY_BIN% ^
    LIBDIR=%LIBRARY_LIB% ^
    INCDIR=%LIBRARY_INC% ^
    DATADIR=%LIBRARY_PREFIX%\share\gdal ^
    CURL_INC="-I%LIBRARY_INC%" ^
    CURL_LIB="%LIBRARY_LIB%\libcurl.lib wsock32.lib wldap32.lib winmm.lib" ^
    EXPAT_DIR=%LIBRARY_PREFIX% ^
    EXPAT_INCLUDE="-I%LIBRARY_INC%" ^
    EXPAT_LIB=%LIBRARY_LIB%\expat.lib ^
    FITS_PLUGIN=NO ^
    FITS_INC_DIR=%LIBRARY_INC% ^
    FITS_LIB="%LIBRARY_LIB%\cfitsio.lib" ^
    FREEXL_CFLAGS="-I%LIBRARY_INC%" ^
    FREEXL_LIBS=%LIBRARY_LIB%\freexl_i.lib ^
    GEOS_CFLAGS="-I%LIBRARY_INC% -DHAVE_GEOS" ^
    GEOS_DIR=%LIBRARY_PREFIX% ^
    GEOS_LIB=%LIBRARY_LIB%\geos_c.lib ^
    HDF4_DIR=%LIBRARY_PREFIX% ^
    HDF4_HAS_MAXOPENFILES=YES ^
    HDF4_LIB="%LIBRARY_LIB%\hdf.lib %LIBRARY_LIB%\mfhdf.lib %LIBRARY_LIB%\xdr.lib" ^
    HDF5_DIR=%LIBRARY_PREFIX% ^
    HDF5_LIB=%LIBRARY_LIB%\hdf5.lib ^
    HDF5_H5_IS_DLL=YES ^
    TILEDB_ENABLED=YES ^
    TILEDB_DIR=%LIBRARY_PREFIX% ^
    TILEDB_LIBS=%LIBRARY_LIB%\tiledb.lib ^
    JPEGDIR=%LIBRARY_INC% ^
    JPEG_EXTERNAL_LIB=1 ^
    JPEG_LIB=%LIBRARY_LIB%\libjpeg.lib ^
    KEA_CFLAGS="-I%LIBRARY_INC%" ^
    KEA_LIB="%LIBRARY_LIB%\hdf5_cpp.lib %LIBRARY_LIB%\libkea.lib" ^
    NETCDF_INC_DIR=%LIBRARY_INC% ^
    NETCDF_LIB=%LIBRARY_LIB%\netcdf.lib ^
    NETCDF_SETTING=yes ^
    NETCDF_HAS_NC4=yes ^
    OPENJPEG_CFLAGS="-I%LIBRARY_INC%\openjpeg-2.3" ^
    OPENJPEG_ENABLED=YES ^
    OPENJPEG_LIB=%LIBRARY_LIB%\openjp2.lib ^
    PG_INC_DIR=%LIBRARY_INC% ^
    PG_LIB=%LIBRARY_LIB%\libpq.lib ^
    PNGDIR=%LIBRARY_INC% ^
    PNG_EXTERNAL_LIB=1 ^
    PNG_LIB=%LIBRARY_LIB%\libpng.lib ^
    PROJ_FLAGS="-DPROJ_STATIC -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" ^
    PROJ_INCLUDE="-I%LIBRARY_INC%" ^
    PROJ_LIBRARY=%LIBRARY_LIB%\proj.lib ^
    SPATIALITE_412_OR_LATER=yes ^
    SQLITE_INC="-I%LIBRARY_INC% -DHAVE_SPATIALITE" ^
    SQLITE_LIB="%LIBRARY_LIB%\sqlite3.lib %LIBRARY_LIB%\spatialite_i.lib" ^
    TIFF_INC="-I%LIBRARY_INC%" ^
    TIFF_LIB=%LIBRARY_LIB%\tiff.lib ^
    TIFF_OPTS=-DBIGTIFF_SUPPORT ^
    XERCES_DIR=%LIBRARY_PREFIX% ^
    XERCES_INCLUDE="-I%LIBRARY_INC% -I%LIBRARY_INC%\xercesc" ^
    XERCES_LIB=%LIBRARY_LIB%\xerces-c_3.lib ^
    GEOTIFF_INC="-I%LIBRARY_INC%" ^
    GEOTIFF_LIB=%LIBRARY_LIB%\geotiff_i.lib ^
    LIBICONV_INCLUDE="-I%LIBRARY_INC% -DICONV_CONST= " ^
    LIBICONV_LIBRARY="%LIBRARY_LIB%\iconv.lib" ^
    POPPLER_ENABLED=YES ^
    POPPLER_CFLAGS="-I%LIBRARY_INC%\poppler -DPOPPLER_HAS_OPTCONTENT= -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS= " ^
    POPPLER_MAJOR_VERSION=%POPPLER_MAJOR_VERSION% ^
    POPPLER_MINOR_VERSION=%POPPLER_MINOR_VERSION% ^
    POPPLER_LIBS="%LIBRARY_LIB%\poppler.lib" ^
    WEBP_ENABLED=YES ^
    WEBP_CFLAGS="-I%LIBRARY_INC%" ^
    WEBP_LIBS="%LIBARY_LIB%\libwebp.lib" ^
    ZSTD_CFLAGS="-I%LIBRARY_INC%" ^
    ZSTD_LIBS=""%LIBRARY_LIB%\libzstd.lib"

endlocal && set BLD_OPTS=%BLD_OPTS%

setlocal EnableDelayedExpansion

if "%ARCH%"=="64" (
    set WIN64="WIN64=YES"
) else (
    set WIN64=
)

:: Work out MSVC_VER - needed for build process.
:: Currently guess from Python version
if  %vc% LEQ 9 set MSVC_VER=1500
if  %vc% GTR 9 set MSVC_VER=1900

:: Get the minor/major version of poppler from the %poppler% environment
:: variable that is set by conda-build
FOR /F "tokens=1,2 delims=." %%a IN ("%poppler%") DO (
  set POPPLER_MAJOR_VERSION=%%a
  set POPPLER_MINOR_VERSION=%%b
)

:: Need consistent flags between build and install.
set BLD_OPTS=%WIN64% ^
    MSVC_VER=%MSVC_VER% ^
    GDAL_HOME=%LIBRARY_PREFIX% ^
    BINDIR=%LIBRARY_BIN% ^
    LIBDIR=%LIBRARY_LIB% ^
    INCDIR=%LIBRARY_INC% ^
    DATADIR=%LIBRARY_PREFIX%\share\gdal ^
    CURL_INC="-I%LIBRARY_INC%" ^
    CURL_LIB="%LIBRARY_LIB%\libcurl.lib wsock32.lib wldap32.lib winmm.lib" ^
    EXPAT_DIR=%LIBRARY_PREFIX% ^
    EXPAT_INCLUDE="-I%LIBRARY_INC%" ^
    EXPAT_LIB=%LIBRARY_LIB%\expat.lib ^
    FITS_PLUGIN=NO ^
    FITS_INC_DIR=%LIBRARY_INC% ^
    FITS_LIB="%LIBRARY_LIB%\cfitsio.lib" ^
    FREEXL_CFLAGS="-I%LIBRARY_INC%" ^
    FREEXL_LIBS=%LIBRARY_LIB%\freexl_i.lib ^
    GEOS_CFLAGS="-I%LIBRARY_INC% -DHAVE_GEOS" ^
    GEOS_DIR=%LIBRARY_PREFIX% ^
    GEOS_LIB=%LIBRARY_LIB%\geos_c.lib ^
    HDF4_DIR=%LIBRARY_PREFIX% ^
    HDF4_HAS_MAXOPENFILES=YES ^
    HDF4_LIB="%LIBRARY_LIB%\hdf.lib %LIBRARY_LIB%\mfhdf.lib %LIBRARY_LIB%\xdr.lib" ^
    HDF5_DIR=%LIBRARY_PREFIX% ^
    HDF5_LIB=%LIBRARY_LIB%\hdf5.lib ^
    HDF5_H5_IS_DLL=YES ^
    TILEDB_ENABLED=YES ^
    TILEDB_DIR=%LIBRARY_PREFIX% ^
    TILEDB_LIBS=%LIBRARY_LIB%\tiledb.lib ^
    JPEGDIR=%LIBRARY_INC% ^
    JPEG_EXTERNAL_LIB=1 ^
    JPEG_LIB=%LIBRARY_LIB%\libjpeg.lib ^
    KEA_CFLAGS="-I%LIBRARY_INC%" ^
    KEA_LIB="%LIBRARY_LIB%\hdf5_cpp.lib %LIBRARY_LIB%\libkea.lib" ^
    NETCDF_INC_DIR=%LIBRARY_INC% ^
    NETCDF_LIB=%LIBRARY_LIB%\netcdf.lib ^
    NETCDF_SETTING=yes ^
    NETCDF_HAS_NC4=yes ^
    OPENJPEG_CFLAGS="-I%LIBRARY_INC%\openjpeg-2.4" ^
    OPENJPEG_ENABLED=YES ^
    OPENJPEG_LIB=%LIBRARY_LIB%\openjp2.lib ^
    PG_INC_DIR=%LIBRARY_INC% ^
    PG_LIB=%LIBRARY_LIB%\libpq.lib ^
    PNGDIR=%LIBRARY_INC% ^
    PNG_EXTERNAL_LIB=1 ^
    PNG_LIB=%LIBRARY_LIB%\libpng.lib ^
    PROJ_FLAGS="-DPROJ_STATIC -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" ^
    PROJ_INCLUDE="-I%LIBRARY_INC%" ^
    PROJ_LIBRARY=%LIBRARY_LIB%\proj.lib ^
    SPATIALITE_412_OR_LATER=yes ^
    SQLITE_INC="-I%LIBRARY_INC% -DHAVE_SPATIALITE" ^
    SQLITE_LIB="%LIBRARY_LIB%\sqlite3.lib %LIBRARY_LIB%\spatialite_i.lib" ^
    TIFF_INC="-I%LIBRARY_INC%" ^
    TIFF_LIB=%LIBRARY_LIB%\tiff.lib ^
    TIFF_OPTS=-DBIGTIFF_SUPPORT ^
    XERCES_DIR=%LIBRARY_PREFIX% ^
    XERCES_INCLUDE="-I%LIBRARY_INC% -I%LIBRARY_INC%\xercesc" ^
    XERCES_LIB=%LIBRARY_LIB%\xerces-c_3.lib ^
    GEOTIFF_INC="-I%LIBRARY_INC%" ^
    GEOTIFF_LIB=%LIBRARY_LIB%\geotiff_i.lib ^
    LIBICONV_INCLUDE="-I%LIBRARY_INC% -DICONV_CONST= " ^
    LIBICONV_LIBRARY="%LIBRARY_LIB%\iconv.lib" ^
    POPPLER_ENABLED=YES ^
    POPPLER_CFLAGS="-I%LIBRARY_INC%\poppler -DPOPPLER_HAS_OPTCONTENT= -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS= " ^
    POPPLER_MAJOR_VERSION=%POPPLER_MAJOR_VERSION% ^
    POPPLER_MINOR_VERSION=%POPPLER_MINOR_VERSION% ^
    POPPLER_LIBS="%LIBRARY_LIB%\poppler.lib" ^
    WEBP_ENABLED=YES ^
    WEBP_CFLAGS="-I%LIBRARY_INC%" ^
    WEBP_LIBS="%LIBARY_LIB%\libwebp.lib" ^
    ZSTD_CFLAGS="-I%LIBRARY_INC%" ^
    ZSTD_LIBS=""%LIBRARY_LIB%\libzstd.lib"

endlocal && set BLD_OPTS=%BLD_OPTS%

Fix OPENJPEG_CFLAGS

Fix OPENJPEG_CFLAGS


@ECHO OFF
IF NOT EXIST UmbracoVersion.txt (
	ECHO UmbracoVersion.txt missing!
	GOTO :showerror
)

REM Get the version and comment from UmbracoVersion.txt lines 2 and 3
SET "release="
SET "comment="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"

SET version=%release%

IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ECHO Building Umbraco %version%

ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%

ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe sources Remove -Name MyGetUmbracoCore
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder%

ECHO Removing the belle build folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S

ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput_Debug
DEL /F /Q UmbracoCms.*.zip
DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt

ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build-debug.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%

IF ERRORLEVEL 1 GOTO :showerror

IF "%1"=="" GOTO :EOF

echo off
SET SRC=c:\Repositories\Umbraco\build\_BuildOutput_Debug
SET DEST=n:\web\webcentrum2-dev.muni.cz\%1

echo. && echo bin:
robocopy %SRC%\WebApp\bin %DEST%\lib\Umbraco-CMS\src\build\_BuildOutput_Debug\bin /S /XO /IS /NJH /NFL /NDL
robocopy %SRC%\UmbracoExamine.PDF %DEST%\lib\Umbraco-CMS\src\build\_BuildOutput_Debug\bin /S /XO /IS /NJH /NFL /NDL
echo. && echo umbraco:
robocopy %SRC%\WebApp\umbraco %DEST%\web\Redakce /S /XO /IS /NJH /NFL /NDL
echo. && echo umbraco_client:
robocopy %SRC%\WebApp\umbraco_client %DEST%\web\Umbraco_Client /S /XO /IS /NJH /NFL /NDL

GOTO :EOF

:showerror
PAUSE

@ECHO OFF
IF NOT EXIST UmbracoVersion.txt (
	ECHO UmbracoVersion.txt missing!
	GOTO :showerror
)

REM Get the version and comment from UmbracoVersion.txt lines 2 and 3
SET "release="
SET "comment="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"

SET version=%release%

IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ECHO Building Umbraco %version%

ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%

ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe sources Remove -Name MyGetUmbracoCore
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder%

ECHO Removing the belle build folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S

ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput_Debug
DEL /F /Q UmbracoCms.*.zip
DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt

ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build-debug.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%

IF ERRORLEVEL 1 GOTO :showerror

IF "%1"=="" GOTO :EOF

echo off
SET SRC=c:\Repositories\Umbraco-CMS\build\_BuildOutput_Debug
SET DEST=n:\web\webcentrum2-dev.muni.cz\%1

echo. && echo bin:
robocopy %SRC%\WebApp\bin %DEST%\lib\Umbraco-CMS\src\build\_BuildOutput_Debug\bin /S /XO /IS /NJH /NFL /NDL
REM robocopy %SRC%\UmbracoExamine.PDF %DEST%\lib\Umbraco-CMS\src\build\_BuildOutput_Debug\bin /S /XO /IS /NJH /NFL /NDL
echo. && echo umbraco:
robocopy %SRC%\WebApp\umbraco %DEST%\web\Redakce /S /XO /IS /NJH /NFL /NDL
echo. && echo umbraco_client:
robocopy %SRC%\WebApp\umbraco_client %DEST%\web\Umbraco_Client /S /XO /IS /NJH /NFL /NDL

GOTO :EOF

:showerror
PAUSE

Debug build dest dir fix

Debug build dest dir fix


@echo off

if "%~1" == "" (
	>&2 echo:Shell name required
	goto :shell.failed
)

setlocal

:: Proceed to the specified folder
if not "%~2" == "" pushd "%~2" || goto :EOF

:: Set the shell specific parameters if it is necessary
if exist "%~dp0etc\%~n0\%~1.bat" call "%~dp0etc\%~n0\%~1.bat"

:: Set the home dir
set "HOME=%~dp0home"

:: Check if ConEmu is available
if exist "%~dp0vendors\ConEmu\ConEmu.exe" if exist "%~dp0etc\ConEmu\%~1.xml" (
	start "%~1 starting" "%~dp0vendors\ConEmu\ConEmu.exe" /LoadCfgFile "%~dp0etc\ConEmu\%~1.xml" /Icon "%~dp0etc\images\%~1.ico"
	goto :EOF
)

if exist "%~dp0vendors\ConEmu\ConEmu.exe" if exist "%~dp0etc\ConEmu\ConEmu.xml" (
	start "%~1 starting" "%~dp0vendors\ConEmu\ConEmu.exe" /LoadCfgFile "%~dp0etc\ConEmu\ConEmu.xml" /Icon "%~dp0etc\images\ConEmu.ico" /cmd "{%~1}"
	goto :EOF
)

:: Check if git-bash launcher is available
if exist "%~dp0vendors\%~1\git-bash.exe" (
	start "%~1 starting" "%~dp0vendors\%~1\git-bash.exe"
	goto :EOF
)

:: Check if mintty is available
for %%s in ( "bin" "usr\bin" "usr\local\bin" ) do if exist "%~dp0vendors\%~1\%%~s\mintty.exe" (
	start "%~1 starting" "%~dp0vendors\%~1\%%~s\mintty.exe" -c "%HOME%\.minttyrc" -i "%~dp0etc\images\%~1.ico" /%%~s/bash --login -i
	goto :EOF
)

:: Try naked bash, ksh or sh
for %%s in ( bash ksh sh ) do if exist "%~dp0vendors\%~1\bin\%%~s.exe" (
	start "%~1 starting" "%~dp0vendors\%~1\bin\%%~s.exe" -l -i
	goto :EOF
)

>&2 echo:Cannot find the specified shell "%~1".

:shell.failed
>&2 pause
exit /b 1

0</*! ::
@echo off

if "%~1" == "" (
	>&2 echo:Shell name required
	goto :shell.failed
)

setlocal

:: Proceed to the specified folder
if not "%~2" == "" pushd "%~2" || goto :EOF

:: Set the shell specific parameters if it is necessary
if exist "%~dp0etc\%~n0\%~1.bat" call "%~dp0etc\%~n0\%~1.bat"

:: Set the home dir
set "HOME=%~dp0home"

:: Check if ConEmu is available
if exist "%~dp0vendors\ConEmu\ConEmu.exe" if exist "%~dp0etc\ConEmu\%~1.xml" (
	call :conemu.check.config "%~dp0etc\ConEmu\%~1.xml" && (
		start "%~1 starting" "%~dp0vendors\ConEmu\ConEmu.exe" /LoadCfgFile "%~dp0etc\ConEmu\%~1.xml" /Icon "%~dp0etc\images\%~1.ico"
		goto :EOF
	)
)

if exist "%~dp0vendors\ConEmu\ConEmu.exe" if exist "%~dp0etc\ConEmu\ConEmu.xml" (
	call :conemu.check.config "%~dp0etc\ConEmu\ConEmu.xml" "/confname:%~1" && (
		start "%~1 starting" "%~dp0vendors\ConEmu\ConEmu.exe" /LoadCfgFile "%~dp0etc\ConEmu\ConEmu.xml" /Icon "%~dp0etc\images\ConEmu.ico" /Config "%~1"
		goto :EOF
	)
	call :conemu.check.config "%~dp0etc\ConEmu\ConEmu.xml" "/taskname:%~1" && (
		start "%~1 starting" "%~dp0vendors\ConEmu\ConEmu.exe" /LoadCfgFile "%~dp0etc\ConEmu\ConEmu.xml" /Icon "%~dp0etc\images\ConEmu.ico" /Cmd "{%~1}"
		goto :EOF
	)
)

:: Check if git-bash launcher is available
if exist "%~dp0vendors\%~1\git-bash.exe" (
	start "%~1 starting" "%~dp0vendors\%~1\git-bash.exe"
	goto :EOF
)

:: Check if mintty is available
for %%s in ( "bin" "usr\bin" "usr\local\bin" ) do if exist "%~dp0vendors\%~1\%%~s\mintty.exe" (
	start "%~1 starting" "%~dp0vendors\%~1\%%~s\mintty.exe" -c "%HOME%\.minttyrc" -i "%~dp0etc\images\%~1.ico" /%%~s/bash --login -i
	goto :EOF
)

:: Try naked bash, ksh or sh
for %%s in ( bash ksh sh ) do if exist "%~dp0vendors\%~1\bin\%%~s.exe" (
	start "%~1 starting" "%~dp0vendors\%~1\bin\%%~s.exe" -l -i
	goto :EOF
)

>&2 echo:Cannot find the specified shell "%~1".

:shell.failed
>&2 pause
exit /b 1

:conemu.check.config
cscript //nologo //e:javascript "%~f0" %*
goto :EOF

*/0;

var debug = 0;

var alert = alert || function(msg)
{
	WScript.Echo(msg);
};

var exit = exit || function(exitCode)
{
	WScript.Quit(exitCode);
};

if ( WScript.Arguments.Unnamed.length == 0 ) {
	alert('Usage: ' + WScript.ScriptName + ' options');
	exit(1);
}

var filename = WScript.Arguments.Unnamed.item(0);
var confname = WScript.Arguments.Named.item('CONFNAME') || '.Vanilla';
var taskname = WScript.Arguments.Named.item('TASKNAME') || '';

var xpath = '/key[@name="Software"]/key[@name="ConEmu"]/key[lower-case(@name)=lower-case("' + confname + '")]/key[@name="Tasks"]/key';

if ( taskname ) {
	xpath += '/value[@name="Name"][lower-case(@data)=lower-case("{' + taskname + '}")]';
}

// Comparison in XPath is case sensitive. Using of "lower-case" XPath
// function could be good solution to escape differencies between "abc",
// "ABC" and so on. Unfortunately, "lower-case" is a part of XPath 2.0 and
// is not supportable by MS JScript. To resolve this issue we introduce
// the partial workaround replacement with the available XPath 1.0
// function "translate".
// See for details: http://stackoverflow.com/a/1625859/3627676
xpath = xpath.replace(/lower-case\(([^()]+)\)/g, 'translate($1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")');

debug && alert('FILENAME = ' + filename);
debug && alert('XPATHSTR = ' + xpath);

var e;
try {
	var xmldoc = new ActiveXObject('Microsoft.XMLDOM');
	xmldoc.setProperty('SelectionLanguage', 'XPath');
	xmldoc.load(filename);

	var xml = xmldoc.selectNodes(xpath);
} catch(e) {
	// If a file or XML are bad, exit with error immediately
	exit(1);
}

debug && alert('LEN = ' + xml.length);

exit( xml.length != 0 ? 0 : 1 );

improve search for valid ConEmu configuration


:: Disable "Stop running this script?" alert dialog.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles" ^
    /v "MaxScriptStatements" /t REG_DWORD /d 0xffffffff /f

:: Disable Java update dialogs.
reg add ^
    "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" ^
reg add ^
    "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" ^
    /v "EnableJavaUpdate" /t REG_DWORD /d 0 /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.check.enabled" /t REG_SZ /d false /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.decision.10.55.2" /t REG_SZ /d block /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.decision.suppression.10.55.2" /t REG_SZ /d true /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.decision.timestamp.10.55.2" /t REG_SZ /d 1413180896 /f
reg add ^
    "HKEY_CURRENT_USER\Software\Microsoft\Active Setup\Declined Install On Demand IEv5" ^
    /v "{08B0e5c0-4FCB-11CF-AAA5-00401C608501}" /t REG_SZ /d 1 /f   /v "EnableJavaUpdate" /t REG_DWORD /d 0 /f

:: Disable Windows crash dialogs.
reg add ^
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting" ^
    /v "DontShowUI" /t REG_DWORD /d 1 /f
reg add ^
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting" ^
    /v "ForceQueue" /t REG_DWORD /d 1 /f

:: Disable JavaScript error dialogs.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^
    /v "Error Dlg Displayed On Every Error" /t REG_SZ /d no /f

:: Disable script error dialogs for IE8 & IE9.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^
    /v "Disable Script Debugger" /t REG_SZ /d yes /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^
    /v "DisableScriptDebuggerIE" /t REG_SZ /d yes /f

:: Disable cross-origin XHRs. Sauce enables this in IE by default.
@ECHO OFF
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v 1406 /t REG_DWORD /d 3 /f

@echo off
setlocal

set "URL=https://raw.githubusercontent.com/google/closure-library/master/scripts/ci/CloseAdobeDialog.exe"
set "SaveAs=C:\Users\Administrator\Desktop\CloseAdobeDialog.exe"
powershell "Import-Module BitsTransfer; Start-BitsTransfer '%URL%' '%SaveAs%'"

start C:\Users\Administrator\Desktop\CloseAdobeDialog.exe
exit

:: Disable "Stop running this script?" alert dialog.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles" ^
    /v "MaxScriptStatements" /t REG_DWORD /d 0xffffffff /f

:: Disable Java update dialogs.
reg add ^
    "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" ^
reg add ^
    "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" ^
    /v "EnableJavaUpdate" /t REG_DWORD /d 0 /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.check.enabled" /t REG_SZ /d false /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.decision.10.55.2" /t REG_SZ /d block /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.decision.suppression.10.55.2" /t REG_SZ /d true /f
reg add ^
    "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
    /v "deployment.expiration.decision.timestamp.10.55.2" /t REG_SZ /d 1413180896 /f
reg add ^
    "HKEY_CURRENT_USER\Software\Microsoft\Active Setup\Declined Install On Demand IEv5" ^
    /v "{08B0e5c0-4FCB-11CF-AAA5-00401C608501}" /t REG_SZ /d 1 /f   /v "EnableJavaUpdate" /t REG_DWORD /d 0 /f

:: Disable Windows crash dialogs.
reg add ^
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting" ^
    /v "DontShowUI" /t REG_DWORD /d 1 /f
reg add ^
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting" ^
    /v "ForceQueue" /t REG_DWORD /d 1 /f

:: Disable JavaScript error dialogs.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^
    /v "Error Dlg Displayed On Every Error" /t REG_SZ /d no /f

:: Disable script error dialogs for IE8 & IE9.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^
    /v "Disable Script Debugger" /t REG_SZ /d yes /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^
    /v "DisableScriptDebuggerIE" /t REG_SZ /d yes /f

:: Disable cross-origin XHRs. Sauce enables this in IE by default.
@ECHO OFF
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v 1406 /t REG_DWORD /d 3 /f

setlocal

set "URL=https://raw.githubusercontent.com/google/closure-library/master/scripts/ci/CloseAdobeDialog.exe"
set "SaveAs=C:\Users\Administrator\Desktop\CloseAdobeDialog.exe"
powershell "Import-Module BitsTransfer; Start-BitsTransfer '%URL%' '%SaveAs%'"

start C:\Users\Administrator\Desktop\CloseAdobeDialog.exe
exit

Update ie_setup.bat

Update ie_setup.bat


:: Copyright (c) 2016 ASMlover. All rights reserved.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions
:: are met:
::
::  * Redistributions of source code must retain the above copyright
::    notice, this list ofconditions and the following disclaimer.
::
::  * Redistributions in binary form must reproduce the above copyright
::    notice, this list of conditions and the following disclaimer in
::    the documentation and/or other materialsprovided with the
::    distribution.
::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
:: "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
:: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
:: FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
:: COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
:: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
:: BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
:: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
:: CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
:: LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
:: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
:: POSSIBILITY OF SUCH DAMAGE.

nmake -f Makefile.windows.mk %1

add make bat shell for windows

chore(make): add make bat shell for windows


@echo off

REM This is a work in progress!

REM related: https://forum.bigfix.com/t/logon-script-to-install-bigfix-agent/22119/2

REM  Note: it is easier to have a WMI filter tell if BigFix exists than if it does not:  `SELECT * FROM Win32_Service WHERE Name='BESClient'`

sc query besclient | find /I "besclient" > nul
if %errorlevel% NEQ 1 goto end
REM if errorlevel = 1 then BigFix is NOT installed

echo Install BigFix since it is missing:

SET RELAYFQDN=_Must_Set_FQDN_
SET MASTHEADURL=http://%RELAYFQDN%:52311/masthead/masthead.afxm
SET BASEFOLDER=%TMP%

cd %BASEFOLDER%

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD
REM  TODO: check for admin rights http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights

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
REM this following line will need to ignore SSL errors if HTTPS is used instead of HTTP
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.9.62.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
REM http://stackoverflow.com/questions/7225630/how-to-echo-2-no-quotes-to-a-file-from-a-batch-script
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if FQDN_variable is set
>>%BASEFOLDER%\clientsettings.cfg ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/
>>%BASEFOLDER%\clientsettings.cfg ECHO __RelaySelect_Automatic=1
>>%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

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

EXIT /B

:end
exit

Create install_bigfix_GPO.bat

Create install_bigfix_GPO.bat

- https://forum.bigfix.com/t/logon-script-to-install-bigfix-agent/22119/2


@echo off

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

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

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

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

cd /D "ep_etherpad-lite"
cmd /C npm ci || exit /B 1

cd /D "%~dp0\.."

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

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

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

@echo off

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

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

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

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

cd /D "ep_etherpad-lite"
cmd /C npm ci || exit /B 1

cd /D "%~dp0\..\.."

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

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

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

change directory to etherpad root

fix: change directory to etherpad root


:<<"::CMDLITERAL"
@ECHO OFF
REM Short link: http://bit.ly/installbigfix
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
REM KNOWN ISSUE: if enhanced security is enabled on root/relay, then must use HTTPS for masthead download. This will mean that the download part will have to ignore SSL errors
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET RELAYFQDN=%1
SET BASEFOLDER=C:\Windows\Temp

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD
REM  TODO: check for admin rights http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights

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
REM this following line will need to ignore SSL errors if HTTPS is used instead of HTTP
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.9.62.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
REM http://stackoverflow.com/questions/7225630/how-to-echo-2-no-quotes-to-a-file-from-a-batch-script
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if FQDN_variable is set
>>%BASEFOLDER%\clientsettings.cfg ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/
>>%BASEFOLDER%\clientsettings.cfg ECHO __RelaySelect_Automatic=1
>>%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

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

EXIT /B
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
REM Short link: http://bit.ly/installbigfix
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
REM KNOWN ISSUE: if enhanced security is enabled on root/relay, then must use HTTPS for masthead download. This will mean that the download part will have to ignore SSL errors
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET RELAYFQDN=%1
SET BASEFOLDER=C:\Windows\Temp

REM check if BigFix is installed
sc query besclient | find /I "besclient" > nul
if %errorlevel% NEQ 1 goto end
REM if errorlevel = 1 then BigFix is NOT installed

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD
REM  TODO: check for admin rights http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights

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
REM this following line will need to ignore SSL errors if HTTPS is used instead of HTTP
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.9.62.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
REM http://stackoverflow.com/questions/7225630/how-to-echo-2-no-quotes-to-a-file-from-a-batch-script
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if FQDN_variable is set
>>%BASEFOLDER%\clientsettings.cfg ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/
>>%BASEFOLDER%\clientsettings.cfg ECHO __RelaySelect_Automatic=1
>>%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

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

:end
EXIT /B
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


:<<"::CMDLITERAL"
@ECHO OFF
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%

%BASEFOLDER%\BESClient.exe /s /v"/l*voicewarmup %BASEFOLDER%\install.log /qn"

EXIT /B
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
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%

%BASEFOLDER%\BESClient.exe /s /v"/l*voicewarmup %BASEFOLDER%\install.log /qn"

EXIT /B
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


echo ON

if "%PY3K%" == "1" (
  2to3 --output-dir=engine/SCons3 -W -n engine/SCons
  rmdir engine/SCons /s /q
  move engine/SCons3 engine/SCons
  2to3 -w -n script/scons
  2to3 -w -n script/sconsign
  2to3 -w -n script/scons-time
  powershell -Command "Get-Content ".\setup.py" | select -First 49" > setup.back
  more +54 setup.py >> setup.back
  del setup.py
  move setup.back setup.py
)

"%PYTHON%" setup.py install --standard-lib
if errorlevel 1 exit 1

echo ON

if "%PY3K%" == "1" (
  2to3 --output-dir=engine\SCons3 -W -n engine\SCons
  rmdir engine\SCons /s /q
  move engine\SCons3 engine/SCons
  2to3 -w -n script\scons
  2to3 -w -n script\sconsign
  2to3 -w -n script\scons-time
  powershell -Command "Get-Content ".\setup.py" | select -First 49" > setup.back
  more +54 setup.py >> setup.back
  del setup.py
  move setup.back setup.py
)

"%PYTHON%" setup.py install --standard-lib
if errorlevel 1 exit 1

Update bld.bat

Update bld.bat


SET "JAVA_HOME=C:\opt\jdk1.8.0_161"
cd git-repo
./mvnw clean install -X

SET "JAVA_HOME=C:\opt\jdk-8"
cd git-repo
./mvnw clean install -X

Fix location of java home for windows build

See gh-865


@if "%_echo%"=="" echo off

setlocal
if EXIST build.ok DEL /f /q build.ok

del /s /q cdtsuite.exe > NUL 2>&1
del /s /q test.out > NUL 2>&1
del /s /q test.err > NUL 2>&1

REM == Invoke resgen to create .cs files out of .resx
resgen.exe tests\Properties\Resources.resx    /str:cs,tests.Properties,Resources,tests\Properties\Resources.Designer.cs
resgen.exe CodeDomTest\Properties\Resources.resx /str:cs,CodeDomTest.Properties,Resources,CodeDomTest\Properties\Resources.Designer.cs

msbuild.exe CodeDomTest\CodeDOM.TestCore.csproj
msbuild.exe tests\CodeDOM.Tests.csproj
msbuild.exe CodeDOM.TestSuite.csproj

if not exist bin\Debug\CdtSuite.exe goto Error

bin\Debug\CdtSuite.exe /testcaselib:bin\Debug\tests.dll /codedomproviderlib:..\..\bin\FSharp.Compiler.CodeDom.dll /codedomprovider:FSharp.Compiler.CodeDom.FSharpCodeProvider > test.out

if not exist test.out goto Error
type test.out

type test.out | find /C "TEST FAILED" > test.err
for /f %%c IN (test.err) do (if NOT "%%c"=="0" (
   echo Error: CodeDom TEST FAILURES DETECTED IN TESTS PREVIOUSLY KNOWN TO PASS!
   type test.out | find "TEST FAILED"
   set NonexistentErrorLevel 2> nul
   goto Error)
)

echo Ran fsharp CodeDom tests OK (ignore "FAIED" above- some failures expected)
:Ok
echo. > build.ok
endlocal
exit /b 0

:Error
call %SCRIPT_ROOT%\ChompErr.bat %ERRORLEVEL% %~f0
endlocal
exit /b %ERRORLEVEL%

@if "%_echo%"=="" echo off

setlocal
if EXIST build.ok DEL /f /q build.ok

del /s /q cdtsuite.exe > NUL 2>&1
del /s /q test.out > NUL 2>&1
del /s /q test.err > NUL 2>&1

REM == Invoke resgen to create .cs files out of .resx
resgen.exe tests\Properties\Resources.resx    /str:cs,tests.Properties,Resources,tests\Properties\Resources.Designer.cs
resgen.exe CodeDomTest\Properties\Resources.resx /str:cs,CodeDomTest.Properties,Resources,CodeDomTest\Properties\Resources.Designer.cs

msbuild.exe CodeDomTest\CodeDOM.TestCore.csproj
msbuild.exe tests\CodeDOM.Tests.csproj
msbuild.exe CodeDOM.TestSuite.csproj

if not exist bin\Debug\CdtSuite.exe goto Error

bin\Debug\CdtSuite.exe /testcaselib:bin\Debug\tests.dll /codedomproviderlib:..\..\bin\FSharp.Compiler.CodeDom.dll /codedomprovider:FSharp.Compiler.CodeDom.FSharpCodeProvider > test.out

if not exist test.out goto Error
type test.out

type test.out | find /C "TEST FAILED" > test.err
for /f %%c IN (test.err) do (if NOT "%%c"=="0" (
   echo Error: CodeDom TEST FAILURES DETECTED IN TESTS PREVIOUSLY KNOWN TO PASS!
   type test.out | find "TEST FAILED"
   set NonexistentErrorLevel 2> nul
   goto Error)
)

echo Ran fsharp CodeDom tests OK (ignore "FAILED" above- some failures expected)
:Ok
echo. > build.ok
endlocal
exit /b 0

:Error
call %SCRIPT_ROOT%\ChompErr.bat %ERRORLEVEL% %~f0
endlocal
exit /b %ERRORLEVEL%

update tests (2)

update tests (2)


:: Business Accounting
:: Small Business Accounting Solution
:: Copyright (C) 2014 Fuks Alexander
:: <mailto:kungfux2010@gmail.com>
::
:: This program is free software: you can redistribute it and/or modify
:: it under the terms of the GNU General Public License as published by
:: the Free Software Foundation, either version 3 of the License, or
:: (at your option) any later version.
::
:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
:: GNU General Public License for more details.
::
:: You should have received a copy of the GNU General Public License
:: along with this program.  If not, see <http://www.gnu.org/licenses/>.

:: This batch program should be used to build the database

@echo off
echo Business Accounting
echo Copyright (C) 2014 Fuks Alexander
echo ^<mailto:kungfux2010@gmail.com^>
echo This program comes with ABSOLUTELY NO WARRANTY;
echo This is free software, and you are welcome to redistribute it under certain conditions.
echo.

:: Configuration parameters
set newdbfile=ba.sqlite
set dbinitsql=initdb.sql
set dbfillsql=filldb.sql
set sqlite3=..\3rd-party\sqlite3\sqlite3.exe

:: Check for missing files
if not exist %dbinitsql% set nodbinitsql=1
if [%nodbinitsql%]==[1]  echo STOP! file was not found: %dbinitsql%
if [%nodbinitsql%]==[1]  exit /B 1

if not exist %dbinitsql% set nodbfillsql=1
if [%nodbfillsql%]==[1]  echo STOP! file was not found: %dbfillsql%
if [%nodbfillsql%]==[1]  exit /B 1

if not exist %sqlite3% set nosqlite=1
if [%nosqlite%]==[1]   echo STOP! sqlite3 util was not found at %sqlite3%
if [%nosqlite%]==[1]   exit /B 1

:: Check command line arguments
if [%1%]==[database-init] goto DatabaseInit
if [%1%]==[database-fill] goto DatabaseFill
if [%1%]==[database-all]  goto DatabaseInit
if [%1%]==[clean]         goto Clean

:: Display help
:Help
echo Available options:
echo ^ database-init  Initialize new database;
echo ^ database-fill  Fill database with data samples;
echo ^ database-all   Initialize and fill database (both options);
echo ^ clean          Delete all generated/copied files
echo.
echo Usage examples:
echo ^ makefile database-init
echo ^ makefile clean
pause
goto :EOF

:: Init new db
:DatabaseInit
echo Init new database ...
%sqlite3% %newdbfile% < %dbinitsql%
if [%1%]==[database-all] goto DatabaseFill
goto :EOF

:: Fill db
:DatabaseFill
echo Fill database with samples ...
%sqlite3% %newdbfile% < %dbfillsql%
goto :EOF

:: Cleanup workspace
:Clean
echo Clean up ...
del /Q %newdbfile%
goto :EOF

Add batch program to init/fill db

Add batch program to init/fill db


B@echo off
cls
@echo:
echo     ,,,                 ;;                      ;,
echo     ;,     ;;,          ;;                   ;;;;;;;;
echo   ,;       ;,  ;,    ;;;;;;;;;                  ;;
echo  ,;         ;,          ;;                 ;;;;;;;;;;;;;
echo  ;;         ;;          ;;  .,,,,               ;;
echo  ;;         ;;          ;;  ,''''              ,;;
echo   ;,       ,;           ;;                 ,;''
echo    ;,     ,;            ;;  ;,             ;;
echo     ;;;;;;;             ;;    ;;;;;,,      \`;;;;;,,
@echo:

echo ~~Hitagi-Script Windows Edition~~
echo Please ensure that you have installed NodeJS 7.x
echo https://nodejs.org/en/download/current/
REM call npm install

set /p name="Safebooru tags (name or additional queries)? "

echo Downloading art...
call node danbooru.js %name%
pause

@echo off
cls
@echo:
echo     ,,,                 ;;                      ;,
echo     ;,     ;;,          ;;                   ;;;;;;;;
echo   ,;       ;,  ;,    ;;;;;;;;;                  ;;
echo  ,;         ;,          ;;                 ;;;;;;;;;;;;;
echo  ;;         ;;          ;;  .,,,,               ;;
echo  ;;         ;;          ;;  ,''''              ,;;
echo   ;,       ,;           ;;                 ,;''
echo    ;,     ,;            ;;  ;,             ;;
echo     ;;;;;;;             ;;    ;;;;;,,      \`;;;;;,,
@echo:

echo ~~Hitagi-Script Windows Edition~~
echo Please ensure that you have installed NodeJS 7.x
echo https://nodejs.org/en/download/current/
call npm install

set /p name="Safebooru tags (name or additional queries)? "

echo Downloading art...
call node danbooru-win.js %name%
pause

fix batch file?

fix batch file?


@if "%DEBUG%" == "" @echo off
setlocal EnableDelayedExpansion

set "DIR=%~dp0"
set "SOURCE_DIR=%DIR%\.."
set "BUILD_DIR=%DIR%\Release"
set "ZLIB_ZIP=%DIR%\zlib1211.zip"
set "ZLIB_BUILD_DIR=%BUILD_DIR%\zlib-build"
set "ZLIB_INSTALL_DIR=%BUILD_DIR%\zlib64"
set "EXTRA_CMAKE_ARGS="

:loop
if not "%1"=="" (
    if "%1"=="--help" (
        echo %0 [--c-warnings-as-errors] [--cxx-warnings-as-errors] [--debug-build] [--aeron-git-url $GIT_URL] [--aeron-git-tag $GIT_TAG]
        exit /b
    )

    if "%1"=="--c-warnings-as-errors" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DC_WARNINGS_AS_ERRORS=ON
    )

    if "%1"=="--cxx-warnings-as-errors" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCXX_WARNINGS_AS_ERRORS=ON
    )

    if "%1"=="--debug-build" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCMAKE_BUILD_TYPE=Debug
    )

    if "%1"=="--aeron-git-url" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_GIT_URL=%2
        shift
    )

    if "%1"=="--aeron-git-tag" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_GIT_TAG=%2
    )

    if "%1"=="--aeron-git-sha" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_GIT_SHA=%2
    )

    shift
    goto :loop
)

call "%DIR%\vs-helper.cmd"
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

if EXIST %BUILD_DIR% rd /S /Q %BUILD_DIR%

md %BUILD_DIR%
pushd %BUILD_DIR%
md %ZLIB_BUILD_DIR%
pushd %ZLIB_BUILD_DIR%
7z x %ZLIB_ZIP%
pushd zlib-1.2.11
md build
pushd build

cmake -DCMAKE_INSTALL_PREFIX=%ZLIB_INSTALL_DIR% ..
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --target install
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

pushd %BUILD_DIR%
cmake %EXTRA_CMAKE_ARGS% %SOURCE_DIR%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config Release
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

@if "%DEBUG%" == "" @echo off
setlocal EnableDelayedExpansion

set "DIR=%~dp0"
set "SOURCE_DIR=%DIR%\.."
set "BUILD_DIR=%DIR%\Release"
set "BUILD_CONFIG=Release"
set "ZLIB_ZIP=%DIR%\zlib1211.zip"
set "EXTRA_CMAKE_ARGS="

:loop
if not "%1"=="" (
    if "%1"=="--help" (
        echo %0 [--c-warnings-as-errors] [--cxx-warnings-as-errors] [--debug-build] [--aeron-git-url $GIT_URL] [--aeron-git-tag $GIT_TAG]
        exit /b
    )

    if "%1"=="--c-warnings-as-errors" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DC_WARNINGS_AS_ERRORS=ON"
    )

    if "%1"=="--cxx-warnings-as-errors" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCXX_WARNINGS_AS_ERRORS=ON"
    )

    if "%1"=="--debug-build" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCMAKE_BUILD_TYPE=Debug"
        set "BUILD_DIR=%DIR%\Debug"
        set "BUILD_CONFIG=Debug"
    )

    if "%1"=="--aeron-git-url" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_GIT_URL=%2"
        shift
    )

    if "%1"=="--aeron-git-tag" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_GIT_TAG=%2"
    )

    if "%1"=="--aeron-git-sha" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_GIT_SHA=%2"
    )

    shift
    goto :loop
)

call "%DIR%\vs-helper.cmd"
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

if EXIST %BUILD_DIR% rd /S /Q %BUILD_DIR%

set "ZLIB_BUILD_DIR=%BUILD_DIR%\zlib-build"
set "ZLIB_INSTALL_DIR=%BUILD_DIR%\zlib64"

md %BUILD_DIR%
pushd %BUILD_DIR%
md %ZLIB_BUILD_DIR%
pushd %ZLIB_BUILD_DIR%
7z x %ZLIB_ZIP%
pushd zlib-1.2.11
md build
pushd build

cmake -DCMAKE_INSTALL_PREFIX=%ZLIB_INSTALL_DIR% ..
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config Release --target install
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

pushd %BUILD_DIR%
cmake %EXTRA_CMAKE_ARGS% %SOURCE_DIR%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config %BUILD_CONFIG%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

Fix debug build config.

[C] Fix debug build config.