cmake ^
    -G "%CMAKE_GENERATOR%" ^
    -D CMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
    -D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
    -D CMAKE_BUILD_TYPE=Release ^
    .
if errorlevel 1 exit 1

cmake --build . --config Release
if errorlevel 1 exit 1

cp gemmi.exe "%LIBRARY_BIN%"
if errorlevel 1 exit 1

"%PYTHON%" -m pip install . --no-deps -vv
if errorlevel 1 exit 1

cmake ^
    -G "Ninja" ^
    -D CMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
    -D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
    -D CMAKE_BUILD_TYPE=Release ^
    .
if errorlevel 1 exit 1

ninja
if errorlevel 1 exit 1

cp gemmi.exe "%LIBRARY_BIN%"
if errorlevel 1 exit 1

"%PYTHON%" -m pip install . --no-deps -vv
if errorlevel 1 exit 1

Update do use ninja

Update do use ninja


REM set TMP="%LOCALAPPDATA%\Temp"
REM set TEMP="%LOCALAPPDATA%\Temp"
REM set TMPDIR="%LOCALAPPDATA%\Temp"
if "%ARCH%" == "64" (
set GCC_ARCH=x86_64-w64-mingw32
set EXTRA_FLAGS="-DMS_WIN64 -I/mingw-w64/%GCC_ARCH%/include/"
) else (
set GCC_ARCH=i686-w64-mingw32
set EXTRA_FLAGS="-I/mingw-w64/%GCC_ARCH%/include/"
)
bash -lc "mkdir -p /tmp; ln -s ${LOCALAPPDATA}/Temp /tmp"
bash -lc "echo $CYGWIN_PREFIX"
bash -lc "export LDFLAGS=-L`cygpath -u $LIBRARY_LIB`; echo $LDFLAGS; ls -l `cygpath -u $LIBRARY_LIB`"
bash -lc "cd src; export LDFLAGS=-L`cygpath -u $LIBRARY_LIB`; export PYTHON=`which python`; ./configure --disable-openmp --enable-python --build=$GCC_ARCH --host=$GCC_ARCH --target=$GCC_ARCH --prefix=$CYGWIN_PREFIX CFLAGS=$EXTRA_FLAGS"
bash -lc "cd src; make"
bash -lc "cd src; make install"

REM set TMP="%LOCALAPPDATA%\Temp"
REM set TEMP="%LOCALAPPDATA%\Temp"
REM set TMPDIR="%LOCALAPPDATA%\Temp"
if "%ARCH%" == "64" (
set GCC_ARCH=x86_64-w64-mingw32
set EXTRA_FLAGS="-DMS_WIN64 -I/mingw-w64/%GCC_ARCH%/include/"
) else (
set GCC_ARCH=i686-w64-mingw32
set EXTRA_FLAGS="-I/mingw-w64/%GCC_ARCH%/include/"
)
bash -lc "mkdir -p /tmp; ln -s ${LOCALAPPDATA}/Temp /tmp"
bash -lc "echo $CYGWIN_PREFIX"
bash -lc "export LDFLAGS=-L`cygpath -u $LIBRARY_LIB`; echo $LDFLAGS; ls -l `cygpath -u $LIBRARY_LIB`"
bash -lc "cd src; export LDFLAGS=-L`cygpath -u $LIBRARY_LIB`; export PYTHON=`which python`; ./configure --disable-openmp --enable-python --build=$GCC_ARCH --host=$GCC_ARCH --target=$GCC_ARCH --prefix=$CYGWIN_PREFIX CFLAGS=$EXTRA_FLAGS"
bash -lc "cd src; export CFLAGS=$EXTRA_FLAGS; make"
bash -lc "cd src; make install"

add CFLAGS for make step

add CFLAGS for make step


@ECHO OFF
SETLOCAL
SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't specified; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0
SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\Readme.txt" "temp_zip\" /Y /V
COPY "..\Readme-mod.txt" "temp_zip\" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "Readme.txt" "Readme-mod.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme.txt temp\%BINDIR%\readme.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme-mod.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NP2_VER%.%VerRev% temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL
tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
devenv setup.sln /Rebuild "Lite|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

IF EXIST "%PERL_PATH%" (
  "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
)

MD ..\wdkbuild\packages >NUL 2>&1
IF EXIST "%PERL_PATH%" (
  MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
)
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.%BINDIR%.exe >NUL
MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.%BINDIR%.exe >NUL

rem Cleanup
RD setup.%BINDIR% >NUL 2>&1
RD /Q temp >NUL 2>&1
RD /Q /S addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

@ECHO OFF
SETLOCAL
SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't found; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
rem "..\..\distrib\tools\md5sum.exe" *.7z *.zip *.exe >md5hashes
rem "..\..\distrib\tools\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY /Y /V "..\License.txt" "temp_zip\"
COPY /Y /V "..\%1\Notepad2.exe" "temp_zip\"
COPY /Y /V "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini"
COPY /Y /V "..\Notepad2.txt" "temp_zip\"
COPY /Y /V "..\Readme.txt" "temp_zip\"
COPY /Y /V "..\Readme-mod.txt" "temp_zip\"

PUSHD "temp_zip"
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "Readme.txt" "Readme-mod.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme.txt temp\%BINDIR%\readme.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme-mod.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NP2_VER%.%VerRev% temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL
tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
devenv setup.sln /Rebuild "Lite|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

IF EXIST "%PERL_PATH%" (
  "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
)

MD ..\wdkbuild\packages >NUL 2>&1
IF EXIST "%PERL_PATH%" (
  MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
)
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.%BINDIR%.exe >NUL
MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.%BINDIR%.exe >NUL

rem Cleanup
RD /Q setup.%BINDIR% temp >NUL 2>&1
RD /Q /S addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

update make_packages.bat

update make_packages.bat


REM Install Internet Information Server (IIS).
c:\Windows\Sysnative\WindowsPowerShell\v1.0\powershell.exe -Command Start-Sleep -s 20

Remove everything from before install script


electron-packager . --platform=win32 --arch=x64 --overwrite

Automate electron-packager

Automate electron-packager


::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
set autoRestVersion=0.14.0-Nightly20160125
if  "%1" == "" (
    set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-trafficmanager/2015-11-01/swagger/trafficmanager.json"
) else (
    set specFile="%1"
)
set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %specFile% Microsoft.Azure.Management.TrafficManager %autoRestVersion% %generateFolder% "-FT 2"

::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
set autoRestVersion=0.16.0
if  "%1" == "" (
    set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-trafficmanager/2017-03-01/swagger/trafficmanager.json"
) else (
    set specFile="%1"
)
set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %specFile% Microsoft.Azure.Management.TrafficManager %autoRestVersion% %generateFolder% "-FT 2"

Update generated.cmd

Update generated.cmd


@echo off

:: current path with a slash \
for %%A in ("%~dp0\..") do set "CURRENT_PATH=%%~fA\"

:: change path to where script was run (root dir)
cd /D "%CURRENT_PATH%"

:: localization
@call module\i18n.inc.bat
set i18n=module\i18n.inc.bat

set TOOLS_PATH=%CURRENT_PATH%module\tools\
set EXEC_TOOL=%TOOLS_PATH%exec_tool.bat

rem ----------- THIRD PARTY TOOLS ------------

:: http://gnuwin32.sourceforge.net/packages/wget.htm
::set URL_TOOL_WGET=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-bin.zip
::set URL_TOOL_WGET_DEP=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-dep.zip
set URL_TOOL_WGET=https://eternallybored.org/misc/wget/1.19.4/32/wget.exe

:: http://www.etree.org/md5com.html
set URL_TOOL_MD5SUM=http://www.etree.org/cgi-bin/counter.cgi/software/md5sum.exe

:: https://fossies.org/windows/misc/unz600xn.exe/
set URL_TOOL_UNZIP=https://fossies.org/windows/misc/unz600xn.exe/unzip.exe

:: https://github.com/Microsoft/vswhere
set URL_TOOL_VSWHERE=https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe

:: https://cmake.org
set CMAKE_VERSION=cmake-3.8.1-win32-x86
set URL_TOOL_CMAKE=https://cmake.org/files/v3.8/%CMAKE_VERSION%.zip

:: ----------- build_pvpgn VARIABLES ------------

:: LOG=false output cmake and vs output to console
:: LOG=true logs cmake and vs output to cmake.log, visualstudio.log
set LOG=false

set PVPGN_SOURCE=source\
set PVPGN_BUILD=build\

set URL_UPDATE=https://raw.githubusercontent.com/pvpgn/pvpgn-magic-builder/master/

set PVPGN_PATH=https://github.com/pvpgn/pvpgn-server/archive/

set ZLIB_PATH=module\include\zlib\1.2.11\
set LUA_PATH=module\include\lua\5.1\
:: FIXME: important full path?
set ATLMFC_INCLUDE_PATH=%CURRENT_PATH%module\include\atlmfc\

:: ----------- build_d2gs VARIABLES ------------
set URL_MPQ=http://cdn.pvpgn.pro/diablo2/

set D2GS_RELEASE=d2gs\
set URL_BNHASH_API=http://harpywar.pvpgn.pl/api.php?method=hash^&password=

:: ----------- build_pvpgn_dev VARIABLES ------------

:: current path with a backslash /
set CURRENT_PATH_BACKSLASH=%CURRENT_PATH:\=/%

:: root dir for any project
set PROJECT_ROOT_DIR=..\..\..\

set PVPGN_DEVKIT=dev\

@echo off

:: current path with a slash \
for %%A in ("%~dp0\..") do set "CURRENT_PATH=%%~fA\"

:: change path to where script was run (root dir)
cd /D "%CURRENT_PATH%"

:: localization
@call module\i18n.inc.bat
set i18n=module\i18n.inc.bat

set TOOLS_PATH=%CURRENT_PATH%module\tools\
set EXEC_TOOL=%TOOLS_PATH%exec_tool.bat

rem ----------- THIRD PARTY TOOLS ------------

:: http://gnuwin32.sourceforge.net/packages/wget.htm
::set URL_TOOL_WGET=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-bin.zip
::set URL_TOOL_WGET_DEP=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-dep.zip
set URL_TOOL_WGET=https://eternallybored.org/misc/wget/1.19.4/32/wget.exe

:: http://www.etree.org/md5com.html
set URL_TOOL_MD5SUM=http://www.etree.org/cgi-bin/counter.cgi/software/md5sum.exe

:: https://fossies.org/windows/misc/unz600xn.exe/
set URL_TOOL_UNZIP=https://fossies.org/windows/misc/unz600xn.exe/unzip.exe

:: https://github.com/Microsoft/vswhere
set URL_TOOL_VSWHERE=https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe

:: https://cmake.org
set CMAKE_VERSION=cmake-3.10.2-win32-x86
set URL_TOOL_CMAKE=https://cmake.org/files/v3.10/%CMAKE_VERSION%.zip

:: ----------- build_pvpgn VARIABLES ------------

:: LOG=false output cmake and vs output to console
:: LOG=true logs cmake and vs output to cmake.log, visualstudio.log
set LOG=false

set PVPGN_SOURCE=source\
set PVPGN_BUILD=build\

set URL_UPDATE=https://raw.githubusercontent.com/pvpgn/pvpgn-magic-builder/master/

set PVPGN_PATH=https://github.com/pvpgn/pvpgn-server/archive/

set ZLIB_PATH=module\include\zlib\1.2.11\
set LUA_PATH=module\include\lua\5.1\
:: FIXME: important full path?
set ATLMFC_INCLUDE_PATH=%CURRENT_PATH%module\include\atlmfc\

:: ----------- build_d2gs VARIABLES ------------
set URL_MPQ=http://cdn.pvpgn.pro/diablo2/

set D2GS_RELEASE=d2gs\
set URL_BNHASH_API=http://harpywar.pvpgn.pl/api.php?method=hash^&password=

:: ----------- build_pvpgn_dev VARIABLES ------------

:: current path with a backslash /
set CURRENT_PATH_BACKSLASH=%CURRENT_PATH:\=/%

:: root dir for any project
set PROJECT_ROOT_DIR=..\..\..\

set PVPGN_DEVKIT=dev\

update cmake version

update cmake version


@echo off
setlocal
set GOPATH=%~dp0/deps
set GOBIN=%~dp0/bin
cd %~dp0
rem cd
rem set GO
mklink /J deps\src\github.com\VonC\ggb %~dp0 2>/NUL
%GOROOT%\bin\go.exe install -a .
endlocal
doskey ggb=%~dp0\bin\ggb.exe $*

@echo off
setlocal
set GOPATH=%~dp0/deps
set GOBIN=%~dp0/bin
cd %~dp0
if not exist %~dp0\deps\src\github.com\VonC\ggb (
mkdir %~dp0\deps\src\github.com\VonC
mklink /J %~dp0\deps\src\github.com\VonC\ggb %~dp0
)
if not exist %~dp0\deps\src\github.com\spf13\pflag\.git (
	git submodule update --init
)
rem cd
rem set GO
mklink /J deps\src\github.com\VonC\ggb %~dp0 2>/NUL
%GOROOT%\bin\go.exe install -a .
endlocal
doskey ggb=%~dp0\bin\ggb.exe $*

gb.bat: make junction and init submodules if needed


#Enable WinRM to start on system boot
sc config WinRM start= auto

REM Enable WinRM to start on system boot
sc config WinRM start= auto

Make the # sign in the batch file a REM, since apparently that's how you're supposed to make comments in Windows batch files.


@echo off
rem Change working dir in cmd.exe to last dir in lf on exit.
rem
rem You need to put this file to a folder in %PATH% variable.

:tmploop
set tmpfile="%tmp%\lf.%random%.tmp"
if exist "%tmpfile%" goto:tmploop
lf -last-dir-path="%tmpfile%" %*
if not exist "%tmpfile%" exit
set /p dir=<"%tmpfile%"
del /f "%tmpfile%"
if not exist "%dir%" exit
if "%dir%" == "%cd%" exit
cd "%dir%"

@echo off
rem Change working dir in cmd.exe to last dir in lf on exit.
rem
rem You need to put this file to a folder in %PATH% variable.

:tmploop
set tmpfile="%tmp%\lf.%random%.tmp"
if exist %tmpfile% goto:tmploop
lf -last-dir-path=%tmpfile% %*
if not exist %tmpfile% exit
set /p dir=<%tmpfile%
del /f %tmpfile%
if not exist "%dir%" exit
if "%dir%" == "%cd%" exit
cd /d "%dir%"

Fix bug where lfcd.cmd does not CD to different drive (#221)


mklink /j C:\Users\tscheffert\bin C:\Users\tscheffert\.dotfiles\bin
mklink /j C:\Users\tscheffert\vimfiles C:\Users\tscheffert\.dotfiles\vimfiles
mklink /j C:\Users\tscheffert\.git_template C:\Users\tscheffert\.dotfiles\.git_template
mklink /j C:\Users\tscheffert\.prompts C:\Users\tscheffert\.dotfiles\prompts
mklink /j C:\Users\tscheffert\.zsh C:\Users\tscheffert\.dotfiles\zsh
mklink /j %userprofile%\AutoHotkey %userprofile%\.dotfiles\AutoHotkey
mklink C:\Users\tscheffert\.bash_profile C:\Users\tscheffert\.dotfiles\.bash_profile
mklink C:\Users\tscheffert\.bashrc C:\Users\tscheffert\.dotfiles\.bashrc
mklink C:\Users\tscheffert\.inputrc C:\Users\tscheffert\.dotfiles\.inputrc
mklink "C:\\Program Files\\ConEmu\\ConEmu.xml" C:\Users\tscheffert\.dotfiles\ConEmu.xml
mklink C:\Users\tscheffert\.curlrc C:\Users\tscheffert\.dotfiles\.curlrc
mklink C:\Users\tscheffert\.editorconfig C:\Users\tscheffert\.dotfiles\.editorconfig
mklink C:\Users\tscheffert\.gitconfig C:\Users\tscheffert\.dotfiles\.gitconfig
mklink C:\Users\tscheffert\.gitignore C:\Users\tscheffert\.dotfiles\.gitignore
mklink C:\Users\tscheffert\.jscs.json C:\Users\tscheffert\.dotfiles\.jscs.json
mklink C:\Users\tscheffert\.jshintrc C:\Users\tscheffert\.dotfiles\.jshintrc
mklink C:\Users\tscheffert\.vimrc C:\Users\tscheffert\.dotfiles\.vimrc
mkdir %userprofile%\Documents\WindowsPowerShell
mklink C:\Users\tscheffert\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 C:\Users\tscheffert\.dotfiles\powershell\Microsoft.PowerShell_profile.ps1
::mklink C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 C:\Users\tscheffert\.dotfiles\PowerShell\profile.ps1
::mklink C:\Users\tscheffert\Documents\WindowsPowerShell\PowerTabConfig.xml C:\Users\tscheffert\.dotfiles\PowerShell\PowerTabConfig.xml
::mklink C:\Users\tscheffert\Documents\WindowsPowerShell\TabExpansion.xml C:\Users\tscheffert\.dotfiles\PowerShell\TabExpansion.xml
mklink C:\Users\tscheffert\.agignore C:\Users\tscheffert\.dotfiles\.agignore
mklink C:\Users\tscheffert\.pryrc C:\Users\tscheffert\.dotfiles\.pryrc
mklink C:\Users\tscheffert\.gemrc C:\Users\tscheffert\.dotfiles\.gemrc
mklink C:\Users\tscheffert\.tmux.conf C:\Users\tscheffert\.dotfiles\.tmux.conf
mklink C:\Users\tscheffert\.zshrc C:\Users\tscheffert\.dotfiles\.zshrc
mklink C:\Users\tscheffert\.aprc C:\Users\tscheffert\.dotfiles\.aprc
mklink C:\Users\tscheffert\.ctags C:\Users\tscheffert\.dotfiles\.ctags

pause

mklink /j C:\Users\tscheffert\bin C:\Users\tscheffert\.dotfiles\bin
mklink /j C:\Users\tscheffert\vimfiles C:\Users\tscheffert\.dotfiles\vimfiles
mklink /j C:\Users\tscheffert\.git_template C:\Users\tscheffert\.dotfiles\.git_template
mklink /j C:\Users\tscheffert\.prompts C:\Users\tscheffert\.dotfiles\prompts
mklink /j C:\Users\tscheffert\.zsh C:\Users\tscheffert\.dotfiles\zsh
mklink /j %userprofile%\AutoHotkey %userprofile%\.dotfiles\AutoHotkey
mklink C:\Users\tscheffert\.bash_profile C:\Users\tscheffert\.dotfiles\.bash_profile
mklink C:\Users\tscheffert\.bashrc C:\Users\tscheffert\.dotfiles\.bashrc
mklink C:\Users\tscheffert\.inputrc C:\Users\tscheffert\.dotfiles\.inputrc
mklink %userprofile%\.dir_colors mklink %userprofile%\.dotfiles\.dir_colors
mklink "C:\\Program Files\\ConEmu\\ConEmu.xml" C:\Users\tscheffert\.dotfiles\ConEmu.xml
mklink C:\Users\tscheffert\.curlrc C:\Users\tscheffert\.dotfiles\.curlrc
mklink C:\Users\tscheffert\.editorconfig C:\Users\tscheffert\.dotfiles\.editorconfig
mklink C:\Users\tscheffert\.gitconfig C:\Users\tscheffert\.dotfiles\.gitconfig
mklink C:\Users\tscheffert\.gitignore C:\Users\tscheffert\.dotfiles\.gitignore
mklink C:\Users\tscheffert\.jscs.json C:\Users\tscheffert\.dotfiles\.jscs.json
mklink C:\Users\tscheffert\.jshintrc C:\Users\tscheffert\.dotfiles\.jshintrc
mklink C:\Users\tscheffert\.vimrc C:\Users\tscheffert\.dotfiles\.vimrc
mkdir %userprofile%\Documents\WindowsPowerShell
mklink C:\Users\tscheffert\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 C:\Users\tscheffert\.dotfiles\powershell\Microsoft.PowerShell_profile.ps1
::mklink C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 C:\Users\tscheffert\.dotfiles\PowerShell\profile.ps1
::mklink C:\Users\tscheffert\Documents\WindowsPowerShell\PowerTabConfig.xml C:\Users\tscheffert\.dotfiles\PowerShell\PowerTabConfig.xml
::mklink C:\Users\tscheffert\Documents\WindowsPowerShell\TabExpansion.xml C:\Users\tscheffert\.dotfiles\PowerShell\TabExpansion.xml
mklink C:\Users\tscheffert\.agignore C:\Users\tscheffert\.dotfiles\.agignore
mklink C:\Users\tscheffert\.pryrc C:\Users\tscheffert\.dotfiles\.pryrc
mklink %userprofile%\.irbrc %userprofile%\.dotfiles\.irbrc
mklink %userprofile%\console_config.rb %userprofile%\.dotfiles\console_config.rb
mklink C:\Users\tscheffert\.gemrc C:\Users\tscheffert\.dotfiles\.gemrc
mklink C:\Users\tscheffert\.tmux.conf C:\Users\tscheffert\.dotfiles\.tmux.conf
mklink C:\Users\tscheffert\.zshrc C:\Users\tscheffert\.dotfiles\.zshrc
mklink C:\Users\tscheffert\.aprc C:\Users\tscheffert\.dotfiles\.aprc
mklink C:\Users\tscheffert\.ctags C:\Users\tscheffert\.dotfiles\.ctags
mklink %userprofile%\.yamllint mklink %userprofile%\.dotfiles\.yamllint

pause

Add files that were missed on Windows

Boostrap: Add files that were missed on Windows


mklink /j C:\Users\tscheffert\bin C:\Users\tscheffert\.dotfiles\bin
mklink /j C:\Users\tscheffert\init C:\Users\tscheffert\.dotfiles\init
mklink /j C:\Users\tscheffert\source C:\Users\tscheffert\.dotfiles\source
mklink /j C:\Users\tscheffert\vimfiles C:\Users\tscheffert\.dotfiles\vimfiles
mklink /h C:\Users\tscheffert\.bash_profile C:\Users\tscheffert\.dotfiles\.bash_profile
mklink /h C:\Users\tscheffert\.bash_prompt C:\Users\tscheffert\.dotfiles\.bash_prompt
mklink /h C:\Users\tscheffert\.bashrc C:\Users\tscheffert\.dotfiles\.bashrc
mklink /h C:\Users\tscheffert\.curlrc C:\Users\tscheffert\.dotfiles\.curlrc
mklink /h C:\Users\tscheffert\.editorconfig C:\Users\tscheffert\.dotfiles\.editorconfig
mklink /h C:\Users\tscheffert\.gitconfig C:\Users\tscheffert\.dotfiles\.gitconfig
mklink /h C:\Users\tscheffert\.gitignore C:\Users\tscheffert\.dotfiles\.gitignore
mklink /h C:\Users\tscheffert\.jscs.json C:\Users\tscheffert\.dotfiles\.jscs.json
mklink /h C:\Users\tscheffert\.jshintrc C:\Users\tscheffert\.dotfiles\.jshintrc
mklink /h C:\Users\tscheffert\.osx C:\Users\tscheffert\.dotfiles\.osx
mklink /h C:\Users\tscheffert\.vimrc C:\Users\tscheffert\.dotfiles\.vimrc
mklink /h C:\Users\tscheffert\coffeelint.json C:\Users\tscheffert\.dotfiles\coffeelint.json
mklink /h C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 C:\Users\tscheffert\.dotfiles\PowerShell\profile.ps1
mklink /h C:\Users\tscheffert\Documents\WindowsPowerShell\PowerTabConfig.xml C:\Users\tscheffert\.dotfiles\PowerShell\PowerTabConfig.xml
mklink /h C:\Users\tscheffert\Documents\WindowsPowerShell\TabExpansion.xml C:\Users\tscheffert\.dotfiles\PowerShell\TabExpansion.xml
mklink /h C:\Users\tscheffert\.ptignore C:\Users\tscheffert\.dotfiles\.ptignore

pause

mklink /j C:\Users\tscheffert\bin C:\Users\tscheffert\.dotfiles\bin
mklink /j C:\Users\tscheffert\init C:\Users\tscheffert\.dotfiles\init
mklink /j C:\Users\tscheffert\source C:\Users\tscheffert\.dotfiles\source
mklink /j C:\Users\tscheffert\vimfiles C:\Users\tscheffert\.dotfiles\vimfiles
mklink C:\Users\tscheffert\.bash_profile C:\Users\tscheffert\.dotfiles\.bash_profile
mklink C:\Users\tscheffert\.bash_prompt C:\Users\tscheffert\.dotfiles\.bash_prompt
mklink C:\Users\tscheffert\.bashrc C:\Users\tscheffert\.dotfiles\.bashrc
mklink C:\Users\tscheffert\.curlrc C:\Users\tscheffert\.dotfiles\.curlrc
mklink C:\Users\tscheffert\.editorconfig C:\Users\tscheffert\.dotfiles\.editorconfig
mklink C:\Users\tscheffert\.gitconfig C:\Users\tscheffert\.dotfiles\.gitconfig
mklink C:\Users\tscheffert\.gitignore C:\Users\tscheffert\.dotfiles\.gitignore
mklink C:\Users\tscheffert\.git-prompt.sh C:\Users\tscheffert\.dotfiles\.git-prompt.sh
mklink C:\Users\tscheffert\.jscs.json C:\Users\tscheffert\.dotfiles\.jscs.json
mklink C:\Users\tscheffert\.jshintrc C:\Users\tscheffert\.dotfiles\.jshintrc
mklink C:\Users\tscheffert\.osx C:\Users\tscheffert\.dotfiles\.osx
mklink C:\Users\tscheffert\.vimrc C:\Users\tscheffert\.dotfiles\.vimrc
mklink C:\Users\tscheffert\coffeelint.json C:\Users\tscheffert\.dotfiles\coffeelint.json
mklink C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 C:\Users\tscheffert\.dotfiles\PowerShell\profile.ps1
mklink C:\Users\tscheffert\Documents\WindowsPowerShell\PowerTabConfig.xml C:\Users\tscheffert\.dotfiles\PowerShell\PowerTabConfig.xml
mklink C:\Users\tscheffert\Documents\WindowsPowerShell\TabExpansion.xml C:\Users\tscheffert\.dotfiles\PowerShell\TabExpansion.xml
mklink C:\Users\tscheffert\.ptignore C:\Users\tscheffert\.dotfiles\.ptignore

pause

Add .git-prompt.sh to bootstrap.bat

Fix: Add .git-prompt.sh to bootstrap.bat


pythonw.exe keylogging.py
:: It may be interesting to leave a shortcut to this file in the boot.

Update serafina.bat

Update serafina.bat


call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
echo on

SET SdksFolderPath=C:/SDKs

cd ..\pthread-win32
msbuild pthread.2015.sln /m /t:Build /p:Configuration=Release;Platform=x64
cd ..
REM The last character of the target path must be not "/" but "\".
xcopy /E /D /Y /Q "pthread-win32"  "%SdksFolderPath%/GerHobbelt/pthread-win32\"

cd /d "%~dp0"

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
echo on

SET SdksFolderPath=C:/SDKs

cd ..\pthread-win32
msbuild pthread.2015.sln /m /t:Build /p:Configuration=Release;Platform=x64
cd ..
REM The last character of the target path must be not "/" but "\".
xcopy /E /D /Y /Q "pthread-win32"  "%SdksFolderPath%/GerHobbelt/pthread-win32\"
copy "%SdksFolderPath%\GerHobbelt\pthread-win32\bin\x64_MSVC2015.Release\pthread_lib.lib" "%SdksFolderPath%\GerHobbelt\pthread-win32\bin\x64_MSVC2015.Release\pthread.lib"

cd /d "%~dp0"

Update Pthread.cmd

Update Pthread.cmd

 * pthread.lib is necessary, so copy pthread_lib.lib to pthread.lib.


@echo off

rem Generate the header file from the Store info about in which git branch,
rem what SHA1 and at what date/time we executed make.

for /f "delims=" %%a in ('powershell.exe -command "& {Get-Content .\etc\gitinfo.txt | select -First 1}"') do set GIT_BRANCH=%%a
for /f "delims=" %%a in ('powershell.exe -command "& {Get-Content .\etc\gitinfo.txt | select -First 2 | select -Last 1}"') do set GIT_COMMIT=%%a

echo '#ifndef ROOT_RGITCOMMIT_H' > $1
echo '#define ROOT_RGITCOMMIT_H' >> $1
echo '#define ROOT_GIT_BRANCH "%GIT_BRANCH%"' >> $1
echo '#define ROOT_GIT_COMMIT "%GIT_COMMIT%"' >> $1
echo '#endif' >> $1

@echo off

rem Generate the header file from the Store info about in which git branch,
rem what SHA1 and at what date/time we executed make.

for /f "delims=" %%a in ('powershell.exe -command "& {Get-Content .\etc\gitinfo.txt | select -First 1}"') do set GIT_BRANCH=%%a
for /f "delims=" %%a in ('powershell.exe -command "& {Get-Content .\etc\gitinfo.txt | select -First 2 | select -Last 1}"') do set GIT_COMMIT=%%a

echo #ifndef ROOT_RGITCOMMIT_H > %1
echo #define ROOT_RGITCOMMIT_H >> %1
echo #define ROOT_GIT_BRANCH "%GIT_BRANCH%" >> %1
echo #define ROOT_GIT_COMMIT "%GIT_COMMIT%" >> %1
echo #endif >> %1

Use proper batch script syntax

Use proper batch script syntax


@echo off
FOR /F "usebackq" %%t IN (`where vim`) DO SET _VIM=%%t
set VIM=%_VIM:\vim.exe=%
set _VIMRC=%HOME%\_vimrc
if exist %_VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %_VIMRC% goto DOTVIMRC

:DOTVIMRC
set VIMRC=%HOME%\.vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto VIMFILES

:VIMFILES
set VIMRC=%HOME%\vimfiles\vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto ORIGIN_VIM

:ORIGIN_VIM
set VIMRC=%VIM%\_vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto NO_EXEC_NEOBUNDLE_INSTALL

@echo on
:EXEC_NEOBUNDLE_INSTALL
vim -N -u %VIMRC% -c "try | NeoBundleInstall! %* | finally | qall! | endtry" -U NONE -i NONE -V1 -e -s

:NO_EXEC_NEOBUNDLE_INSTALL
echo 'vimrc is NotFound.'

add neoinstall.bat

add neoinstall.bat


SET GOPATH=%CD%\gopath
SET PATH=%PATH%;%CD%\gopath\bin

cd gopath\src\github.com\cloudfoundry\cli

SET GODEPSPATH=%CD%\Godeps\_workspace
SET GOPATH=%GODEPSPATH%;%GOPATH%;
SET PATH=%PATH%;%GODEPSPATH%\bin

go get github.com/jteeuwen/go-bindata/... || exit /b 1
go-bindata -pkg resources -ignore ".go" -o cf/resources/i18n_resources.go cf/i18n/resources/... cf/i18n/test_fixtures/... || exit /b 1

powershell -command set-executionpolicy remotesigned < NUL || exit /b 1
powershell .\bin\replace-sha.ps1 < NUL || exit /b 1

go build -v -o %CF_EXE_NAME% ./main || exit /b 1

REM go install github.com/onsi/ginkgo/ginkgo || exit /b 1

REM ginkgo -cover -r ./cf ./generic ./testhelpers ./main

SET GOPATH=%CD%\gopath
SET PATH=%PATH%;%CD%\gopath\bin

cd gopath\src\github.com\cloudfoundry\cli

SET GODEPSPATH=%CD%\Godeps\_workspace
SET GOPATH=%GODEPSPATH%;%GOPATH%
SET PATH=%PATH%;%GODEPSPATH%\bin

go get github.com/jteeuwen/go-bindata/... || exit /b 1
go-bindata -pkg resources -ignore ".go" -o cf/resources/i18n_resources.go cf/i18n/resources/... cf/i18n/test_fixtures/... || exit /b 1

powershell -command set-executionpolicy remotesigned < NUL || exit /b 1
powershell .\bin\replace-sha.ps1 < NUL || exit /b 1

go build -v -o %CF_EXE_NAME% ./main || exit /b 1

REM go install github.com/onsi/ginkgo/ginkgo || exit /b 1

REM ginkgo -cover -r ./cf ./generic ./testhelpers ./main

Remove trailing semicolon in GOPATH [#104131294]

Causes Go 1.5 to complain about the " " path after the semicolon.


@echo off
setlocal enabledelayedexpansion

:: Builds the shell extension and installer

set KRITASHELLEX_VERSION_STRING=dev
::set KRITASHELLEX_VERSION_STRING=v1.2.4
set CMAKE_EXE=cmake.exe
set MAKENSIS_EXE=C:\Program Files (x86)\NSIS\makensis.exe
set SEVENZIP_EXE=%ProgramFiles%\7-Zip\7z.exe

:: Do not modify for release builds! You can use "Debug" for debug builds.
set BUILD_CONFIGURATION=Release

mkdir build
mkdir build\x86
mkdir build\x64
mkdir output
mkdir output\krita-nsis
mkdir output\krita-nsis\include

echo Building 32-bit shell extension...
pushd build\x86
"%CMAKE_EXE%" -G "Visual Studio 14 2015" ..\..
"%CMAKE_EXE%" --build . --config %BUILD_CONFIGURATION%
popd

echo Building 64-bit shell extension...
pushd build\x64
"%CMAKE_EXE%" -G "Visual Studio 14 2015 Win64" ..\..
"%CMAKE_EXE%" --build . --config %BUILD_CONFIGURATION%
popd

pushd output
copy /y ..\build\x86\KritaShellExtension\%BUILD_CONFIGURATION%\kritashellex32.dll .
copy /y ..\build\x64\KritaShellExtension\%BUILD_CONFIGURATION%\kritashellex64.dll .
"%MAKENSIS_EXE%" ^
    /DKRITASHELLEX_DLL_SOURCE_DIR=!CD!\ ^
    /DKRITASHELLEX_INSTALLER_OUTPUT=!CD!\KritaShellExtension-!KRITASHELLEX_VERSION_STRING!-setup.exe ^
    /X"SetCompressor /SOLID lzma" ^
    /V4 /P3 ^
    ..\installer\nsis\installer_shellex.nsi
copy /y ..\COPYING.txt .
copy /y ..\COPYING_libzip.txt .
copy /y ..\COPYING_tinyxml2.txt .
copy /y ..\COPYING_zlib.txt .
copy /y ..\README.md README.txt
"%CMAKE_EXE%" -E touch CHANGELOG.TODO

:: Prepare Krita installer package
copy /y kritashellex32.dll .\krita-nsis\
copy /y kritashellex64.dll .\krita-nsis\
type COPYING.txt > .\krita-nsis\COPYING.txt
echo. >> .\krita-nsis\COPYING.txt
echo ## libzip: >> .\krita-nsis\COPYING.txt
type COPYING_libzip.txt >> .\krita-nsis\COPYING.txt
echo. >> .\krita-nsis\COPYING.txt
echo ## tinyxml2: >> .\krita-nsis\COPYING.txt
type COPYING_tinyxml2.txt >> .\krita-nsis\COPYING.txt
echo. >> .\krita-nsis\COPYING.txt
echo ## zlib: >> .\krita-nsis\COPYING.txt
type COPYING_zlib.txt >> .\krita-nsis\COPYING.txt
copy /y ..\installer\nsis\installer_krita.nsi .\krita-nsis\
copy /y ..\installer\nsis\krita_versions_detect.nsh .\krita-nsis\
copy /y ..\installer\nsis\krita_shell_integration.nsh .\krita-nsis\
copy /y ..\installer\nsis\include\FileExists2.nsh .\krita-nsis\include\
copy /y ..\installer\nsis\include\IsFileInUse.nsh .\krita-nsis\include\
copy /y ..\installer\nsis\krita.ico .\krita-nsis\
copy /y ..\installer\nsis\kritafile.ico .\krita-nsis\
copy /y ..\installer\nsis\license.rtf .\krita-nsis\
copy /y ..\installer\nsis\license_gpl-3.0.rtf .\krita-nsis\

del krita-nsis-!KRITASHELLEX_VERSION_STRING!.zip
"%SEVENZIP_EXE%" a -tzip krita-nsis-!KRITASHELLEX_VERSION_STRING!.zip krita-nsis\

echo.
echo Update CHANGELOG file before releasing^!
popd

@echo off
setlocal enabledelayedexpansion

:: Builds the shell extension and installer

set KRITASHELLEX_VERSION_STRING=dev
::set KRITASHELLEX_VERSION_STRING=v1.2.4a
set CMAKE_EXE=cmake.exe
set MAKENSIS_EXE=C:\Program Files (x86)\NSIS\makensis.exe
set SEVENZIP_EXE=%ProgramFiles%\7-Zip\7z.exe

:: Do not modify for release builds! You can use "Debug" for debug builds.
set BUILD_CONFIGURATION=Release

mkdir build
mkdir build\x86
mkdir build\x64
mkdir output
mkdir output\krita-nsis
mkdir output\krita-nsis\include

echo Building 32-bit shell extension...
pushd build\x86
"%CMAKE_EXE%" -G "Visual Studio 14 2015" ..\..
"%CMAKE_EXE%" --build . --config %BUILD_CONFIGURATION%
popd

echo Building 64-bit shell extension...
pushd build\x64
"%CMAKE_EXE%" -G "Visual Studio 14 2015 Win64" ..\..
"%CMAKE_EXE%" --build . --config %BUILD_CONFIGURATION%
popd

pushd output
copy /y ..\build\x86\KritaShellExtension\%BUILD_CONFIGURATION%\kritashellex32.dll .
copy /y ..\build\x64\KritaShellExtension\%BUILD_CONFIGURATION%\kritashellex64.dll .
"%MAKENSIS_EXE%" ^
    /DKRITASHELLEX_DLL_SOURCE_DIR=!CD!\ ^
    /DKRITASHELLEX_INSTALLER_OUTPUT=!CD!\KritaShellExtension-!KRITASHELLEX_VERSION_STRING!-setup.exe ^
    /X"SetCompressor /SOLID lzma" ^
    /V4 /P3 ^
    ..\installer\nsis\installer_shellex.nsi
copy /y ..\COPYING.txt .
copy /y ..\COPYING_libzip.txt .
copy /y ..\COPYING_tinyxml2.txt .
copy /y ..\COPYING_zlib.txt .
copy /y ..\README.md README.txt
"%CMAKE_EXE%" -E touch CHANGELOG.TODO

:: Prepare Krita installer package
copy /y kritashellex32.dll .\krita-nsis\
copy /y kritashellex64.dll .\krita-nsis\
type COPYING.txt > .\krita-nsis\COPYING.txt
echo. >> .\krita-nsis\COPYING.txt
echo ## libzip: >> .\krita-nsis\COPYING.txt
type COPYING_libzip.txt >> .\krita-nsis\COPYING.txt
echo. >> .\krita-nsis\COPYING.txt
echo ## tinyxml2: >> .\krita-nsis\COPYING.txt
type COPYING_tinyxml2.txt >> .\krita-nsis\COPYING.txt
echo. >> .\krita-nsis\COPYING.txt
echo ## zlib: >> .\krita-nsis\COPYING.txt
type COPYING_zlib.txt >> .\krita-nsis\COPYING.txt
copy /y ..\installer\nsis\installer_krita.nsi .\krita-nsis\
copy /y ..\installer\nsis\krita_versions_detect.nsh .\krita-nsis\
copy /y ..\installer\nsis\krita_shell_integration.nsh .\krita-nsis\
copy /y ..\installer\nsis\include\FileExists2.nsh .\krita-nsis\include\
copy /y ..\installer\nsis\include\IsFileInUse.nsh .\krita-nsis\include\
copy /y ..\installer\nsis\krita.ico .\krita-nsis\
copy /y ..\installer\nsis\kritafile.ico .\krita-nsis\
copy /y ..\installer\nsis\license.rtf .\krita-nsis\
copy /y ..\installer\nsis\license_gpl-3.0.rtf .\krita-nsis\

del krita-nsis-!KRITASHELLEX_VERSION_STRING!.zip
"%SEVENZIP_EXE%" a -tzip krita-nsis-!KRITASHELLEX_VERSION_STRING!.zip krita-nsis\

echo.
echo Update CHANGELOG file before releasing^!
popd

Bump to v1.2.4a

Bump to v1.2.4a


### application.bat - 201x - votre nom ###
echo "Build : 10:00"
echo "version 1"

### application.bat - 2015 - Thibault ROGER ###
echo "Build : 10:00"
echo "version 1"

Add file header with right data

Add file header with right data


REM Using the artifacts plugin v1.3 on Windows seems to break the whole step
buildkite-agent artifact download "test\desktop\features\fixtures\maze_runner\WindowsBuild-%UNITY_VERSION%.zip" .
cd test\desktop\features\fixtures\maze_runner
7z x WindowsBuild-%UNITY_VERSION%.zip
cd ..\..\..
wsl -d Ubuntu bundle install
wsl -d bundle exec maze-runner --app=features/fixtures/maze_runner/WindowsBuild/Mazerunner.exe --os=windows

REM Using the artifacts plugin v1.3 on Windows seems to break the whole step
buildkite-agent artifact download "test\desktop\features\fixtures\maze_runner\WindowsBuild-%UNITY_VERSION%.zip" .
cd test\desktop\features\fixtures\maze_runner
7z x WindowsBuild-%UNITY_VERSION%.zip
cd ..\..\..
wsl -d Ubuntu bundle install
wsl -d Ubuntu bundle exec maze-runner --app=features/fixtures/maze_runner/WindowsBuild/Mazerunner.exe --os=windows

Correct wsl command

Correct wsl command


SET SCRIPTPATH=%~dp0
CD /D %~dp0

if exist "%SCRIPTPATH%boost_1_58_0.7z" (
    echo "boost already downloaded"
) else (
    Powershell.exe Invoke-WebRequest -OutFile boost_1_58_0.7z https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z
)

SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="C:\Program Files (x86)\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
	SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)

if exist "%SCRIPTPATH%boost_1_58_0/" (
	echo "boost already extracted"
) else (
    call %UNSIP_PROGRAMM% x "%SCRIPTPATH%/boost_1_58_0.7z" -o"%SCRIPTPATH%/"
)

SET SCRIPTPATH=%~dp0
CD /D %~dp0

if exist "%SCRIPTPATH%boost_1_58_0.7z" (
    echo "boost already downloaded"
) else (
    Powershell.exe Invoke-WebRequest -OutFile boost_1_58_0.7z https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox
)

SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="C:\Program Files (x86)\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
	SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)

if exist "%SCRIPTPATH%boost_1_58_0/" (
	echo "boost already extracted"
) else (
    call %UNSIP_PROGRAMM% x "%SCRIPTPATH%/boost_1_58_0.7z" -o"%SCRIPTPATH%/"
)

Fix boost download error

Fix boost download error


@echo off

call :debug start ...

setlocal enabledelayedexpansion

call :debug test maven installation ...
call mvn --version>nul 2>&1 && set mvnfound=true
if not defined mvnfound goto :mvnnotfound

set commands=install get deploy
rem maven get -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version|
rem maven install -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext
rem maven deploy -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext -i:repositoryId

call :debug supported commands: !commands!

call :debug parse arguments ...
set repoUrl=http://repo1.maven.org/maven2/
for %%c in (%*) do (
	set arg=%%c
	set opt=!arg:~0,2!
	set val=!arg:~3!
	if "x!arg!" equ "xinstall" (
		set command=install
	) else if "x!arg!" equ "xget" (
		set command=get
	) else if "x!opt!" equ "x-r" (
		set repoUrl=!val!
	) else if "x!opt!" equ "x-m" (
		for /f "tokens=1,2,3,4,5 delims=:" %%m in ("!val!") do (
			set groupId=%%m
			set artifactId=%%n
			set version=%%o
			set packaging=%%p
		)
	) else if "x!opt!" equ "x-f" (
		set file=!val!
	) else if "x!opt!" equ "x-i" (
		set repositoryId=%%q
	)
)

call :debug command: !command!
call :debug repoUrl: !repoUrl!
call :debug groupId: !groupId!
call :debug artifactId: !artifactId!
call :debug version: !version!
call :debug packaging: !packaging!
call :debug repositoryId: !repositoryId!
call :debug file: !file!

if not defined command goto :usage
for %%c in (!commands!) do (
	call :debug supported command: %%c
	if "x%%c" equ "x!command!" (
		call :debug command [!command!] is going to be executed ...
		goto :!command!
	)
)
goto :usage

:debug
if defined debug echo %*
goto :eof

:usage
echo usage:
echo   %~n0 get -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version
echo   %~n0 install -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext
echo   %~n0 deploy -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext -i:repositoryId
goto :exit

:install
mvn install:install-file -DgroupId=!groupId! -DartifactId=!artifactId! -Dversion=!version! -Dpackaging=!packaging! -Dfile=!file!
goto :exit

:deploy
mvn deploy:deploy-file -DgroupId=!groupId! -DartifactId=!artifactId! -Dversion=!version! -Dpackaging=!packaging! -Dfile=!file! -Durl=!repoUrl! -DrepositoryId=!repositoryId!
goto :exit

:get
mvn dependency:get -DrepoUrl=!repoUrl! -Dartifact=!groupId!:!artifactId!:!version!
goto :exit

:mvnnotfound
echo mvn not in PATH, program is going to exit.
goto :exit

:exit
endlocal

@echo off

call :debug start ...

setlocal enabledelayedexpansion

call :debug test maven installation ...
set mvnfound=
call mvn --version>nul 2>&1 && set mvnfound=true
if not defined mvnfound goto :mvnnotfound

set commands=install get deploy
rem maven get -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version [-t:targetDir]
rem maven install -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext
rem maven deploy -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext -i:repositoryId

call :debug supported commands: !commands!

call :debug parse arguments ...

set command=
set repoUrl=http://repo1.maven.org/maven2/
for %%c in (%*) do (
	set arg=%%c
	set opt=!arg:~0,2!
	set val=!arg:~3!
	if "x!arg!" equ "xinstall" (
		set command=install
	) else if "x!arg!" equ "xget" (
		set command=get
	) else if "x!opt!" equ "x-r" (
		set repoUrl=!val!
	) else if "x!opt!" equ "x-m" (
		for /f "tokens=1,2,3,4,5 delims=:" %%m in ("!val!") do (
			set groupId=%%m
			set artifactId=%%n
			set version=%%o
			set packaging=%%p
		)
	) else if "x!opt!" equ "x-f" (
		set file=!val!
	) else if "x!opt!" equ "x-i" (
		set repositoryId=!val!
	) else if "x!opt!" equ "x-t" (
		set targetDir=!val!
	)
)

call :debug command: !command!
call :debug repoUrl: !repoUrl!
call :debug groupId: !groupId!
call :debug artifactId: !artifactId!
call :debug version: !version!
call :debug packaging: !packaging!
call :debug repositoryId: !repositoryId!
call :debug file: !file!
call :debug targetDir: !targetDir!

if not defined command goto :usage
for %%c in (!commands!) do (
	call :debug supported command: %%c
	if "x%%c" equ "x!command!" (
		call :debug command [!command!] is going to be executed ...
		goto :!command!
	)
)
goto :usage

:debug
if defined debug echo %*
goto :eof

:usage
echo usage:
echo   %~n0 get -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version
echo   %~n0 install -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext
echo   %~n0 deploy -r:http://repo1.maven.org/maven2/ -m:groupId:artifactId:version:packaging -f:x:\path\to\file.ext -i:repositoryId
goto :exit

:install
call mvn install:install-file -DgroupId=!groupId! -DartifactId=!artifactId! -Dversion=!version! -Dpackaging=!packaging! -Dfile=!file!
goto :exit

:deploy
call mvn deploy:deploy-file -DgroupId=!groupId! -DartifactId=!artifactId! -Dversion=!version! -Dpackaging=!packaging! -Dfile=!file! -Durl=!repoUrl! -DrepositoryId=!repositoryId!
goto :exit

:get
set success=
call mvn dependency:get -DrepoUrl=!repoUrl! -Dartifact=!groupId!:!artifactId!:!version!
if defined targetDir (
	set repository=%USERPROFILE%\.m2\repository
	set localTmp=%TEMP%\%~n0_tmp
	type %USERPROFILE%\.m2\settings.xml|findstr /c:localRepository>!localTmp!
	set localRepository=
	for /f "usebackq tokens=2 delims=<> " %%r in (!localTmp!) do (
		if not defined localRepository (
			set localRepository=%%r
		)
	)
	set filename=!artifactId!-!version!.jar
	set relative=!groupId:.=\!\!artifactId!\!version!\!filename!
	call :debug local repository: !localRepository!
	call :debug repository: !repository!
	call :debug file relative to repository: !relative!
	if exist "!localRepository!\!relative!" (
		copy /b "!localRepository!\!relative!" !targetDir!\!filename!
	) else if exist "!repository!\!relative!" (
		copy /b "!repository!\!relative!" !targetDir!\!filename!
	)
)
goto :exit

:mvnnotfound
echo mvn not in PATH, program is going to exit.
goto :exit

:exit
endlocal

add copy feature for maven.bat

add copy feature for maven.bat


@rem This batch file is here to show you how I compile the official JSIL demos!
@rem Most of these build invocations will fail, because I cannot legally distribute the source to the demo in question.

@del /s/q jsil.org\demos\*.js
@title Building TouchThumbSticks
bin\JSILc "Examples\ThirdParty\TouchThumbSticks\TouchThumbSticks.sln" "jsil.org\demos\TouchThumbSticks\TouchThumbSticks.jsilconfig" --platform=x86 --configuration=Debug
@title Building Game Type
bin\JSILc "C:\Game Design\Game Type\CodeNew\GameType\GameType.sln" "jsil.org\demos\GameType\GameType.jsilconfig" --platform:x86 --configuration:Debug
@title Building Bytown Lumberjack
bin\JSILc "C:\Users\Kevin\Documents\Projects\lumberjack\LumberjackPC.sln" "C:\Users\Kevin\Documents\Projects\lumberjack\Lumberjack\Lumberjack\bin\x86\Debug\Lumberjack.XmlSerializers.dll" "jsil.org\demos\Lumberjack\Lumberjack.jsilconfig" --platform:x86 --configuration:Debug
@title Building Procedural Textures
bin\JSILc "Examples\ProceduralTextures\ProceduralTextures.sln"
@title Building Raytracer
bin\JSILc "Examples\SimpleRaytracer.sln"
@title Building Pathtracer
bin\JSILc "Examples\SimplePathtracer.sln"
@title Building WebGL
bin\JSILc "Examples\WebGL\WebGL.sln"
bin\JSILc "Examples\WebGL_Vertex_Structs\WebGL_Vertex_Structs.sln"
@title Building Tetris
bin\JSILc "Examples\ThirdParty\Tetris\tetris.sln" "jsil.org\demos\Tetris\Tetris.jsilconfig" --platform=x86 --configuration=Debug
@title Building Platformer Starter Kit
bin\JSILc "C:\Users\Kevin\Documents\Projects\PlatformerStarterKit\Platformer (Windows).sln" "jsil.org\demos\Platformer\Platformer.jsilconfig" --platform=x86 --configuration=Debug
@title Building RPG Starter Kit
bin\JSILc "C:\Users\Kevin\Documents\Projects\RPGStarterKit\RolePlayingGameWindows.sln" "C:\Users\Kevin\Documents\Projects\RPGStarterKit\RolePlayingGame\bin\x86\Debug\RolePlayingGame.XmlSerializers.dll" "jsil.org\demos\RPG\RPG.jsilconfig" --platform="Mixed Platforms" --configuration=Debug

Add comments to the top of build_demos.bat (issue #257)


@echo off
SETLOCAL

if NOT DEFINED JAVA_HOME goto err

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

rem Detect JVM version to figure out appropriate executable to use
if not exist "%JAVA_HOME%\bin\java.exe" (
echo JAVA_HOME points to an invalid Java installation (no java.exe found in "%JAVA_HOME%"^). Existing...
goto:eof
)
"%JAVA_HOME%\bin\java" -version 2>&1 | find "64-Bit" >nul:

if errorlevel 1 goto x86
set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
set SERVICE_ID=elasticsearch-service-x64
set ARCH=64-bit
goto checkExe

:x86
set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x86.exe
set SERVICE_ID=elasticsearch-service-x86
set ARCH=32-bit

:checkExe
if EXIST "%EXECUTABLE%" goto okExe
echo elasticsearch-service-(x86|x64).exe was not found...

:okExe
set ES_VERSION=${project.version}

if "%LOG_DIR%" == "" set LOG_DIR=%ES_HOME%\logs

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
set SERVICE_ID=%1

:checkServiceCmd

if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto

if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == manager goto doManagment
echo Unknown option "%SERVICE_CMD%"

:displayUsage
echo.
echo Usage: service.bat install^|remove^|start^|stop^|manager [SERVICE_ID]
goto:eof

:doStart
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
goto:eof
:started
echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
goto:eof
:stopped
echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
goto:eof
:managed
echo Succesfully started service manager for '%SERVICE_ID%'.
goto:eof

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
goto:eof
:removed
echo The service '%SERVICE_ID%' has been removed
goto:eof

:doInstall
echo Installing service      :  "%SERVICE_ID%"
echo Using JAVA_HOME (%ARCH%):  "%JAVA_HOME%"

rem Check JVM server dll first
set JVM_DLL=%JAVA_HOME%\jre\bin\server\jvm.dll
if exist "%JVM_DLL%" goto foundJVM

rem Check 'server' JRE (JRE installed on Windows Server)
set JVM_DLL=%JAVA_HOME%\bin\server\jvm.dll
if exist "%JVM_DLL%" goto foundJVM

rem Fallback to 'client' JRE
set JVM_DLL=%JAVA_HOME%\bin\client\jvm.dll

if exist "%JVM_DLL%" (
echo Warning: JAVA_HOME points to a JRE and not JDK installation; a client (not a server^) JVM will be used...
) else (
echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Existing...
goto:eof
)

:foundJVM
if "%ES_MIN_MEM%" == "" set ES_MIN_MEM=256m
if "%ES_MAX_MEM%" == "" set ES_MAX_MEM=1g

if NOT "%ES_HEAP_SIZE%" == "" set ES_MIN_MEM=%ES_HEAP_SIZE%
if NOT "%ES_HEAP_SIZE%" == "" set ES_MAX_MEM=%ES_HEAP_SIZE%

call:convertxm %ES_MIN_MEM% JVM_XMS
call:convertxm %ES_MAX_MEM% JVM_XMX

rem java_opts might be empty - init to avoid tripping commons daemon (if the command starts with ;)
if not "%JAVA_OPTS%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
if "%JAVA_OPTS%" == "" set JAVA_OPTS=-XX:+UseParNewGC

if NOT "%ES_HEAP_NEWSIZE%" == "" set JAVA_OPTS=%JAVA_OPTS% -Xmn%ES_HEAP_NEWSIZE%

if NOT "%ES_DIRECT_SIZE%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:MaxDirectMemorySize=%ES_DIRECT_SIZE%

rem thread stack size
set JVM_SS=256

REM Enable aggressive optimizations in the JVM
REM    - Disabled by default as it might cause the JVM to crash
REM set JAVA_OPTS=%JAVA_OPTS% -XX:+AggressiveOpts

set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC

set JAVA_OPTS=%JAVA_OPTS% -XX:CMSInitiatingOccupancyFraction=75
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCMSInitiatingOccupancyOnly

REM GC logging options -- uncomment to enable
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCTimeStamps
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintClassHistogram
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintTenuringDistribution
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCApplicationStoppedTime
REM JAVA_OPTS=%JAVA_OPTS% -Xloggc:/var/log/elasticsearch/gc.log

REM Causes the JVM to dump its heap on OutOfMemory.
set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError
REM The path to the heap dump location, note directory must exists and have enough
REM space for a full heap dump.
REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof

if "%DATA_DIR%" == "" set DATA_DIR=%ES_HOME%\data

if "%WORK_DIR%" == "" set WORK_DIR=%ES_HOME%

if "%CONF_DIR%" == "" set CONF_DIR=%ES_HOME%\config

if "%CONF_FILE%" == "" set CONF_FILE=%ES_HOME%\config\elasticsearch.yml

set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/lib/elasticsearch-%ES_VERSION%.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.default.config="%CONF_FILE%";-Des.default.path.home="%ES_HOME%";-Des.default.path.logs="%LOG_DIR%";-Des.default.path.data="%DATA_DIR%";-Des.default.path.work="%WORK_DIR%";-Des.default.path.conf="%CONF_DIR%"

set JVM_OPTS=%JAVA_OPTS: =;%

if not "%ES_JAVA_OPTS%" == "" set JVM_ES_JAVA_OPTS=%ES_JAVA_OPTS: =#%
if not "%ES_JAVA_OPTS%" == "" set JVM_OPTS=%JVM_OPTS%;%JVM_ES_JAVA_OPTS%

if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StopClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmSs %JVM_SS% --JvmMs %JVM_XMS% --JvmMx %JVM_XMX% --JvmOptions %JVM_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "Elasticsearch %ES_VERSION% (%SERVICE_ID%)" --Description "Elasticsearch %ES_VERSION% Windows Service - http://elasticsearch.org" --Jvm "%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%"

if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_ID%' service
goto:eof

:installed
echo The service '%SERVICE_ID%' has been installed.
goto:eof

:err
echo JAVA_HOME environment variable must be set!
pause

goto:eof

rem ---
rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts
rem ---
:convertxm
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
:kilo
rem convert to MB
set /a conv=%conv% / 1024
goto mega
:giga
rem convert to MB
set /a conv=%conv% * 1024
:mega
set "%~2=%conv%"
goto:eof

ENDLOCAL

@echo off
SETLOCAL

if NOT DEFINED JAVA_HOME goto err

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

rem Detect JVM version to figure out appropriate executable to use
if not exist "%JAVA_HOME%\bin\java.exe" (
echo JAVA_HOME points to an invalid Java installation (no java.exe found in "%JAVA_HOME%"^). Exiting...
goto:eof
)
"%JAVA_HOME%\bin\java" -version 2>&1 | find "64-Bit" >nul:

if errorlevel 1 goto x86
set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
set SERVICE_ID=elasticsearch-service-x64
set ARCH=64-bit
goto checkExe

:x86
set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x86.exe
set SERVICE_ID=elasticsearch-service-x86
set ARCH=32-bit

:checkExe
if EXIST "%EXECUTABLE%" goto okExe
echo elasticsearch-service-(x86|x64).exe was not found...

:okExe
set ES_VERSION=${project.version}

if "%LOG_DIR%" == "" set LOG_DIR=%ES_HOME%\logs

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
set SERVICE_ID=%1

:checkServiceCmd

if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto

if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == manager goto doManagment
echo Unknown option "%SERVICE_CMD%"

:displayUsage
echo.
echo Usage: service.bat install^|remove^|start^|stop^|manager [SERVICE_ID]
goto:eof

:doStart
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
goto:eof
:started
echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
goto:eof
:stopped
echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
goto:eof
:managed
echo Succesfully started service manager for '%SERVICE_ID%'.
goto:eof

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
goto:eof
:removed
echo The service '%SERVICE_ID%' has been removed
goto:eof

:doInstall
echo Installing service      :  "%SERVICE_ID%"
echo Using JAVA_HOME (%ARCH%):  "%JAVA_HOME%"

rem Check JVM server dll first
set JVM_DLL=%JAVA_HOME%\jre\bin\server\jvm.dll
if exist "%JVM_DLL%" goto foundJVM

rem Check 'server' JRE (JRE installed on Windows Server)
set JVM_DLL=%JAVA_HOME%\bin\server\jvm.dll
if exist "%JVM_DLL%" goto foundJVM

rem Fallback to 'client' JRE
set JVM_DLL=%JAVA_HOME%\bin\client\jvm.dll

if exist "%JVM_DLL%" (
echo Warning: JAVA_HOME points to a JRE and not JDK installation; a client (not a server^) JVM will be used...
) else (
echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Existing...
goto:eof
)

:foundJVM
if "%ES_MIN_MEM%" == "" set ES_MIN_MEM=256m
if "%ES_MAX_MEM%" == "" set ES_MAX_MEM=1g

if NOT "%ES_HEAP_SIZE%" == "" set ES_MIN_MEM=%ES_HEAP_SIZE%
if NOT "%ES_HEAP_SIZE%" == "" set ES_MAX_MEM=%ES_HEAP_SIZE%

call:convertxm %ES_MIN_MEM% JVM_XMS
call:convertxm %ES_MAX_MEM% JVM_XMX

rem java_opts might be empty - init to avoid tripping commons daemon (if the command starts with ;)
if not "%JAVA_OPTS%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
if "%JAVA_OPTS%" == "" set JAVA_OPTS=-XX:+UseParNewGC

if NOT "%ES_HEAP_NEWSIZE%" == "" set JAVA_OPTS=%JAVA_OPTS% -Xmn%ES_HEAP_NEWSIZE%

if NOT "%ES_DIRECT_SIZE%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:MaxDirectMemorySize=%ES_DIRECT_SIZE%

rem thread stack size
set JVM_SS=256

REM Enable aggressive optimizations in the JVM
REM    - Disabled by default as it might cause the JVM to crash
REM set JAVA_OPTS=%JAVA_OPTS% -XX:+AggressiveOpts

set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC

set JAVA_OPTS=%JAVA_OPTS% -XX:CMSInitiatingOccupancyFraction=75
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCMSInitiatingOccupancyOnly

REM GC logging options -- uncomment to enable
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCTimeStamps
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintClassHistogram
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintTenuringDistribution
REM JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCApplicationStoppedTime
REM JAVA_OPTS=%JAVA_OPTS% -Xloggc:/var/log/elasticsearch/gc.log

REM Causes the JVM to dump its heap on OutOfMemory.
set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError
REM The path to the heap dump location, note directory must exists and have enough
REM space for a full heap dump.
REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof

if "%DATA_DIR%" == "" set DATA_DIR=%ES_HOME%\data

if "%WORK_DIR%" == "" set WORK_DIR=%ES_HOME%

if "%CONF_DIR%" == "" set CONF_DIR=%ES_HOME%\config

if "%CONF_FILE%" == "" set CONF_FILE=%ES_HOME%\config\elasticsearch.yml

set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/lib/elasticsearch-%ES_VERSION%.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.default.config="%CONF_FILE%";-Des.default.path.home="%ES_HOME%";-Des.default.path.logs="%LOG_DIR%";-Des.default.path.data="%DATA_DIR%";-Des.default.path.work="%WORK_DIR%";-Des.default.path.conf="%CONF_DIR%"

set JVM_OPTS=%JAVA_OPTS: =;%

if not "%ES_JAVA_OPTS%" == "" set JVM_ES_JAVA_OPTS=%ES_JAVA_OPTS: =#%
if not "%ES_JAVA_OPTS%" == "" set JVM_OPTS=%JVM_OPTS%;%JVM_ES_JAVA_OPTS%

if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StopClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmSs %JVM_SS% --JvmMs %JVM_XMS% --JvmMx %JVM_XMX% --JvmOptions %JVM_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "Elasticsearch %ES_VERSION% (%SERVICE_ID%)" --Description "Elasticsearch %ES_VERSION% Windows Service - http://elasticsearch.org" --Jvm "%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%"

if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_ID%' service
goto:eof

:installed
echo The service '%SERVICE_ID%' has been installed.
goto:eof

:err
echo JAVA_HOME environment variable must be set!
pause

goto:eof

rem ---
rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts
rem ---
:convertxm
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
:kilo
rem convert to MB
set /a conv=%conv% / 1024
goto mega
:giga
rem convert to MB
set /a conv=%conv% * 1024
:mega
set "%~2=%conv%"
goto:eof

ENDLOCAL

Update service.bat

[DOCS] Update service.bat

corrected typo, Exiting instead of Existing

Close #5885


@rem Fetches (and builds if necessary) external dependencies

@rem Assume we start inside the Python source directory
cd ..
call "%VS90COMNTOOLS%vsvars32.bat"

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
   vcbuild db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static
)

@rem OpenSSL
if not exist openssl-0.9.8g (
  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a
  svn export http://svn.python.org/projects/external/openssl-0.9.8g
)

@rem tcltk
if not exist tcl8.4.16 (
   if exist tcltk rd /s/q tcltk
   if exist tcl8.4.12 rd /s/q tcl8.4.12
   if exist tk8.4.12 rd /s/q tk8.4.12
   svn export http://svn.python.org/projects/external/tcl8.4.16
   svn export http://svn.python.org/projects/external/tk8.4.16
   cd tcl8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
   cd ..\..
   cd tk8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
   cd ..\..
)

@rem sqlite
if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild

@rem Fetches (and builds if necessary) external dependencies

@rem Assume we start inside the Python source directory
cd ..
call "%VS90COMNTOOLS%vsvars32.bat"

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
@rem Remove VS 2003 builds
if exist db-4.4.20 if not exist db-4.4.20\build_win32\this_is_for_vs9 (
   echo Removing old build
   rd /s/q db-4.4.20
)
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20-vs9 db-4.4.20
if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
   vcbuild db-4.4.20\build_win32\db_static.vcproj "Debug|Win32"
)

@rem OpenSSL
if not exist openssl-0.9.8g (
  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a
  svn export http://svn.python.org/projects/external/openssl-0.9.8g
)

@rem tcltk
if not exist tcl8.4.16 (
   if exist tcltk rd /s/q tcltk
   if exist tcl8.4.12 rd /s/q tcl8.4.12
   if exist tk8.4.12 rd /s/q tk8.4.12
   svn export http://svn.python.org/projects/external/tcl8.4.16
   svn export http://svn.python.org/projects/external/tk8.4.16
   cd tcl8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
   cd ..\..
   cd tk8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
   cd ..\..
)

@rem sqlite
if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild

Build db-4.4.20 with VS9; remove VS2003 build if necessary.


@echo off
for /D %%i in (bundles/*) do (
  if exist "%cd%\bundles\%%i\package.json" (
    cd "%cd%\bundles\%%i"
    echo Updating %%i
    call npm install >nul 2>&1
  )
)

@echo off
for /D %%i in (bundles/*) do (
  if exist "%cd%\bundles\%%i\package.json" (
    pushd "%cd%\bundles\%%i"
    echo Updating %%i
    call npm install >nul 2>&1
    popd
  )
)

Fix windows bundle install staying in bundle dir after install


@echo off

if [%1] EQU [--path-only] goto path_only

:: Start the goodness
call clink inject --quiet

:: Setup aliases
if not exist %DOT%\clink\aliases (
  "%GIT_INSTALL_ROOT%\usr\bin\bash" --login %DOT%\clink\collect-aliases.sh
)
doskey /macrofile=%DOT%\clink\aliases

:: ENV
set _ZL_NO_CHECK=1
set FZF_DEFAULT_COMMAND=fd -t f
set FZF_DEFAULT_OPTS=--height=40%% --layout=reverse --bind "alt-e:execute(nvr {})"

:: Clean title
title cmd

:: Setup PATH
:path_only
if exist %USERPROFILE%\bin\ set PATH=%USERPROFILE%\bin;%PATH%
set PATH=%DOT%\win\bin;%PATH%
for /F %%p in ('scoop prefix z.lua') do set PATH=%PATH%;%%p

@echo off

if [%1] EQU [--path-only] goto path_only

:: Start the goodness
call clink inject --quiet

:: Setup aliases
if not exist %DOT%\clink\aliases (
  "%GIT_INSTALL_ROOT%\usr\bin\bash" --login %DOT%\clink\collect-aliases.sh
)
doskey /macrofile=%DOT%\clink\aliases

:: ENV
set _ZL_NO_CHECK=1
set FZF_DEFAULT_COMMAND=fd -t f
set FZF_DEFAULT_OPTS=--height=40%% --color=dark,gutter:-1 --layout=reverse --bind "alt-e:execute(nvr {})+abort"

:: Clean title
title cmd

:: Setup PATH
:path_only
if exist %USERPROFILE%\bin\ set PATH=%USERPROFILE%\bin;%PATH%
set PATH=%DOT%\win\bin;%PATH%
for /F %%p in ('scoop prefix z.lua') do set PATH=%PATH%;%%p

abort on edit and hide gutter

fzf: abort on edit and hide gutter


conda list -p "%PREFIX%" --canonical
if errorlevel 1 exit 1
for /f "delims=" %%i in ('conda list -p "%PREFIX%" --canonical') do set condalist=%%i
if errorlevel 1 exit 1
echo "%condalist%"
if not "%condalist%"=="conda-build-test-build-string-1.0-1" exit 1
cat "%PREFIX%\conda-meta\conda-build-test-build-string-1.0-1.json"
if errorlevel 1 exit 1
cat "%PREFIX%\conda-meta\conda-build-test-build-string-1.0-1.json" | grep '"build_number": 0'
if errorlevel 1 exit 1
cat "%PREFIX%\conda-meta\conda-build-test-build-string-1.0-1.json" | grep '"build": "abc"'
if errorlevel 1 exit 1

Add run_test.bat to build_string test recipe


@echo off
rem Runs CMake to configure GEOS for Visual Studio 2017.
rem Runs MSBuild to build the generated solution.
rem
rem Usage:
rem 1. Copy build.bat to build.local.bat (git ignored file)
rem 2. Make your adjustments in the CONFIGURATION section below
rem 3. Run build.local.bat 32|64
rem 4. Optionally, run devenv.exe {project}{32|64}.sln from command line

rem ### CONFIGURATION #####################################
rem #######################################################

if not defined VS150COMNTOOLS goto :NoVS
if [%1]==[] goto :Usage
if [%1]==[32] goto :32
if [%1]==[64] goto :64
goto :Usage

:32
set GEOSP=32
set MSBUILDP=Win32
set GENERATOR="Visual Studio 15 2017"
goto :Build

:64
set GEOSP=64
set MSBUILDP=x64
set GENERATOR="Visual Studio 15 2017 Win64"
goto :Build

:Build
set BUILDDIR=_build.vs2017x%GEOSP%
mkdir %BUILDDIR%
pushd %BUILDDIR%
"C:\Program Files\CMake\bin\cmake.exe" ^
    -G %GENERATOR% ^
    ..
move geos.sln geos%GEOSP%.sln
REM msbuild.exe geos%GEOSP%.sln /p:Configuration=Release /p:Platform=%MSBUILDP%
popd
goto :EOF

:NoVS
@echo build.bat
@echo  Visual Studio 2017 not found
@echo  "%%VS150COMNTOOLS%%" environment variable not defined
exit /B 1

:Usage
@echo build.bat
@echo Usage: build.bat [32 or 64]
exit /B 1

[CMake] Add build-cmake.bat utility for convenience.

Builds GEOS using CMake and Visual Studio 2017 for 32-bit or 64-bit platform.
(eg. cd geos; tools\build-cmake.bat 64)


@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~ %~f0 ~~~~~~

::show all available env vars
SET
ECHO cmake on AppVeyor
cmake -version

ECHO activating VS cmd prompt && CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET protobuf_sdk=protozero-dep-protobuf-2.6.1.7z
IF EXIST %protobuf_sdk% (ECHO protobuf already downloaded) ELSE (ECHO downloading protobuf ... && powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/$env:protobuf_sdk -OutFile $pwd\$env:protobuf_sdk)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST deps\protobuf (ECHO protobuf already extracted) ELSE (CALL 7z x -y %protobuf_sdk% | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%~dp0deps\protobuf;%PATH%

IF EXIST build ECHO deleting build dir... && RD /Q /S build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CD build
ECHO config^: %config%

::This will produce lots of LNK4099 warnings which can be ignored.
::Unfortunately they can't be disabled, see
::http://stackoverflow.com/questions/661606/visual-c-how-to-disable-specific-linker-warnings
SET CMAKE_CMD=cmake .. ^
-LA -G "Visual Studio 15 2017 Win64"

ECHO calling^: %CMAKE_CMD%
%CMAKE_CMD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET avlogger=
IF /I "%APPVEYOR%"=="True" SET avlogger=/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

msbuild protozero.sln ^
/p:Configuration=%config% ^
%avlogger%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ctest --output-on-failure ^
-C %config% ^
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~ ERROR %~f0 ~~~~~~
SET EL=%ERRORLEVEL%

:DONE
IF %EL% NEQ 0 ECHO. && ECHO !!! ERRORLEVEL^: %EL% !!! && ECHO.
ECHO ~~~~~~ DONE %~f0 ~~~~~~

EXIT /b %EL%

@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~ %~f0 ~~~~~~

::show all available env vars
SET
ECHO cmake on AppVeyor
cmake -version

ECHO activating VS cmd prompt && CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET protobuf_sdk=protozero-dep-protobuf-2.6.1.7z
IF EXIST %protobuf_sdk% (ECHO protobuf already downloaded) ELSE (ECHO downloading protobuf ... && powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/$env:protobuf_sdk -OutFile $pwd\$env:protobuf_sdk)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST deps\protobuf (ECHO protobuf already extracted) ELSE (CALL 7z x -y %protobuf_sdk% | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%~dp0deps\protobuf;%PATH%

IF EXIST build ECHO deleting build dir... && RD /Q /S build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CD build
ECHO config^: %config%

SET CMAKE_CMD=cmake .. ^
-LA -G "Visual Studio 15 2017 Win64"

ECHO calling^: %CMAKE_CMD%
%CMAKE_CMD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET avlogger=
IF /I "%APPVEYOR%"=="True" SET avlogger=/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

msbuild protozero.sln ^
/p:Configuration=%config% ^
%avlogger%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ctest --output-on-failure ^
-C %config% ^
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~ ERROR %~f0 ~~~~~~
SET EL=%ERRORLEVEL%

:DONE
IF %EL% NEQ 0 ECHO. && ECHO !!! ERRORLEVEL^: %EL% !!! && ECHO.
ECHO ~~~~~~ DONE %~f0 ~~~~~~

EXIT /b %EL%

Remove comment that doesn't apply (any more).


echo ON

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

call bootstrap.bat ^
    --with-libraries=python
if errorlevel 1 exit 1

echo %ARCH%

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

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

dir  %LIBRARY_LIB%
ECHO %LIBRARY_LIB%\boost_python-vc90-mt-1_61.dll "%LIBRARY_BIN%"
move %LIBRARY_LIB%\boost_python-vc90-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


@echo off
for /D %%i in (bundles/*) do (
  if exist "%cd%\bundles\%%i\package.json" (
    cd "%cd%\bundles\%%i"
    echo Updating %%i
    call npm install >nul 2>&1
  )
)

Add a batch file that performs bundle-install on windows. (#267)


@echo off

:: Backwards compatibility
if not defined AVALON_PROJECTS set AVALON_PROJECTS=%MINDBENDER_PROJECTS%
if not defined AVALON_MONGO set AVALON_MONGO=%MINDBENDER_MONGO%
if not defined AVALON_LOCATION set AVALON_LOCATION=%MINDBENDER_LOCATION%

set AVALON_LABEL=Mindbender

%~dp0bin\windows\python36\python.exe -u %~dp0avalon.py

@echo off

:: Backwards compatibility
if not defined AVALON_PROJECTS set AVALON_PROJECTS=%MINDBENDER_PROJECTS%
if not defined AVALON_MONGO set AVALON_MONGO=%MINDBENDER_MONGO%
if not defined AVALON_LOCATION set AVALON_LOCATION=%MINDBENDER_LOCATION%

set AVALON_LABEL=Mindbender

"%~dp0bin\windows\python36\python.exe" -u %~dp0avalon.py

Facilitate spaces in the path to mb-gui.bat


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

:: This script will try to find if svn and python are accessible and it not,
:: it will try to download it and 'install' it in depot_tools.

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools
set GIT_BIN_DIR=git-1.8.0_bin

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:GIT_CHECK
:: If the batch file exists, skip the git check.
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :GIT_INSTALL
if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
goto :SVN_CHECK

:GIT_INSTALL
echo Installing git (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%~dp0git.zip" del "%~dp0git.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%~dp0git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%~dp0git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo Please visit http://code.google.com/p/msysgit to download the latest git
echo client before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :PYTHON_CHECK

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%~dp0svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :PYTHON_CHECK

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo Please visit http://subversion.tigris.org to download the latest subversion client
echo before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:PYTHON_CHECK
:: If the batch file exists, skip the python check.
set ERRORLEVEL=0
if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
call python --version 2>nul 1>nul
if errorlevel 1 goto :PYTHON_INSTALL

:: We are done.
set ERRORLEVEL=0
goto :END

:PYTHON_INSTALL
echo Installing python ...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
if errorlevel 1 goto :PYTHON_FAIL
:: Create the batch files.
call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

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

:: This script will try to find if svn and python are accessible and it not,
:: it will try to download it and 'install' it in depot_tools.

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools
set GIT_BIN_DIR=git-1.8.0_bin

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:GIT_CHECK
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :SVN_CHECK
if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
goto :SVN_CHECK

:GIT_INSTALL
echo Installing git (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%~dp0git.zip" del "%~dp0git.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%~dp0git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%~dp0git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo Please visit http://code.google.com/p/msysgit to download the latest git
echo client before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :PYTHON_CHECK

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%~dp0svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :PYTHON_CHECK

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo Please visit http://subversion.tigris.org to download the latest subversion client
echo before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:PYTHON_CHECK
:: If the batch file exists, skip the python check.
set ERRORLEVEL=0
if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
call python --version 2>nul 1>nul
if errorlevel 1 goto :PYTHON_INSTALL

:: We are done.
set ERRORLEVEL=0
goto :END

:PYTHON_INSTALL
echo Installing python ...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
if errorlevel 1 goto :PYTHON_FAIL
:: Create the batch files.
call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

Fix logic for checking whether git is installed.

TBR=maruel@chromium.org
Review URL: https://codereview.chromium.org/11377002

git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@166259 0039d316-1c4b-4281-b951-d872f2087c98


@echo off
if exist version.cmd call version.cmd
if "%INSTALLDIR%" == "" set "INSTALLDIR=%~dp0"
if not exist "%INSTALLDIR%\nyagos.exe" set "INSTALLDIR=%~dp0"
if not "%2" == "" set "INSTALLDIR=%2"

for /F %%I in ('cscript /nologo specialfolders.vbs desktop') do cscript /nologo lnk.vbs "%INSTALLDIR%\nyagos.exe" "%%I" "WorkingDirectory=%USERPROFILE%" "HotKey=CTRL+ALT+N" "Description=Nihongo Yet Another GOing Shell" "IconLocation=nyagos.exe,0"

@echo off
if exist version.cmd call version.cmd
if "%INSTALLDIR%" == "" set "INSTALLDIR=%~dp0"
if not exist "%INSTALLDIR%\nyagos.exe" set "INSTALLDIR=%~dp0"
if not "%2" == "" set "INSTALLDIR=%2"

for /F %%I in ('cscript /nologo specialfolders.vbs desktop') do cscript /nologo lnk.vbs "%INSTALLDIR%\nyagos.exe" "%%I\Nihongo Yet Another GOing Shell.lnk" "WorkingDirectory=%USERPROFILE%" "HotKey=CTRL+ALT+N" "Description=Nihongo Yet Another GOing Shell" "IconLocation=nyagos.exe,0"

Change shortcut title

Change shortcut title


@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 %*

@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 -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

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 %*

Update 'build.cmd' to pull Sake from v2 NuGet feed.


@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
.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
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@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
.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\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
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Update K_BUILD_VERSION/kre/KRE/.k => DNX_BUILD_VERSION/dnx/DNX/.dnx.