@ECHO OFF
rem ******************************************************************************
rem *
rem * Notepad2-mod
rem *
rem * build.cmd
rem *   Batch file "wrapper" for makefile.mak, used to build Notepad2 with WDK
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem *                                       (c) XhmikosR 2010
rem *                                       http://code.google.com/p/notepad2-mod/
rem *
rem ******************************************************************************

SETLOCAL
CD /D %~dp0

rem Set the WDK and SDK directories
SET "WDKBASEDIR=C:\WinDDK\7600.16385.1"
SET "SDKDIR=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1"

rem Check the building environment
IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!"
IF NOT EXIST "%SDKDIR%" CALL :SUBMSG "ERROR" "Specify your SDK directory!"

rem check for the help switches
IF /I "%1"=="help" GOTO :SHOWHELP
IF /I "%1"=="/help" GOTO :SHOWHELP
IF /I "%1"=="-help" GOTO :SHOWHELP
IF /I "%1"=="--help" GOTO :SHOWHELP
IF /I "%1"=="/?" GOTO :SHOWHELP
GOTO :CHECK

:SHOWHELP
TITLE "build.cmd %1"
ECHO.
ECHO:Usage:  build.cmd [Clean^|Build^|Rebuild] [x86^|x64^|all]
ECHO.
ECHO:You can use prefix the commands with "-", "--" or "/"
ECHO.
ECHO.
ECHO:Edit "build.cmd" and set your WDK and SDK directories.
ECHO:You shouldn't need to make any changes other than that.
ECHO.
ECHO.
ECHO:Executing "build.cmd" will use the defaults: "build.cmd build all"
ECHO:If you skip the second argument the default one will be used. Example:
ECHO:"build.cmd rebuild" is equivalent to "build.cmd rebuild all"
ECHO:NOTE: "build.cmd x86" won't work.
ECHO.
ENDLOCAL
EXIT /B

:CHECK
REM Check for the switches
IF "%1" == "" (
SET BUILDTYPE=Build
SET ARCH=all
) ELSE (
IF /I "%1" == "Build" SET BUILDTYPE=Build
IF /I "%1" == "/Build" SET BUILDTYPE=Build
IF /I "%1" == "-Build" SET BUILDTYPE=Build
IF /I "%1" == "--Build" SET BUILDTYPE=Build
IF /I "%1" == "Clean" SET BUILDTYPE=Clean
IF /I "%1" == "/Clean" SET BUILDTYPE=Clean
IF /I "%1" == "-Clean" SET BUILDTYPE=Clean
IF /I "%1" == "--Clean" SET BUILDTYPE=Clean
IF /I "%1" == "Rebuild" SET BUILDTYPE=Rebuild
IF /I "%1" == "/Rebuild" SET BUILDTYPE=Rebuild
IF /I "%1" == "-Rebuild" SET BUILDTYPE=Rebuild
IF /I "%1" == "--Rebuild" SET BUILDTYPE=Rebuild
IF /I "%2" == "x86" SET ARCH=x86
IF /I "%2" == "/x86" SET ARCH=x86
IF /I "%2" == "-x86" SET ARCH=x86
IF /I "%2" == "--x86" SET ARCH=x86
IF /I "%2" == "x64" SET ARCH=x64
IF /I "%2" == "/x64" SET ARCH=x64
IF /I "%2" == "-x64" SET ARCH=x64
IF /I "%2" == "--x64" SET ARCH=x64
IF /I "%2" == "all" SET ARCH=all
IF /I "%2" == "/all" SET ARCH=all
IF /I "%2" == "-all" SET ARCH=all
IF /I "%2" == "--all" SET ARCH=all
GOTO :START
)

:START
IF /I "%BUILDTYPE%" == "Clean" GOTO :x86
PUSHD ..
CALL "update_version.bat"
POPD

:x86
SET "INCLUDE=%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x64" GOTO :x64

TITLE Building Notepad2 x86...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE clean
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE clean
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64

:x64
SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x86" GOTO :END

TITLE Building Notepad2 x64...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE "x64=1" clean
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE "x64=1" clean

:END
TITLE Building Notepad2 - Finished!
ENDLOCAL
EXIT /B

:SUBNMAKE
nmake /NOLOGO /f "makefile.mak" %1 %2
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
EXIT /B

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

@ECHO OFF
rem ******************************************************************************
rem *
rem * Notepad2-mod
rem *
rem * build.cmd
rem *   Batch file "wrapper" for makefile.mak, used to build Notepad2 with WDK
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem *                                       (c) XhmikosR 2010
rem *                                       http://code.google.com/p/notepad2-mod/
rem *
rem ******************************************************************************

SETLOCAL
CD /D %~dp0

rem Set the WDK and SDK directories
SET "WDKBASEDIR=C:\WinDDK\7600.16385.1"
SET "SDKDIR=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1"

rem Check the building environment
IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!"
IF NOT EXIST "%SDKDIR%" CALL :SUBMSG "ERROR" "Specify your SDK directory!"

rem check for the help switches
IF /I "%1"=="help" GOTO :SHOWHELP
IF /I "%1"=="/help" GOTO :SHOWHELP
IF /I "%1"=="-help" GOTO :SHOWHELP
IF /I "%1"=="--help" GOTO :SHOWHELP
IF /I "%1"=="/?" GOTO :SHOWHELP
GOTO :CHECKFIRSTARG

:SHOWHELP
TITLE "build.cmd %1"
ECHO.
ECHO:Usage:  build.cmd [Clean^|Build^|Rebuild] [x86^|x64^|all]
ECHO.
ECHO:You can use prefix the commands with "-", "--" or "/"
ECHO.
ECHO.
ECHO:Edit "build.cmd" and set your WDK and SDK directories.
ECHO:You shouldn't need to make any changes other than that.
ECHO.
ECHO.
ECHO:Executing "build.cmd" will use the defaults: "build.cmd build all"
ECHO:If you skip the second argument the default one will be used. Example:
ECHO:"build.cmd rebuild" is equivalent to "build.cmd rebuild all"
ECHO:NOTE: "build.cmd x86" won't work.
ECHO.
ENDLOCAL
EXIT /B

:CHECKFIRSTARG
REM Check for the first switch
IF "%1" == "" (
SET BUILDTYPE=Build
) ELSE (
IF /I "%1" == "Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
ECHO.
ECHO:Unsupported commandline switch!
ECHO:Run "build.cmd help" for details about the commandline switches.
CALL :SUBMSG "ERROR" "Compilation failed!"
)

:CHECKSECONDARG
REM Check for the second switch
IF "%2" == "" (
SET ARCH=all
) ELSE (
IF /I "%2" == "x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "/x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "-x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "--x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "/x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "-x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "--x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "all" SET ARCH=all&&GOTO :START
IF /I "%2" == "/all" SET ARCH=all&&GOTO :START
IF /I "%2" == "-all" SET ARCH=all&&GOTO :START
IF /I "%2" == "--all" SET ARCH=all&&GOTO :START
ECHO.
ECHO:Unsupported commandline switch!
ECHO:Run "build.cmd help" for details about the commandline switches.
CALL :SUBMSG "ERROR" "Compilation failed!"
)

:START
IF /I "%BUILDTYPE%" == "Clean" GOTO :x86
PUSHD ..
CALL "update_version.bat"
POPD

:x86
SET "INCLUDE=%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x64" GOTO :x64

TITLE Building Notepad2 x86...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE clean
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE clean
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64

:x64
SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x86" GOTO :END

TITLE Building Notepad2 x64...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE "x64=1" clean
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE "x64=1" clean

:END
TITLE Building Notepad2 - Finished!
ENDLOCAL
EXIT /B

:SUBNMAKE
nmake /NOLOGO /f "makefile.mak" %1 %2
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
EXIT /B

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

update build.cmd

update build.cmd


fix incorrect ANSI escape sequence

fix incorrect ANSI escape sequence


Update runhmodwin64.bat

Update runhmodwin64.bat


@ECHO OFF
PUSHD %~DP0
SET CURDIR=%CD%
PUSHD ..
SET TOPDIR=%CD%
POPD
POPD

SET GDAL_ROOT=%TOPDIR%\bin\gdal
SET GDAL_PAM_PROXY_DIR=%TEMP%
SET GDAL_DATA=%GDAL_ROOT%\share\gdal-data
SET GEOTIFF_CSV=%GDAL_DATA%
SET PROJ_LIB=%GDAL_ROOT%\share\proj
SET GDAL_DRIVER_PATH=%GDAL_ROOT%\bin\plugins

SET PYTHONHOME=%TOPDIR%\bin\Python26
SET PYTHONPATH=%PYTHONHOME%\Lib\lib-tk
SET PYTHONPATH=%PYTHONHOME%\Lib\site-packages\pywin32_system32;%PYTHONHOME%\Lib\site-packages\win32;%PYTHONHOME%\Lib\site-packages\win32\lib;%PYTHONHOME%\Lib\site-packages\pythonwin;%PYTHONPATH%
SET PYTHONPATH=%GDAL_ROOT%\bin;%GDAL_ROOT%\lib;%PYTHONPATH%
SET PYTHONPATH=%CURDIR%\lib;%PYTHONPATH%

PATH=%GDAL_ROOT%\bin;%PATH%
PATH=%GDAL_ROOT%\bin\gdal\apps;%PATH%
PATH=%GDAL_DRIVER_PATH%;%PATH%
PATH=%PYTHONPATH%;%PATH%
PATH=%PYTHONHOME%;%PATH%
PATH=%CURDIR%;%PATH%

@ECHO OFF
PUSHD %~DP0
SET CURDIR=%CD%
PUSHD ..
SET TOPDIR=%CD%
POPD
POPD

SET GDAL_ROOT=%TOPDIR%\bin\gdal
rem SET GDAL_PAM_PROXY_DIR=%TEMP%
SET GDAL_DATA=%GDAL_ROOT%\share\gdal-data
SET GEOTIFF_CSV=%GDAL_DATA%
SET PROJ_LIB=%GDAL_ROOT%\share\proj
SET GDAL_DRIVER_PATH=%GDAL_ROOT%\bin\plugins

SET PYTHONHOME=%TOPDIR%\bin\Python26
SET PYTHONPATH=%PYTHONHOME%\Lib\lib-tk
SET PYTHONPATH=%PYTHONHOME%\Lib\site-packages\pywin32_system32;%PYTHONHOME%\Lib\site-packages\win32;%PYTHONHOME%\Lib\site-packages\win32\lib;%PYTHONHOME%\Lib\site-packages\pythonwin;%PYTHONPATH%
SET PYTHONPATH=%GDAL_ROOT%\bin;%GDAL_ROOT%\lib;%PYTHONPATH%
SET PYTHONPATH=%CURDIR%\lib;%PYTHONPATH%

PATH=%GDAL_ROOT%\bin;%PATH%
PATH=%GDAL_ROOT%\bin\gdal\apps;%PATH%
PATH=%GDAL_DRIVER_PATH%;%PATH%
PATH=%PYTHONPATH%;%PATH%
PATH=%PYTHONHOME%;%PATH%
PATH=%CURDIR%;%PATH%

Remove GDAL_PAM_PROXY_DIR=%TEMP%

Remove GDAL_PAM_PROXY_DIR=%TEMP%


@echo off

set fdir=%ProgramFiles(x86)%\MSBuild\14.0
set msbuild="%fdir%\bin\msbuild.exe"

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G"
%msbuild% NDock.sln /p:Configuration=Release /t:Clean;Rebuild /p:OutputPath=..\bin\Net40

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5" 2>nul
if errorlevel 0 (
    FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G"
	%msbuild% NDock-Net45.sln /p:Configuration=Release /t:Clean;Rebuild /p:OutputPath=..\bin\Net45
)

pause

test commit by ssh

test commit by ssh


@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"

set solution=..\OmniKassa.sln

nuget restore %solution%

msbuild %solution% /m:4 /t:Rebuild /p:Configuration=Release
if %errorlevel% neq 0 goto done

vstest.console /inIsolation ..\tests\OmniKassa.Tests\bin\Release\net45\OmniKassa.Tests.dll
if %errorlevel% neq 0 goto done

cd ..\tests\OmniKassa.Tests\

dotnet test -f netcoreapp1.1
if %errorlevel% neq 0 goto done

cd ..\..\Publish

set projectdir=..\src\OmniKassa

msbuild %projectdir%\OmniKassa.csproj /m:4 /t:Pack /p:Configuration=Release
if %errorlevel% neq 0 goto done

copy %projectdir%\bin\Release\*.nupkg .

:done

pause

@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"

set solution=..\OmniKassa.sln

nuget restore %solution%

msbuild %solution% /m:4 /t:Rebuild /p:Configuration=Release
if %errorlevel% neq 0 goto done

cd ..\tests\OmniKassa.Tests\

dotnet test --no-build -c Release
if %errorlevel% neq 0 goto done

cd ..\..\Publish

set projectdir=..\src\OmniKassa

msbuild %projectdir%\OmniKassa.csproj /m:4 /t:Pack /p:Configuration=Release
if %errorlevel% neq 0 goto done

copy %projectdir%\bin\Release\*.nupkg .

:done

pause

Use dotnet test for both tests.

Use dotnet test for both tests.


@echo off

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

rem ---------------------------------------------------------------------------
rem Main Script for WSO2 Carbon
rem
rem Environment Variable Prequisites
rem
rem   CARBON_HOME   Home of CARBON installation. If not set I will  try
rem                   to figure it out.
rem
rem   RUNTIME_HOME  Home of WSO2 Carbon Runtime.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------
:checkJava

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

:noJavaHome
echo "You must set the JAVA_HOME variable before running CARBON."
goto end

rem ----- Only set CARBON_HOME if not already set ----------------------------
:checkServer
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
SET curDrive=%cd:~0,1%
SET wsasDrive=%CARBON_HOME:~0,1%
if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:

rem ----- Only set RUNTIME_HOME if not already set ----------------------------
:setRuntimeHome
if "%RUNTIME_HOME%"=="" set RUNTIME_HOME=%~sdp0..

rem find RUNTIME_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if not exist "%RUNTIME_HOME%\bin\kernel-version.txt" goto noServerHome

goto updateClasspath

:noServerHome
echo RUNTIME_HOME is set incorrectly or RUNTIME could not be located. Please set RUNTIME_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath

setlocal EnableDelayedExpansion
cd %RUNTIME_HOME%
set CARBON_CLASSPATH=
FOR %%C in ("%RUNTIME_HOME%\bin\bootstrap\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\bootstrap\%%~nC%%~xC"

set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;

FOR %%D in ("%RUNTIME_HOME%\lib\commons-lang*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nD%%~xD"

rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:setupArgs
if ""%1""=="""" goto doneStart

if ""%1""==""-run""     goto commandLifecycle
if ""%1""==""--run""    goto commandLifecycle
if ""%1""==""run""      goto commandLifecycle

if ""%1""==""-restart""  goto commandLifecycle
if ""%1""==""--restart"" goto commandLifecycle
if ""%1""==""restart""   goto commandLifecycle

if ""%1""==""debug""    goto commandDebug
if ""%1""==""-debug""   goto commandDebug
if ""%1""==""--debug""  goto commandDebug

if ""%1""==""version""   goto commandVersion
if ""%1""==""-version""  goto commandVersion
if ""%1""==""--version"" goto commandVersion

shift
goto setupArgs

rem ----- commandVersion -------------------------------------------------------
:commandVersion
shift
type "%RUNTIME_HOME%\bin\kernel-version.txt"
goto end

rem ----- commandDebug ---------------------------------------------------------
:commandDebug
shift
set DEBUG_PORT=%1
if "%DEBUG_PORT%"=="" goto noDebugPort
if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option.
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
echo Please start the remote debugging client to continue...
goto findJdk

:noDebugPort
echo Please specify the debug port after the --debug option
goto end

rem ----- commandLifecycle -----------------------------------------------------
:commandLifecycle
goto findJdk

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

rem ---------- Handle the SSL Issue with proper JDK version --------------------
rem find the version of the jdk
:findJdk

set CMD=RUN %*

:checkJdk16
"%JAVA_HOME%\bin\java" -version 2>&1 | findstr /r "1.[8]" >NUL
IF ERRORLEVEL 1 goto unknownJdk
goto jdk16

:unknownJdk
echo Starting WSO2 Carbon (in unsupported JDK)
echo [ERROR] CARBON is supported only on JDK 1.8
goto jdk16

:jdk16
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer
cd %RUNTIME_HOME%

rem ---------- Add jars to classpath ----------------

set CARBON_CLASSPATH=.\bin\bootstrap;%CARBON_CLASSPATH%

set JAVA_ENDORSED=".\bin\bootstrap\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"

set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%RUNTIME_HOME%\logs\heap-dump.hprof"  -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH%
%JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED%  -Dcarbon.home="%CARBON_HOME%" -Dwso2.runtime.path="%RUNTIME_HOME%"  -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%RUNTIME_HOME%\tmp" -Dcarbon.classpath=%CARBON_CLASSPATH% -Dfile.encoding=UTF8

:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%
echo RUNTIME_HOME environment variable is set to %RUNTIME_HOME%
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.wso2.carbon.launcher.Main %CMD%
if "%ERRORLEVEL%"=="121" goto runJava
:end
goto endlocal

:endlocal

:END

Fix window startup issue

Fix window startup issue


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

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional go tool compile arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional go tool link arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.
::
:: CC: Command line to run to compile C code for GOHOSTARCH.
:: Default is "gcc".
::
:: CC_FOR_TARGET: Command line to run compile C code for GOARCH.
:: This is used by cgo. Default is CC.
::
:: FC: Command line to run to compile Fortran code.
:: This is used by cgo. Default is "gfortran".

@echo off

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

set GOBUILDFAIL=0
set GOFLAGS=

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

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Set GOROOT for build.
cd ..
set GOROOT=%CD%
cd src
set vflag=
if x%1==x-v set vflag=-v
if x%2==x-v set vflag=-v
if x%3==x-v set vflag=-v
if x%4==x-v set vflag=-v

if not exist ..\bin\tool mkdir ..\bin\tool
if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4
if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%
if x%vflag==x-v echo cmd/dist
setlocal
set GOROOT=%GOROOT_BOOTSTRAP%
set GOOS=
set GOARCH=
set GOBIN=
"%GOROOT_BOOTSTRAP%\bin\go" build -o cmd\dist\dist.exe .\cmd\dist
endlocal
if errorlevel 1 goto fail
.\cmd\dist\dist.exe env -w -p >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
if x%vflag==x-v echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist
if x%3==x--dist-tool goto copydist
if x%4==x--dist-tool goto copydist

set buildall=-a
if x%1==x--no-clean set buildall=
if x%2==x--no-clean set buildall=
if x%3==x--no-clean set buildall=
if x%4==x--no-clean set buildall=
if x%1==x--no-banner set buildall=%buildall% --no-banner
if x%2==x--no-banner set buildall=%buildall% --no-banner
if x%3==x--no-banner set buildall=%buildall% --no-banner
if x%4==x--no-banner set buildall=%buildall% --no-banner

:: Run dist bootstrap to complete make.bash.
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.
:: Throw ours, built with Go 1.4, away after bootstrap.
.\cmd\dist\dist.exe bootstrap %vflag% %buildall%
if errorlevel 1 goto fail
del .\cmd\dist\dist.exe
goto end

:: DO NOT ADD ANY NEW CODE HERE.
:: The bootstrap+del above are the final step of make.bat.
:: If something must be added, add it to cmd/dist's cmdbootstrap,
:: to avoid needing three copies in three different shell languages
:: (make.bash, make.bat, make.rc).

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:bootstrapfail
echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe
echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go 1.4.

:fail
set GOBUILDFAIL=1
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%

:end

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

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional go tool compile arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional go tool link arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.
::
:: CC: Command line to run to compile C code for GOHOSTARCH.
:: Default is "gcc".
::
:: CC_FOR_TARGET: Command line to run compile C code for GOARCH.
:: This is used by cgo. Default is CC.
::
:: FC: Command line to run to compile Fortran code.
:: This is used by cgo. Default is "gfortran".

@echo off

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

set GOBUILDFAIL=0
set GOFLAGS=

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

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Set GOROOT for build.
cd ..
set GOROOT=%CD%
cd src
set vflag=
if x%1==x-v set vflag=-v
if x%2==x-v set vflag=-v
if x%3==x-v set vflag=-v
if x%4==x-v set vflag=-v

if not exist ..\bin\tool mkdir ..\bin\tool
if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4
if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%
if x%vflag==x-v echo cmd/dist
setlocal
set GOROOT=%GOROOT_BOOTSTRAP%
set GOOS=
set GOARCH=
set GOBIN=
"%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist
endlocal
if errorlevel 1 goto fail
.\cmd\dist\dist.exe env -w -p >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
if x%vflag==x-v echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist
if x%3==x--dist-tool goto copydist
if x%4==x--dist-tool goto copydist

set buildall=-a
if x%1==x--no-clean set buildall=
if x%2==x--no-clean set buildall=
if x%3==x--no-clean set buildall=
if x%4==x--no-clean set buildall=
if x%1==x--no-banner set buildall=%buildall% --no-banner
if x%2==x--no-banner set buildall=%buildall% --no-banner
if x%3==x--no-banner set buildall=%buildall% --no-banner
if x%4==x--no-banner set buildall=%buildall% --no-banner

:: Run dist bootstrap to complete make.bash.
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.
:: Throw ours, built with Go 1.4, away after bootstrap.
.\cmd\dist\dist.exe bootstrap %vflag% %buildall%
if errorlevel 1 goto fail
del .\cmd\dist\dist.exe
goto end

:: DO NOT ADD ANY NEW CODE HERE.
:: The bootstrap+del above are the final step of make.bat.
:: If something must be added, add it to cmd/dist's cmdbootstrap,
:: to avoid needing three copies in three different shell languages
:: (make.bash, make.bat, make.rc).

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:bootstrapfail
echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe
echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go 1.4.

:fail
set GOBUILDFAIL=1
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%

:end

add missing go.exe extension

src/make.bat: add missing go.exe extension

Got error:
'go' is not an internal or external command, nor is it a runnable program

Change-Id: Ie45a3a12252fa01b67ca09ef8fbb5b4bbf728fe7
GitHub-Last-Rev: 451815cacd9bfc509fa0aab3be54303797e605a2
GitHub-Pull-Request: golang/go#27214
Reviewed-on: https://go-review.googlesource.com/131397
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>


@echo off
rmdir /S /Q VestaDizLite
mkdir VestaDizLite
cd VestaDizLite
copy "C:\Users\1\Dropbox\VestaLite (2)\VestaDizLite.zip" VestaDizLite.zip
"C:\Program Files\HaoZip\HaoZipC.exe" e VestaDizLite.zip
VestaDizLite.exe /silent

add example vesta installation .bat srcipt


git submodule update --init --recursive

cd Dependencies

rm -rf vcpkg

git clone https://github.com/ketoo/vcpkg_for_nf.git
rename vcpkg_for_nf vcpkg
cd vcpkg

7z.exe x installed\x64-windows-static\debug\lib\libprotobufd.zip -oinstalled\x64-windows-static\debug\lib\
7z.exe x installed\x64-windows-static\lib\libprotobuf.rar -oinstalled\x64-windows-static\lib\

cd ..

xcopy vcpkg\installed\x64-windows-static\lib lib\Release\ /s /e /Y
xcopy vcpkg\installed\x64-windows-static\bin ..\_Out\Release\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\debug\lib lib\Debug\  /s /e /Y
xcopy vcpkg\installed\x64-windows-static\debug\bin ..\_Out\Debug\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\tools\protobuf\protoc.exe ..\NFComm\NFMessageDefine\ /s /e /Y

cd..

git submodule update --init --recursive

cd Dependencies

rm -rf vcpkg
rm -rf vcpkg_for_nf

git clone https://github.com/ketoo/vcpkg_for_nf.git
rename vcpkg_for_nf vcpkg
cd vcpkg

7z.exe x installed\x64-windows-static\debug\lib\libprotobufd.zip -oinstalled\x64-windows-static\debug\lib\
7z.exe x installed\x64-windows-static\lib\libprotobuf.rar -oinstalled\x64-windows-static\lib\

cd ..

xcopy vcpkg\installed\x64-windows-static\lib lib\Release\ /s /e /Y
xcopy vcpkg\installed\x64-windows-static\bin ..\_Out\Release\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\debug\lib lib\Debug\  /s /e /Y
xcopy vcpkg\installed\x64-windows-static\debug\bin ..\_Out\Debug\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\tools\protobuf\protoc.exe ..\NFComm\NFMessageDefine\ /s /e /Y

cd..

Update build_dep.bat

Update build_dep.bat


@echo off

set filename=recycle-bin

gcc "%filename%".c -municode -O2 -s -o "%filename%".exe -std=c99

Add -std=c99 flag (#4)

Add -std=c99 flag (#4)


%WINDIR%/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe Build.msbuild /p:Configuration=Release /t:Versions /p:NoWarn=1591 /fileLogger

Add msbuild logger

Add msbuild logger


go build -o gonut.exe github.com/AlekSi/nut/nut
@if ERRORLEVEL 1 exit /B %ERRORLEVEL%

@pushd ..\test_nut1
..\nut\gonut.exe pack
@if ERRORLEVEL 1 exit /B %ERRORLEVEL%
@popd

go test -v github.com/AlekSi/nut -gocheck.v
@if ERRORLEVEL 1 exit /B %ERRORLEVEL%

go test -v github.com/AlekSi/nut/nut -gocheck.v
@if ERRORLEVEL 1 exit /B %ERRORLEVEL%

go test -v -short github.com/AlekSi/nut/integration_test -gocheck.v
@if ERRORLEVEL 1 exit /B %ERRORLEVEL%

Add Windows batch file.

Add Windows batch file.


@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\dotnetsdk upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\dotnetsdk install default -runtime CoreCLR -x86

:run
CALL packages\KoreBuild\build\dotnetsdk 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_DOTNET_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\dotnetsdk upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\dotnetsdk install default -runtime CoreCLR -x86

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

Rename SKIP_KRE_INSTALL to SKIP_DOTNET_INSTALL


cd src
msbuild MarkdownEdit.sln /p:configuration=release
cd ..

cd src
msbuild MarkdownEdit.sln /t:rebuild /p:configuration=release
cd ..

build does rebuild

build does rebuild


REM the following works for networked drives with spaces!!!
REM Net use p: "\\myNetwork\HPS Classes$\computer programming 2011\Assignments" /persistent:no
REM set NODE_PATH=p:\nodejs

REM dir/x gives the short file names.
REM you need to get these paths correct for nodejs, ARM, spark-cli, dfu files

set NODE_PATH=C:\progra~1\nodejs

set DFU_FILES_PATH=C:\Users\JEREL_~1\DOCUME~1\Jeremy\cp12\spark\dfu

set SPARK_CLI_PATH=C:\Users\JEREL_~1\AppData\Roaming\npm

set PATH=C:\Windows;C:\Windows\System32;%NODE_PATH%;%DFU_FILES_PATH%;%SPARK_CLI_PATH%;

REM note the next line overwrites the myoutput using > normally >> adds to the file

echo "*************************************"  > myoutput.txt 2>&1
echo "PATH"                                  >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
rem PATH                                         >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

echo "*************************************" >> myoutput.txt 2>&1
echo "node --version"                        >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
node --version                               >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

echo "*************************************" >> myoutput.txt 2>&1
echo "dfu-util -l"                           >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
dfu-util -l                                  >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

rem spark must be last or in its own batch file as it kill the program

echo "*************************************" >> myoutput.txt 2>&1
echo "spark --version"                       >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
spark --version                              >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

rem spark must be last or in its own batch file as it kill the program

echo "*************************************" >> myoutput.txt 2>&1
echo "npm --version"                       >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
npm --version                              >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

Create mypath03.bat

Create mypath03.bat


@echo off
if exist glfw-Win32 rmdir /s /q glfw-Win32
if exist glfw-Win32 rmdir /s /q glfw-x64
if exist glfw-Win32 rmdir /s /q mercury-Win32
if exist glfw-Win32 rmdir /s /q mercury-x64

@echo off
if exist glfw-Win32 rmdir /s /q glfw-Win32
if exist glfw-x64 rmdir /s /q glfw-x64
if exist mercury-Win32 rmdir /s /q mercury-Win32
if exist mercury-x64 rmdir /s /q mercury-x64

Fix clean command

Fix clean command


@echo off
setlocal ENABLEEXTENSIONS

rem WARNING: Delayed expansion is enabled prior to execute JVM.
rem Do not enable delayed expansion until the JVM execution.
rem '!' contained in JBOSS_HOME or JAVA_HOME paths would be removed from variables.

rem -------------------------------------------------------------------------
rem JBoss Admin CLI Script for Windows
rem -------------------------------------------------------------------------

rem $Id$

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal

if "%OS%" == "Windows_NT" (
  set "DIRNAME=%~dp0%"
) else (
  set DIRNAME=.\
)

pushd "%DIRNAME%.."
set "RESOLVED_JBOSS_HOME=%CD%"
popd

if "x%JBOSS_HOME%" == "x" (
  set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
)

pushd "%JBOSS_HOME%"
set "SANITIZED_JBOSS_HOME=%CD%"
popd

if /i "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
   echo.
   echo   WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
   echo.
   echo       JBOSS_HOME: "%JBOSS_HOME%"
   echo.
)

rem Setup JBoss specific properties
if "x%JAVA_HOME%" == "x" (
  set  JAVA=java
  echo JAVA_HOME is not set. Unexpected results may occur.
  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
  set "JAVA=%JAVA_HOME%\bin\java"
)

rem Find jboss-modules.jar, or we can't continue
set "JBOSS_RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
if not exist "%JBOSS_RUNJAR%" (
  echo Could not locate "%JBOSS_RUNJAR%".
  echo Please check that you are in the bin directory when running this script.
  set /A RC=1
  goto END
)

rem Set default module root paths
if "x%JBOSS_MODULEPATH%" == "x" (
  set "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
)

rem Add base package for L&F
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=com.sun.java.swing"

set LOGGING_CONFIG=
echo "%JAVA_OPTS%" | findstr /I "logging.configuration" > nul
if errorlevel == 1 (
  rem It must be quoted in case JBOSS_HOME contains whitespaces
  set LOGGING_CONFIG="-Dlogging.configuration=file:%JBOSS_HOME%\bin\jboss-cli-logging.properties"
) else (
  echo logging.configuration already set in JAVA_OPTS
)

rem the arguments can contain ')' character, this breaks parser. Delaying
rem argument evaluation at script execution fixes it.
setlocal ENABLEDELAYEDEXPANSION

rem script arguments will be evaluated at execution time.
set ARGS=%*

rem Force following commands to be loaded in memory.
rem This protects the running script from being rewritten.
(
    "!JAVA!" !JAVA_OPTS! !LOGGING_CONFIG! ^
        -jar "!JBOSS_RUNJAR!" ^
        -mp "!JBOSS_MODULEPATH!" ^
         org.jboss.as.cli ^
         !ARGS!

    set /A RC=%errorlevel%
    :END
    if "x%NOPAUSE%" == "x" pause

    if "x%RC%" == "x" (
      set /A RC=0
    )
    exit /B %RC%
)

@echo off
setlocal ENABLEEXTENSIONS

rem WARNING: Delayed expansion is enabled prior to execute JVM.
rem Do not enable delayed expansion until the JVM execution.
rem '!' contained in JBOSS_HOME or JAVA_HOME paths would be removed from variables.

rem -------------------------------------------------------------------------
rem JBoss Admin CLI Script for Windows
rem -------------------------------------------------------------------------

rem $Id$

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal

if "%OS%" == "Windows_NT" (
  set "DIRNAME=%~dp0%"
) else (
  set DIRNAME=.\
)

pushd "%DIRNAME%.."
set "RESOLVED_JBOSS_HOME=%CD%"
popd

if "x%JBOSS_HOME%" == "x" (
  set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
)

pushd "%JBOSS_HOME%"
set "SANITIZED_JBOSS_HOME=%CD%"
popd

if /i "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
   echo.
   echo   WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
   echo.
   echo       JBOSS_HOME: "%JBOSS_HOME%"
   echo.
)

rem Setup JBoss specific properties
if "x%JAVA_HOME%" == "x" (
  set  JAVA=java
  echo JAVA_HOME is not set. Unexpected results may occur.
  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
  set "JAVA=%JAVA_HOME%\bin\java"
)

rem Find jboss-modules.jar, or we can't continue
set "JBOSS_RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
if not exist "%JBOSS_RUNJAR%" (
  echo Could not locate "%JBOSS_RUNJAR%".
  echo Please check that you are in the bin directory when running this script.
  set /A RC=1
  goto END
)

rem Set default module root paths
if "x%JBOSS_MODULEPATH%" == "x" (
  set "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
)

rem Add base package for L&F
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=com.sun.java.swing"

set LOGGING_CONFIG=
echo "%JAVA_OPTS%" | findstr /I "logging.configuration" > nul
if errorlevel == 1 (
  rem It must be quoted in case JBOSS_HOME contains whitespaces
  set LOGGING_CONFIG="-Dlogging.configuration=file:%JBOSS_HOME%\bin\jboss-cli-logging.properties"
) else (
  echo logging.configuration already set in JAVA_OPTS
)

rem the arguments can contain ')' character, this breaks parser. Delaying
rem argument evaluation at script execution fixes it.
setlocal ENABLEDELAYEDEXPANSION

rem script arguments will be evaluated at execution time.
set ARGS=%*

rem Force following commands to be loaded in memory.
rem This protects the running script from being rewritten.
(
    "!JAVA!" !JAVA_OPTS! !LOGGING_CONFIG! ^
        -jar "!JBOSS_RUNJAR!" ^
        -mp "!JBOSS_MODULEPATH!" ^
         org.jboss.as.cli ^
         !ARGS!

    set /A RC=!errorlevel!
    :END
    if "x!NOPAUSE!" == "x" pause

    if "x!RC!" == "x" (
      set /A RC=0
    )
    exit /B !RC!
)

Fix for WFCORE-2667. Invalid CLI exit code on Windows


echo off

Rem: set path
SET PATH=
SET PATH=%PATH%;D:/Binutils/Ruby192/bin
SET PATH=%PATH%;C:/Binutils/Ruby192/bin
SET PATH=%PATH%;D:/Binutils/Ruby-186-27/bin
SET PATH=%PATH%;C:/Binutils/Ruby-186-27/bin
SET PATH=%PATH%;D:/Binutils/rubygems-1.3.5/bin
SET PATH=%PATH%;C:/Binutils/rubygems-1.3.5/bin
SET PATH=C:/Binutils/apache-ant-1.7.0/bin/;%PATH%
SET PATH=D:/Binutils/apache-ant-1.7.0/bin/;%PATH%

Rem: set java home
SET JAVA_HOME=C:/Progra~1/Java/jre6

echo on
Rem: set enviroment and execute ant script
ant

echo off

Rem: set path
SET PATH=
SET PATH=%PATH%;D:/Binutils/Ruby192/bin
SET PATH=%PATH%;C:/Binutils/Ruby192/bin
SET PATH=%PATH%;D:/Binutils/Ruby-186-27/bin
SET PATH=%PATH%;C:/Binutils/Ruby-186-27/bin
SET PATH=%PATH%;D:/Binutils/rubygems-1.3.5/bin
SET PATH=%PATH%;C:/Binutils/rubygems-1.3.5/bin
SET PATH=C:/Binutils/apache-ant-1.7.0/bin/;%PATH%
SET PATH=D:/Binutils/apache-ant-1.7.0/bin/;%PATH%
SET PATH=C:/Progra~1/Git/bin;%PATH%

Rem: set java home
SET JAVA_HOME=C:/Progra~1/Java/jre6

echo on
Rem: set enviroment and execute ant script
ant

Set env path to git

Set env path to git


@echo off
:: ############################
:: # Install the dotfiles on Windows systems.
:: ############################

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
  echo Not an admin, exiting.
  exit /B 1
)

setlocal EnableDelayedExpansion

set dotfilesDir=%~dp0
set backupDir=%USERPROFILE%\dotfiles_backup
set dotfiles=bashrc bash_profile bash dir_colors inputrc minttyrc gitconfig shell zshrc zsh zprofile

for %%A in (%dotfiles%) DO (
    call:createSymLink "%dotfilesDir%%%A" "%USERPROFILE%\.%%A" "%backupDir%"
)

set sublimeDir=%USERPROFILE%\AppData\Roaming\Sublime Text 2
set backupDir=%sublimeDir%\dotfiles_backup

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\Installed Packages" "%sublimeDir%\Installed Packages" "%backupDir%"
    call:createSymLink "%dotfilesDir%sublime\Packages" "%sublimeDir%\Packages" "%backupDir%"
    call:createSymLink "%dotfilesDir%sublime\Pristine Packages" "%sublimeDir%\Pristine Packages" "%backupDir%"
)

goto:EOF

::function
:createSymLink - target linkName backupDirectory
    if exist "%~2" (
        set Z=&& for %%A in ("%~2") do set Z=%%~aA
        if "!Z:~8,1!" == "l" (
            set linkExists="1"
        ) else (
            if not exist "%~3" (
                mkdir "%~3"
            )
            echo Moving existing %2 to %3
            move "%~2" "%~3"
        )
    )

    if !linkExists! == "0" (
        if exist "%~1\" (
            mklink /d "%~2" "%~1"
        ) else (
            mklink "%~2" "%~1"
        )
        attrib /L "%~2" +h
    ) else (
        Not replacing existing link %2
    )

goto:EOF

@echo off
:: ############################
:: # Install the dotfiles on Windows systems.
:: ############################

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
  echo Not an admin, exiting.
  exit /B 1
)

setlocal EnableDelayedExpansion

set dotfilesDir=%~dp0
set backupDir=%USERPROFILE%\dotfiles_backup
set dotfiles=bashrc bash_profile bash dir_colors inputrc minttyrc gitconfig shell zshrc zsh zprofile

for %%A in (%dotfiles%) DO (
    call:createSymLink "%dotfilesDir%%%A" "%USERPROFILE%\.%%A" "%backupDir%"
)

set sublimeDir=%USERPROFILE%\AppData\Roaming\Sublime Text 2
set backupDir=%sublimeDir%\dotfiles_backup

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\Installed Packages" "%sublimeDir%\Installed Packages" "%backupDir%"
    call:createSymLink "%dotfilesDir%sublime\Packages" "%sublimeDir%\Packages" "%backupDir%"
    call:createSymLink "%dotfilesDir%sublime\Pristine Packages" "%sublimeDir%\Pristine Packages" "%backupDir%"
)

goto:EOF

::function
:createSymLink - target linkName backupDirectory
    if exist "%~2" (
        set Z=&& for %%A in ("%~2") do set Z=%%~aA
        if "!Z:~8,1!" == "l" (
            set linkExists="1"
        ) else (
            if not exist "%~3" (
                mkdir "%~3"
            )
            echo Moving existing %2 to %3
            move "%~2" "%~3"
        )
    )

    if !linkExists! == "0" (
        if exist "%~1\" (
            mklink /d "%~2" "%~1"
        ) else (
            mklink "%~2" "%~1"
        )
        attrib /L "%~2" +h
    ) else (
        echo Not replacing existing link %2
    )

goto:EOF

Add echo back to echo line

Add echo back to echo line


@echo off
setlocal

set SCRIPTDIR=%~dp0
set PROJDIR=%SCRIPTDIR%..\..\
set LIBSDIR=%PROJDIR%libs\
set ORIGPATH=%PATH%

cd %PROJDIR%

@echo on

rmdir /S/Q %LIBSDIR%windows
mkdir %LIBSDIR%
mkdir %LIBSDIR%windows

set BUILDDIR=%PROJDIR%build_win32\
set OUTPUTDIR=%LIBSDIR%windows\win32\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake -G"Visual Studio 15 2017" -DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release .. || exit /b 1
cmake --build . --target ALL_BUILD -- /p:Configuration=Release || exit /b 1
set PREVPATH=%PATH%
set PATH=%PROJDIR%build_win32/Release;%PATH%
ctest -C Release . || exit /b 1
set PATH=%PREVPATH%
mkdir %OUTPUTDIR%
copy %BUILDDIR%Release\speck.dll %OUTPUTDIR%
cd ..

set BUILDDIR=%PROJDIR%build_win64\
set OUTPUTDIR=%LIBSDIR%windows\win64\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake -G"Visual Studio 15 2017 Win64" -DENABLE_TESTING=ON -DENABLE_AVX2=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release .. || exit /b 1
cmake --build . --target ALL_BUILD -- /p:Configuration=Release || exit /b 1
set PREVPATH=%PATH%
set PATH=%PROJDIR%build_win64\Release;%PATH%
ctest -C Release . || exit /b 1
set PATH=%PREVPATH%
mkdir %OUTPUTDIR%
copy %BUILDDIR%Release\speck.dll %OUTPUTDIR%
cd ..

@echo off
setlocal

set SCRIPTDIR=%~dp0
set PROJDIR=%SCRIPTDIR%..\..\
set LIBSDIR=%PROJDIR%libs\
set ORIGPATH=%PATH%

cd %PROJDIR%

@echo on

rmdir /S/Q %LIBSDIR%windows
mkdir %LIBSDIR%
mkdir %LIBSDIR%windows

set BUILDDIR=%PROJDIR%build_win32\
set OUTPUTDIR=%LIBSDIR%windows\win32\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake -A Win32 -DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release .. || exit /b 1
cmake --build . --target ALL_BUILD -- /p:Configuration=Release || exit /b 1
set PREVPATH=%PATH%
set PATH=%PROJDIR%build_win32/Release;%PATH%
ctest -C Release . || exit /b 1
set PATH=%PREVPATH%
mkdir %OUTPUTDIR%
copy %BUILDDIR%Release\speck.dll %OUTPUTDIR%
cd ..

set BUILDDIR=%PROJDIR%build_win64\
set OUTPUTDIR=%LIBSDIR%windows\win64\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake -DENABLE_TESTING=ON -DENABLE_AVX2=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release .. || exit /b 1
cmake --build . --target ALL_BUILD -- /p:Configuration=Release || exit /b 1
set PREVPATH=%PATH%
set PATH=%PROJDIR%build_win64\Release;%PATH%
ctest -C Release . || exit /b 1
set PATH=%PREVPATH%
mkdir %OUTPUTDIR%
copy %BUILDDIR%Release\speck.dll %OUTPUTDIR%
cd ..

support vs2019

support vs2019


Create adbtool.bat

Create adbtool.bat


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

@echo off

set DEVICE_NAME=outline-tap0
set DEVICE_HWID=tap0901

:: Check whether the device already exists.
netsh interface show interface name=%DEVICE_NAME% >nul
if %errorlevel% equ 0 (
  echo %DEVICE_NAME% already exists.
  exit /b
)

:: Add the device, recording the names of devices before and after to help
:: us find the name of the new device.
::
:: Note:
::  - While we could limit the search to devices having ServiceName=%DEVICE_HWID%,
::    that will cause wmic to output just "no instances available" when there
::    are no other TAP devices present, messing up the diff.
::  - We do not use findstr, etc., to strip blank lines because those ancient tools
::    typically don't understand/output non-Latin characters (wmic *does*, even on
::    Windows 7).
set BEFORE_DEVICES=%tmp%\outlineinstaller-tap-devices-before.txt
set AFTER_DEVICES=%tmp%\outlineinstaller-tap-devices-after.txt

echo Storing current network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%BEFORE_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%BEFORE_DEVICES%"

echo Creating TAP network device...
tap-windows6\tapinstall install tap-windows6\OemVista.inf %DEVICE_HWID%
if %errorlevel% neq 0 (
  echo Could not create TAP network device. >&2
  exit /b 1
)
echo Storing new network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%AFTER_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%AFTER_DEVICES%"

:: Find the name of the new device and rename it.
::
:: Obviously, this command is a beast; roughly what it does, in this order, is:
::  - perform a diff on the *trimmed* (in case wmic uses different column widths) before and after
::    text files
::  - remove leading/trailing space and blank lines with trim()
::  - store the result in NEW_DEVICE
::  - print NEW_DEVICE, for debugging (though non-Latin characters may appear as ?)
::  - invoke netsh
::
:: Running all this in one go helps reduce the need to deal with temporary
:: files and the character encoding headaches that follow.
::
:: Note that we pipe input from /dev/null to prevent Powershell hanging forever
:: waiting on EOF.
echo Searching for new TAP network device name...
powershell "(compare-object (cat \"%BEFORE_DEVICES%\" | foreach-object {$_.trim()}) (cat \"%AFTER_DEVICES%\" | foreach-object {$_.trim()}) | format-wide -autosize | out-string).trim() | set-variable NEW_DEVICE; write-host \"New TAP device name: ${NEW_DEVICE}\"; netsh interface set interface name = \"${NEW_DEVICE}\" newname = \"%DEVICE_NAME%\"" <nul
if %errorlevel% neq 0 (
  echo Could not find or rename new TAP network device. >&2
  exit /b 1
)

:: We've occasionally seen delays before netsh will "see" the new device, at least for
:: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not
:: seem to be affected).
echo Testing that the new TAP network device is visible to netsh...
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% equ 0 goto :configure

:loop
echo waiting...
timeout /t 10 >nul
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% neq 0 goto :loop

:configure
echo Configuring new TAP network device...

:: Give the device an IP address.
:: 10.0.85.x is a guess which we hope will work for most users (Docker for
:: Windows uses 10.0.75.x by default): if the address is already in use the
:: script will fail and the installer will show an error message to the user.
:: TODO: Actually search the system for an unused subnet or make the subnet
::       configurable in the Outline client.
netsh interface ip set address %DEVICE_NAME% static 10.0.85.2 255.255.255.0
if %errorlevel% neq 0 (
  echo Could not set TAP network device subnet. >&2
  exit /b 1
)

:: Windows has no system-wide DNS server; each network device can have its
:: "own" set of DNS servers. Windows seems to use the DNS server(s) of the
:: network device associated with the default gateway. This is good for us
:: as it means we do not have to modify the DNS settings of any other network
:: device in the system. Configure with OpenDNS and Dyn resolvers.
echo Configuring primary DNS...
netsh interface ip set dnsservers %DEVICE_NAME% static address=208.67.222.222
if %errorlevel% neq 0 (
  echo Could not configure TAP device primary DNS. >&2
  exit /b 1
)
echo Configuring secondary DNS...
netsh interface ip add dnsservers %DEVICE_NAME% 216.146.35.35 index=2
if %errorlevel% neq 0 (
  echo Could not configure TAP device secondary DNS. >&2
  exit /b 1
)
echo TAP network device added and configured successfully

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

@echo off

set DEVICE_NAME=outline-tap0
set DEVICE_HWID=tap0901

:: Check whether the device already exists.
netsh interface show interface name=%DEVICE_NAME% >nul
if %errorlevel% equ 0 (
  echo %DEVICE_NAME% already exists.
  exit /b
)

:: Add the device, recording the names of devices before and after to help
:: us find the name of the new device.
::
:: Note:
::  - While we could limit the search to devices having ServiceName=%DEVICE_HWID%,
::    that will cause wmic to output just "no instances available" when there
::    are no other TAP devices present, messing up the diff.
::  - We do not use findstr, etc., to strip blank lines because those ancient tools
::    typically don't understand/output non-Latin characters (wmic *does*, even on
::    Windows 7).
set BEFORE_DEVICES=%tmp%\outlineinstaller-tap-devices-before.txt
set AFTER_DEVICES=%tmp%\outlineinstaller-tap-devices-after.txt

echo Storing current network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%BEFORE_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%BEFORE_DEVICES%"

echo Creating TAP network device...
tap-windows6\tapinstall install tap-windows6\OemVista.inf %DEVICE_HWID%
if %errorlevel% neq 0 (
  echo Could not create TAP network device. >&2
  exit /b 1
)
echo Storing new network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%AFTER_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%AFTER_DEVICES%"

:: Find the name of the new device and rename it.
::
:: Obviously, this command is a beast; roughly what it does, in this order, is:
::  - perform a diff on the *trimmed* (in case wmic uses different column widths) before and after
::    text files
::  - remove leading/trailing space and blank lines with trim()
::  - store the result in NEW_DEVICE
::  - print NEW_DEVICE, for debugging (though non-Latin characters may appear as ?)
::  - invoke netsh
::
:: Running all this in one go helps reduce the need to deal with temporary
:: files and the character encoding headaches that follow.
::
:: Note that we pipe input from /dev/null to prevent Powershell hanging forever
:: waiting on EOF.
echo Searching for new TAP network device name...
powershell "(compare-object (cat \"%BEFORE_DEVICES%\" | foreach-object {$_.trim()}) (cat \"%AFTER_DEVICES%\" | foreach-object {$_.trim()}) | format-wide -autosize | out-string).trim() | set-variable NEW_DEVICE; write-host \"New TAP device name: ${NEW_DEVICE}\"; netsh interface set interface name = \"${NEW_DEVICE}\" newname = \"%DEVICE_NAME%\"" <nul
if %errorlevel% neq 0 (
  echo Could not find or rename new TAP network device. >&2
  exit /b 1
)

:: We've occasionally seen delays before netsh will "see" the new device, at least for
:: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not
:: seem to be affected).
echo Testing that the new TAP network device is visible to netsh...
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% equ 0 goto :configure

:loop
echo waiting...
:: timeout doesn't like the environment created by nsExec::ExecToStack and exits with:
:: "ERROR: Input redirection is not supported, exiting the process immediately."
waitfor /t 10 thisisnotarealsignalname >nul 2>&1
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% neq 0 goto :loop

:configure
echo Configuring new TAP network device...

:: Give the device an IP address.
:: 10.0.85.x is a guess which we hope will work for most users (Docker for
:: Windows uses 10.0.75.x by default): if the address is already in use the
:: script will fail and the installer will show an error message to the user.
:: TODO: Actually search the system for an unused subnet or make the subnet
::       configurable in the Outline client.
netsh interface ip set address %DEVICE_NAME% static 10.0.85.2 255.255.255.0
if %errorlevel% neq 0 (
  echo Could not set TAP network device subnet. >&2
  exit /b 1
)

:: Windows has no system-wide DNS server; each network device can have its
:: "own" set of DNS servers. Windows seems to use the DNS server(s) of the
:: network device associated with the default gateway. This is good for us
:: as it means we do not have to modify the DNS settings of any other network
:: device in the system. Configure with OpenDNS and Dyn resolvers.
echo Configuring primary DNS...
netsh interface ip set dnsservers %DEVICE_NAME% static address=208.67.222.222
if %errorlevel% neq 0 (
  echo Could not configure TAP device primary DNS. >&2
  exit /b 1
)
echo Configuring secondary DNS...
netsh interface ip add dnsservers %DEVICE_NAME% 216.146.35.35 index=2
if %errorlevel% neq 0 (
  echo Could not configure TAP device secondary DNS. >&2
  exit /b 1
)
echo TAP network device added and configured successfully

use waitfor rather than timeout

use waitfor rather than timeout


@echo off
setlocal EnableDelayedExpansion

rem Initialize environment variable defaults
call :SET_DEFAULTS

rem Build the environment and bail out if it fails
call :BUILD_ENVIRONMENT
if x%environment_built% == x goto :eof

%PROJECT_DRIVE%
mkdir %BUILD_DIR%
cd %BUILD_DIR%

echo Build Dependencies - Preparing to build

rem Uncomment once parameters are read, only delete in clean mode
rem cmd /c rd %VENDOR_DIR% /s /q

call :BUILD_BOOST
call :BUILD_TURTLE
call :BUILD_GLM
call :BUILD_ZLIB
call :BUILD_MYSQL_CONNECTOR_C
call :BUILD_MYSQL_CONNECTOR_CPP

rem ----------------------------------------------------------------------------
rem --- Start of SET_DEFAULTS --------------------------------------------------
:SET_DEFAULTS

set "PROJECT_BASE=%~dp0"
set "PROJECT_DRIVE=%~d0"
set "BUILD_DIR=%PROJECT_BASE%build-deps\"
set "VENDOR_DIR=%PROJECT_BASE%vendor\"
set MSVC_VERSION=11
set BOOST_VERSION=1.52.0
set TURTLE_VERSION=1.2.0
set GLM_VERSION=0.9.4.1
set ZLIB_VERSION=1.2.7
set MYSQL_C_VERSION=6.0.2
set "WGET=%PROJECT_BASE%tools\windows\wget.exe"
set "ZIP=%PROJECT_BASE%tools\windows\7z.exe"

goto :eof
rem --- End of SET_DEFAULTS ----------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_ENVIRONMENT ---------------------------------------------
:BUILD_ENVIRONMENT

if not exist "%VS110COMNTOOLS%" (
    echo ***** Microsoft Visual Studio 11 required *****
    exit /b 1
)

call "%VS110COMNTOOLS%\vsvars32.bat" >NUL

set environment_built=yes

goto :eof
rem --- End of BUILD_ENVIRONMENT -----------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_BOOST ---------------------------------------------------
rem --- Builds the boost library for use with this project. ---
:BUILD_BOOST

echo BUILDING: Boost %BOOST_VERSION% - http://www.boost.org/

set BOOST_VERSION_ALT=!BOOST_VERSION:.=_!
set BOOST_FILE=boost_%BOOST_VERSION_ALT%.zip
set BOOST_URL=http://downloads.sourceforge.net/project/boost/boost/%BOOST_VERSION%/%BOOST_FILE%
set BOOST_DIR=boost_%BOOST_VERSION_ALT%

if not exist %BOOST_FILE% (
    %WGET% --no-check-certificate !BOOST_URL!
)

if not exist %BOOST_DIR% (
    %ZIP% x -y %BOOST_FILE%
)

if not exist boost-log (
    svn co https://boost-log.svn.sourceforge.net/svnroot/boost-log/trunk/boost-log/ -r 799
)

if not exist "%BOOST_DIR%\boost\log" (
    xcopy "boost-log/boost/log" "%BOOST_DIR%/boost/log" /s /i /y
    xcopy "boost-log/libs/log" "%BOOST_DIR%/libs/log" /s /i /y
)

cd "%BOOST_DIR%"

if not exist b2.exe (
    cmd /c bootstrap.bat
)

cmd /c "b2.exe" --toolset=msvc-%MSVC_VERSION%.0 --with-program_options --with-system --with-thread --with-filesystem --with-log --with-python --with-test --with-date_time variant=debug,release link=shared runtime-link=shared threading=multi define=_SCL_SECURE_NO_WARNINGS=0 define=_ITERATOR_DEBUG_LEVEL=0

if not exist %VENDOR_DIR%include\boost (
    xcopy "boost" "%VENDOR_DIR%include\boost" /s /i /y
    xcopy "stage/lib" "%VENDOR_DIR%lib" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_BOOST -----------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_TURTLE --------------------------------------------------
rem --- Builds the turtle library for use with this project. ---
:BUILD_TURTLE

echo BUILDING: Turtle %TURTLE_VERSION% - http://turtle.sourceforge.net/

set TURTLE_FILE=turtle-%TURTLE_VERSION%.zip
set TURTLE_URL=http://downloads.sourceforge.net/project/turtle/turtle/%TURTLE_VERSION%/%TURTLE_FILE%
set TURTLE_DIR=turtle-%TURTLE_VERSION%

if not exist %TURTLE_FILE% (
    %WGET% --no-check-certificate !TURTLE_URL!
)

if not exist "%VENDOR_DIR%include\turtle" (
    %ZIP% x -y %TURTLE_FILE% -O%VENDOR_DIR%
    del %VENDOR_DIR%README.txt
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_TURTLE ----------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_GLM -----------------------------------------------------
rem --- Builds the glm library for use with this project. ---
:BUILD_GLM

echo BUILDING: GLM %GLM_VERSION% - http://glm.g-truc.net/

set GLM_FILE=glm-%GLM_VERSION%.zip
set GLM_URL=http://downloads.sourceforge.net/project/ogl-math/glm-%GLM_VERSION%/%GLM_FILE%
set GLM_DIR=glm-%GLM_VERSION%

if not exist %GLM_FILE% (
    %WGET% --no-check-certificate !GLM_URL!
)

if not exist "%VENDOR_DIR%include\glm" (
    %ZIP% x -y %GLM_FILE% -Oglm
    xcopy "glm\glm" "%VENDOR_DIR%include\glm" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_GLM -------------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_ZLIB ----------------------------------------------------
rem --- Builds the zlib library for use with this project.                   ---
:BUILD_ZLIB

echo BUILDING: zlib %ZLIB_VERSION% - http://www.zlib.net/

set ZLIB_VERSION_ALT=!ZLIB_VERSION:.=!
set ZLIB_FILE=zlib%ZLIB_VERSION_ALT%.zip
set ZLIB_URL=http://zlib.net/%ZLIB_FILE%
set ZLIB_DIR=zlib-%ZLIB_VERSION%

if not exist %ZLIB_FILE% (
    %WGET% --no-check-certificate !ZLIB_URL!
)

if not exist "%ZLIB_DIR%" (
    %ZIP% x -y %ZLIB_FILE%
)

cd "%ZLIB_DIR%"

cmake -G"Visual Studio 11" .
cmake --build . --target zlib --config Debug
cmake --build . --target zlib --config Release

if not exist "%VENDOR_DIR%include\zlib.h" (
    xcopy "zlib.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "zconf.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "Debug" "%VENDOR_DIR%lib\Debug" /s /i /y
    xcopy "Release" "%VENDOR_DIR%lib\Release" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_ZLIB ------------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_MYSQL_CONNECTOR_C ---------------------------------------
rem --- Builds the mysql connector c library for use with this project. --------
:BUILD_MYSQL_CONNECTOR_C

echo BUILDING: Mysql Connector-C %MYSQL_C_VERSION% - http://mysql.com/

set MYSQL_C_FILE=mysql-connector-c-%MYSQL_C_VERSION%.zip
set MYSQL_C_URL=http://dev.mysql.com/get/Downloads/Connector-C/%MYSQL_C_FILE%/from/http://cdn.mysql.com/
set MYSQL_C_DIR=mysql-connector-c-%MYSQL_C_VERSION%
set MYSQL_C_CMAKE=%MYSQL_C_DIR%\CMakeLists.txt
if not exist %MYSQL_C_FILE% (
    %WGET% --no-check-certificate !MYSQL_C_URL!
)

if not exist "%MYSQL_C_DIR%" (
    %ZIP% x -y %MYSQL_C_FILE%

    set search=STRING(REPLACE "/MD"
    set replacement=# STRING(REPLACE "/MD"

    for /f "tokens=* delims=," %%A in ('"type %MYSQL_C_DIR%\CMakeLists.txt"') do (
        set "str=%%A"
        set str=!str:STRING(REPLACE "/MD=# STRING(REPLACE "/MD!
        echo.!str! >> %MYSQL_C_CMAKE%.tmp
    )

    if exist %MYSQL_C_CMAKE%.tmp (
        del %MYSQL_C_CMAKE%
        move %MYSQL_C_CMAKE%.tmp %MYSQL_C_CMAKE%
    )
)

cd "%MYSQL_C_DIR%"

cmake .
cmake --build . --target mysqlclient --config Debug
cmake --build . --target libmysql --config Debug
cmake --build . --target mysqlclient --config Release
cmake --build . --target libmysql --config Release

if not exist "%VENDOR_DIR%include\mysql.h" (
    xcopy "include" "%VENDOR_DIR%include" /s /i /y
    xcopy "libmysql/Debug" "%VENDOR_DIR%lib/Debug" /s /i /y
    xcopy "libmysql/Release" "%VENDOR_DIR%lib/Release" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_MYSQL_CONNECTOR_C -----------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_MYSQL_CONNECTOR_CPP -------------------------------------
rem --- Builds the mysql connector c++ library for use with this project. ------
:BUILD_MYSQL_CONNECTOR_CPP

echo BUILDING: Mysql Connector-C++ - http://mysql.com/

if not exist mysql-connector-cpp (
    git clone https://github.com/anhstudios/mysql-connector-cpp.git
)

cd mysql-connector-cpp

cmake -G"Visual Studio 11" -DDISABLE_ITERATOR_DEBUGGING=ON -DBOOST_ROOT=%VENDOR_DIR% -DMYSQL_INCLUDE_DIR=%VENDOR_DIR%include -DMYSQL_LIB_DIR=%VENDOR_DIR%lib/Release .
cmake --build . --target mysqlcppconn --config Debug
cmake --build . --target mysqlcppconn --config Release

if not exist "%VENDOR_DIR%include\cppconn" (
    xcopy "cppconn" "%VENDOR_DIR%include\cppconn" /s /i /y
    xcopy "driver\mysql_driver.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "driver\mysql_connection.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "driver\Debug" "%VENDOR_DIR%lib\Debug" /s /i /y
    xcopy "driver\Release" "%VENDOR_DIR%lib\Release" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_MYSQL_CONNECTOR_CPP ---------------------------------------
rem ----------------------------------------------------------------------------

@echo off
setlocal EnableDelayedExpansion

rem Initialize environment variable defaults
call :SET_DEFAULTS

rem Build the environment and bail out if it fails
call :BUILD_ENVIRONMENT
if x%environment_built% == x goto :eof

%PROJECT_DRIVE%
mkdir %BUILD_DIR%
cd %BUILD_DIR%

echo Build Dependencies - Preparing to build

rem Uncomment once parameters are read, only delete in clean mode
rem cmd /c rd %VENDOR_DIR% /s /q

call :BUILD_BOOST
call :BUILD_TURTLE
call :BUILD_GLM
call :BUILD_ZLIB
call :BUILD_MYSQL_CONNECTOR_C
call :BUILD_MYSQL_CONNECTOR_CPP

rem ----------------------------------------------------------------------------
rem --- Start of SET_DEFAULTS --------------------------------------------------
:SET_DEFAULTS

set "PROJECT_BASE=%~dp0"
set "PROJECT_DRIVE=%~d0"
set "BUILD_DIR=%PROJECT_BASE%build-deps\"
set "VENDOR_DIR=%PROJECT_BASE%vendor\"
set MSVC_VERSION=11
set BOOST_VERSION=1.52.0
set TURTLE_VERSION=1.2.0
set GLM_VERSION=0.9.4.1
set ZLIB_VERSION=1.2.7
set MYSQL_C_VERSION=6.0.2
set "WGET=%PROJECT_BASE%tools\windows\wget.exe"
set "ZIP=%PROJECT_BASE%tools\windows\7z.exe"

goto :eof
rem --- End of SET_DEFAULTS ----------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_ENVIRONMENT ---------------------------------------------
:BUILD_ENVIRONMENT

call where svn /Q | findstr /c:"svn.exe" >nul && (
    echo ***** SVN required and not found in system PATH *****
    exit /b 1
)

call where git /Q | findstr /c:"git.exe" >nul && (
    echo ***** Git required and not found in system PATH *****
    exit /b 1
)

if not exist "%VS110COMNTOOLS%" (
    echo ***** Microsoft Visual Studio 11 required *****
    exit /b 1
)

call "%VS110COMNTOOLS%\vsvars32.bat" >NUL

set environment_built=yes

goto :eof
rem --- End of BUILD_ENVIRONMENT -----------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_BOOST ---------------------------------------------------
rem --- Builds the boost library for use with this project. ---
:BUILD_BOOST

echo BUILDING: Boost %BOOST_VERSION% - http://www.boost.org/

set BOOST_VERSION_ALT=!BOOST_VERSION:.=_!
set BOOST_FILE=boost_%BOOST_VERSION_ALT%.zip
set BOOST_URL=http://downloads.sourceforge.net/project/boost/boost/%BOOST_VERSION%/%BOOST_FILE%
set BOOST_DIR=boost_%BOOST_VERSION_ALT%

if not exist %BOOST_FILE% (
    %WGET% --no-check-certificate !BOOST_URL!
)

if not exist %BOOST_DIR% (
    %ZIP% x -y %BOOST_FILE%
)

if not exist boost-log (
    svn co https://boost-log.svn.sourceforge.net/svnroot/boost-log/trunk/boost-log/ -r 799
)

if not exist "%BOOST_DIR%\boost\log" (
    xcopy "boost-log/boost/log" "%BOOST_DIR%/boost/log" /s /i /y
    xcopy "boost-log/libs/log" "%BOOST_DIR%/libs/log" /s /i /y
)

cd "%BOOST_DIR%"

if not exist b2.exe (
    cmd /c bootstrap.bat
)

cmd /c "b2.exe" --toolset=msvc-%MSVC_VERSION%.0 --with-program_options --with-system --with-thread --with-filesystem --with-log --with-python --with-test --with-date_time variant=debug,release link=shared runtime-link=shared threading=multi define=_SCL_SECURE_NO_WARNINGS=0 define=_ITERATOR_DEBUG_LEVEL=0

if not exist %VENDOR_DIR%include\boost (
    xcopy "boost" "%VENDOR_DIR%include\boost" /s /i /y
    xcopy "stage/lib" "%VENDOR_DIR%lib" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_BOOST -----------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_TURTLE --------------------------------------------------
rem --- Builds the turtle library for use with this project. ---
:BUILD_TURTLE

echo BUILDING: Turtle %TURTLE_VERSION% - http://turtle.sourceforge.net/

set TURTLE_FILE=turtle-%TURTLE_VERSION%.zip
set TURTLE_URL=http://downloads.sourceforge.net/project/turtle/turtle/%TURTLE_VERSION%/%TURTLE_FILE%
set TURTLE_DIR=turtle-%TURTLE_VERSION%

if not exist %TURTLE_FILE% (
    %WGET% --no-check-certificate !TURTLE_URL!
)

if not exist "%VENDOR_DIR%include\turtle" (
    %ZIP% x -y %TURTLE_FILE% -O%VENDOR_DIR%
    del %VENDOR_DIR%README.txt
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_TURTLE ----------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_GLM -----------------------------------------------------
rem --- Builds the glm library for use with this project. ---
:BUILD_GLM

echo BUILDING: GLM %GLM_VERSION% - http://glm.g-truc.net/

set GLM_FILE=glm-%GLM_VERSION%.zip
set GLM_URL=http://downloads.sourceforge.net/project/ogl-math/glm-%GLM_VERSION%/%GLM_FILE%
set GLM_DIR=glm-%GLM_VERSION%

if not exist %GLM_FILE% (
    %WGET% --no-check-certificate !GLM_URL!
)

if not exist "%VENDOR_DIR%include\glm" (
    %ZIP% x -y %GLM_FILE% -Oglm
    xcopy "glm\glm" "%VENDOR_DIR%include\glm" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_GLM -------------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_ZLIB ----------------------------------------------------
rem --- Builds the zlib library for use with this project.                   ---
:BUILD_ZLIB

echo BUILDING: zlib %ZLIB_VERSION% - http://www.zlib.net/

set ZLIB_VERSION_ALT=!ZLIB_VERSION:.=!
set ZLIB_FILE=zlib%ZLIB_VERSION_ALT%.zip
set ZLIB_URL=http://zlib.net/%ZLIB_FILE%
set ZLIB_DIR=zlib-%ZLIB_VERSION%

if not exist %ZLIB_FILE% (
    %WGET% --no-check-certificate !ZLIB_URL!
)

if not exist "%ZLIB_DIR%" (
    %ZIP% x -y %ZLIB_FILE%
)

cd "%ZLIB_DIR%"

cmake -G"Visual Studio 11" .
cmake --build . --target zlib --config Debug
cmake --build . --target zlib --config Release

if not exist "%VENDOR_DIR%include\zlib.h" (
    xcopy "zlib.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "zconf.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "Debug" "%VENDOR_DIR%lib\Debug" /s /i /y
    xcopy "Release" "%VENDOR_DIR%lib\Release" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_ZLIB ------------------------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_MYSQL_CONNECTOR_C ---------------------------------------
rem --- Builds the mysql connector c library for use with this project. --------
:BUILD_MYSQL_CONNECTOR_C

echo BUILDING: Mysql Connector-C %MYSQL_C_VERSION% - http://mysql.com/

set MYSQL_C_FILE=mysql-connector-c-%MYSQL_C_VERSION%.zip
set MYSQL_C_URL=http://dev.mysql.com/get/Downloads/Connector-C/%MYSQL_C_FILE%/from/http://cdn.mysql.com/
set MYSQL_C_DIR=mysql-connector-c-%MYSQL_C_VERSION%
set MYSQL_C_CMAKE=%MYSQL_C_DIR%\CMakeLists.txt
if not exist %MYSQL_C_FILE% (
    %WGET% --no-check-certificate !MYSQL_C_URL!
)

if not exist "%MYSQL_C_DIR%" (
    %ZIP% x -y %MYSQL_C_FILE%

    set search=STRING(REPLACE "/MD"
    set replacement=# STRING(REPLACE "/MD"

    for /f "tokens=* delims=," %%A in ('"type %MYSQL_C_DIR%\CMakeLists.txt"') do (
        set "str=%%A"
        set str=!str:STRING(REPLACE "/MD=# STRING(REPLACE "/MD!
        echo.!str! >> %MYSQL_C_CMAKE%.tmp
    )

    if exist %MYSQL_C_CMAKE%.tmp (
        del %MYSQL_C_CMAKE%
        move %MYSQL_C_CMAKE%.tmp %MYSQL_C_CMAKE%
    )
)

cd "%MYSQL_C_DIR%"

cmake .
cmake --build . --target mysqlclient --config Debug
cmake --build . --target libmysql --config Debug
cmake --build . --target mysqlclient --config Release
cmake --build . --target libmysql --config Release

if not exist "%VENDOR_DIR%include\mysql.h" (
    xcopy "include" "%VENDOR_DIR%include" /s /i /y
    xcopy "libmysql/Debug" "%VENDOR_DIR%lib/Debug" /s /i /y
    xcopy "libmysql/Release" "%VENDOR_DIR%lib/Release" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_MYSQL_CONNECTOR_C -----------------------------------------
rem ----------------------------------------------------------------------------

rem ----------------------------------------------------------------------------
rem --- Start of BUILD_MYSQL_CONNECTOR_CPP -------------------------------------
rem --- Builds the mysql connector c++ library for use with this project. ------
:BUILD_MYSQL_CONNECTOR_CPP

echo BUILDING: Mysql Connector-C++ - http://mysql.com/

if not exist mysql-connector-cpp (
    git clone https://github.com/anhstudios/mysql-connector-cpp.git
)

cd mysql-connector-cpp

cmake -G"Visual Studio 11" -DDISABLE_ITERATOR_DEBUGGING=ON -DBOOST_ROOT=%VENDOR_DIR% -DMYSQL_INCLUDE_DIR=%VENDOR_DIR%include -DMYSQL_LIB_DIR=%VENDOR_DIR%lib/Release .
cmake --build . --target mysqlcppconn --config Debug
cmake --build . --target mysqlcppconn --config Release

if not exist "%VENDOR_DIR%include\cppconn" (
    xcopy "cppconn" "%VENDOR_DIR%include\cppconn" /s /i /y
    xcopy "driver\mysql_driver.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "driver\mysql_connection.h" "%VENDOR_DIR%include" /s /i /y
    xcopy "driver\Debug" "%VENDOR_DIR%lib\Debug" /s /i /y
    xcopy "driver\Release" "%VENDOR_DIR%lib\Release" /s /i /y
)

cd "%BUILD_DIR%"

goto :eof
rem --- End of BUILD_MYSQL_CONNECTOR_CPP ---------------------------------------
rem ----------------------------------------------------------------------------

Add checks for the git and svn commands that are required


cargo rustc --release -q -- -Awarnings
.\halite -d "240 160" "target\release\MyBot" "target\release\MyBot"

Create run_game.bat

Create run_game.bat


pushd %~dp0

"%PROGRAMFILES(X86)%\MSBuild\12.0\Bin\MSBuild.exe" /t:Build /p:Configuration=Debug MonoDevelop.AddinMaker.sln
if not %ERRORLEVEL% == 0 goto Error

"%PROGRAMFILES(X86)%\MSBuild\12.0\Bin\MSBuild.exe" /t:InstallAddin /p:Configuration=Debug MonoDevelop.AddinMaker.csproj
if not %ERRORLEVEL% == 0 goto Error

goto Exit

:Error
echo ERROR
pause
goto Exit

:Exit
popd

pushd %~dp0

"%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\MSBuild.exe" /t:Build /p:Configuration=Debug MonoDevelop.AddinMaker.sln
if not %ERRORLEVEL% == 0 goto Error

"%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\MSBuild.exe" /t:InstallAddin /p:Configuration=Debug MonoDevelop.AddinMaker.csproj
if not %ERRORLEVEL% == 0 goto Error

goto Exit

:Error
echo ERROR
pause
goto Exit

:Exit
popd

Use MSBuild 14 from build script

Use MSBuild 14 from build script


@echo off
REM This script runs the example application.

REM Usage: adapter.sh <command>

REM <command> is one of: start, stop, now

REM The name to be displayed when starting/stopping the application

set SERVICE_NAME=taxii-log-adapter
REM Directory where the application jar file is located

set HOME_DIR=C:\taxii\taxii-log-adapter

REM Directory where the log files will be created

set LOG_DIR=%HOME_DIR%\log

set PATH_TO_JAR=%HOME_DIR%\taxii-log-adapter.jar

set PID_PATH_NAME=%HOME_DIR%\application.pid

cd %HOME_DIR%

GOTO %1

:now
    IF EXIST %PID_PATH_NAME% (
        echo %SERVICE_NAME% is already running ...
    ) ELSE (
        echo Triggering %SERVICE_NAME% ...

        java -Djsse.enableSNIExtension=false -Dspring.profiles.active=now -jar %PATH_TO_JAR% 2>%LOG_DIR%/err.out 1>%LOG_DIR%/std.out

        echo %SERVICE_NAME% finished
    )

    GOTO end

:start
    IF EXIST %PID_PATH_NAME% (
        echo %SERVICE_NAME% is already running ...
    ) ELSE (
        echo %SERVICE_NAME% starting...
        java -Djsse.enableSNIExtension=false -Dspring.profiles.active=schedule -jar %PATH_TO_JAR% 2>%LOG_DIR%/err.out 1>%LOG_DIR%/std.out

        echo %SERVICE_NAME% finished
        )
    GOTO end

:stop
    set /p PID=<%PID_PATH_NAME%
    taskkill /PID %PID% /F
    del %PID_PATH_NAME%
    echo stopped

:end

@echo on
REM This script runs the example application.

REM Usage: adapter.sh <command>

REM <command> is one of: start, stop, now

REM The name to be displayed when starting/stopping the application

set SERVICE_NAME=taxii-log-adapter
REM Directory where the application jar file is located

set HOME_DIR=C:\taxii\taxii-log-adapter

REM Directory where the log files will be created

set LOG_DIR=%HOME_DIR%\log
mkdir %LOG_DIR%

set PATH_TO_JAR=%HOME_DIR%\taxii-log-adapter.jar

set PID_PATH_NAME=%HOME_DIR%\application.pid

set JAVA_OPTS=-Djsse.enableSNIExtension=false -Djava.io.tmpdir=%HOME_DIR%

cd %HOME_DIR%

GOTO %1

:now
    IF EXIST %PID_PATH_NAME% (
        echo %SERVICE_NAME% is already running ...
    ) ELSE (
        echo Triggering %SERVICE_NAME% ...
        java %JAVA_OPTS% -Dspring.profiles.active=now -jar %PATH_TO_JAR% 2>%LOG_DIR%/err.out 1>%LOG_DIR%/std.out
        echo %SERVICE_NAME% finished
    )

    GOTO end

:start
    IF EXIST %PID_PATH_NAME% (
        echo %SERVICE_NAME% is already running ...
    ) ELSE (
        echo %SERVICE_NAME% starting...
        java %JAVA_OPTS% -Dspring.profiles.active=schedule -jar %PATH_TO_JAR% 2>%LOG_DIR%/err.out 1>%LOG_DIR%/std.out
        echo %SERVICE_NAME% finished
        )
    GOTO end

:stop
    set /p PID=<%PID_PATH_NAME%
    taskkill /PID %PID% /F
    del %PID_PATH_NAME%
    echo stopped

:end

create log dir on windows, set tmp dir

create log dir on windows, set tmp dir


if exist classes rmdir classes /s /q
if exist build rmdir build /s /q
mkdir classes
mkdir build
xcopy /E /y src classes\
"%JAVA_HOME%\bin\java" -cp ../../3rdpartypublic/classext/clojure.jar;../MMCoreJ_wrap/MMCoreJ.jar;../../3rdpartypublic/classext/ij.jar;../mmstudio/MMJ_.jar;../../3rdpartypublic/classext/bsh-2.0b4.jar;./src -Dclojure.compile.path=classes clojure.lang.Compile org.micromanager.acq-engine
"%JAVA_HOME%\bin\jar" cf MMAcqEngine.jar -C classes\ .
copy /Y MMAcqEngine.jar ..\bin_Win32\
copy /Y MMAcqEngine.jar ..\bin_x64\
copy /Y MMAcqEngine.jar ..\Install_Win32\micro-manager\plugins\Micro-Manager"
copy /Y MMAcqEngine.jar ..\Install_x64\micro-manager\plugins\Micro-Manager"

if exist classes rmdir classes /s /q
if exist build rmdir build /s /q
mkdir classes
mkdir build
xcopy /E /y src classes\
"%JAVA_HOME%\bin\java" -cp ../../3rdpartypublic/classext/clojure.jar;../MMCoreJ_wrap/MMCoreJ.jar;../../3rdpartypublic/classext/ij.jar;../mmstudio/MMJ_.jar;../../3rdpartypublic/classext/bsh-2.0b4.jar;./src -Dclojure.compile.path=classes clojure.lang.Compile org.micromanager.acq-engine
"%JAVA_HOME%\bin\jar" cf MMAcqEngine.jar -C classes\ .
copy /Y MMAcqEngine.jar ..\bin_Win32\
copy /Y MMAcqEngine.jar ..\bin_x64\
mkdir ..\Install_Win32\micro-manager\plugins\Micro-Manager
copy /Y MMAcqEngine.jar ..\Install_Win32\micro-manager\plugins\Micro-Manager\
mkdir ..\Install_x64\micro-manager\plugins\Micro-Manager
copy /Y MMAcqEngine.jar ..\Install_x64\micro-manager\plugins\Micro-Manager\

Fix Windows acqEngine build script.

Fix Windows acqEngine build script.

Avoid copying to a nonexistent directory, thereby creating a file with that
name.

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@11489 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd


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

REM Set unique build ID.
FOR /f "usebackq tokens=*" %%a in (`python -c "import uuid; print uuid.uuid4()"`) do set AUTONINJA_BUILD_ID=%%a

REM Execute whatever is printed by autoninja.py.
REM Also print it to reassure that the right settings are being used.
FOR /f "usebackq tokens=*" %%a in (`python %~dp0autoninja.py "%*"`) do echo %%a & %%a
@if errorlevel 1 goto buildfailure

REM Use call to invoke python script here, because we use python via python.bat.
@if "%NINJA_SUMMARIZE_BUILD%" == "1" call python.bat %~dp0post_build_ninja_summary.py %*
@call python.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %*

exit /b
:buildfailure

@call python.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %*

REM Return an error code of 1 so that if a developer types:
REM "autoninja chrome && chrome" then chrome won't run if the build fails.
cmd /c exit 1

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

setlocal

REM Set unique build ID.
FOR /f "usebackq tokens=*" %%a in (`python -c "import uuid; print uuid.uuid4()"`) do set AUTONINJA_BUILD_ID=%%a

REM If a build performance summary has been requested then also set NINJA_STATUS
REM to trigger more verbose status updates. In particular this makes it possible
REM to see how quickly process creation is happening - often a critical clue on
REM Windows. The trailing space is intentional.
if "%NINJA_SUMMARIZE_BUILD%" == "1" set NINJA_STATUS=[%%r processes, %%f/%%t @ %%o/s : %%es ]

REM Execute whatever is printed by autoninja.py.
REM Also print it to reassure that the right settings are being used.
FOR /f "usebackq tokens=*" %%a in (`python %~dp0autoninja.py "%*"`) do echo %%a & %%a
@if errorlevel 1 goto buildfailure

REM Use call to invoke python script here, because we use python via python.bat.
@if "%NINJA_SUMMARIZE_BUILD%" == "1" call python.bat %~dp0post_build_ninja_summary.py %*
@call python.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %*

exit /b
:buildfailure

@call python.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %*

REM Return an error code of 1 so that if a developer types:
REM "autoninja chrome && chrome" then chrome won't run if the build fails.
cmd /c exit 1

Set NINJA_STATUS for better build performance summarizing

When NINJA_SUMMARIZE_BUILD=1 then autoninja prints a summary of build
performance at the end. This change makes it so that ninja prints more
detailed build statistics during the build. In particular, slow process
creation is a common but difficult to see bottleneck. This change makes
it so that if NINJA_SUMMARIZE_BUILD=1 then the number of running build
processes will be displayed.

Bug: 787983
Change-Id: Ic0907e23e7f762e23e4795059b37085e0cb8c4ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1582802
Reviewed-by: Dirk Pranke <6693ee08b084bb2ffa767f664c99b689395e0e4b@chromium.org>
Commit-Queue: Bruce Dawson <fe9e26f3989304bf7275ed139c57fd059c63d22d@chromium.org>


@echo off

setlocal
rem -----------------------------------------------
rem is batch executing with adiMistrator privileges
rem
rem -----------------------------------------------
set filename=%windir%\$%random%$
(@echo Hello, this is the administrator >%filename% ) 2> nul && (del %filename% & set elevated=1) || (set elevated=0)
if %elevated% == 0 (
    echo This script requires an elevated command shell to run.
    echo finished
    goto :eof
    )

if "%targetVS%"=="" set targetVS=12.0
if "%targetHive%"=="" set targetHive=Roslyn

set PreviewVersion=0.6.40308.1
set unconfigure=false
set verification=-Vr
set label=Disable

echo Prepare for Roslyn Open Source development
echo.

echo Create or clean the RoslynDev addin hive
echo.

if "%VSSDK120Install%" == "" (
    echo ERROR!   To build and debug the .Net compilers Open source projects requires the latest Visual Studio SDK.
    echo.
    set errorlevel=1
    goto :eof
    )

if /I "%1"=="u" (
    set unconfigure=true
    set verification=-Vu
    set label=Enable
    )

if not "%unconfigure%" == "true" (
    set unconfigure=false
    set verification=-Vr
    set label=Disable
    )

if not "%unconfigure%" == "true" (
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul

	msbuild %~dp0\prepare.msbuild
    )

call :DisableVerificationFor Microsoft.CodeAnalysis.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll
call :DisableVerificationFor CompilerPackage.dll
call :DisableVerificationFor Roslyn.Compilers.BuildTasks.dll
call :DisableVerificationFor rcsc.exe
call :DisableVerificationFor rvbc.exe
call :DisableVerificationFor VBCSCompiler.exe

rem List skip verification entries
echo.
sn -q -Vl

if "%unconfigure%" == "true" (
    rem Reset the RoslynDev hive from the main hive,
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Clean /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive% /F > nul 2>&1
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive%_Config /F > nul 2>&1
    )

goto :eof

:DisableVerificationFor %1
@echo %label% verification for %1
for /F %%f in ('dir /s /b "%LOCALAPPDATA%\Microsoft\VisualStudio\%targetVS%%TargetHive%\%1"') do sn -q %verification% "%%f" && goto :eof
goto :eof

@echo off

setlocal
rem -----------------------------------------------
rem is batch executing with adiMistrator privileges
rem
rem -----------------------------------------------
set filename=%windir%\$%random%$
(@echo Hello, this is the administrator >%filename% ) 2> nul && (del %filename% & set elevated=1) || (set elevated=0)
if %elevated% == 0 (
    echo This script requires an elevated command shell to run.
    echo finished
    goto :eof
    )

if "%targetVS%"=="" set targetVS=12.0
if "%targetHive%"=="" set targetHive=Roslyn

set PreviewVersion=0.6.40308.1
set unconfigure=false
set verification=-Vr
set label=Disable

echo Prepare for Roslyn Open Source development
echo.

echo Create or clean the RoslynDev addin hive
echo.

if "%VSSDK120Install%" == "" (
    echo ERROR!   To build and debug the .Net compilers Open source projects requires the latest Visual Studio SDK.
    echo.
    set errorlevel=1
    goto :eof
    )

if /I "%1"=="u" (
    set unconfigure=true
    set verification=-Vu
    set label=Enable
    )

if not "%unconfigure%" == "true" (
    set unconfigure=false
    set verification=-Vr
    set label=Disable
    )

if not "%unconfigure%" == "true" (
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul

    msbuild %~dp0\prepare.msbuild
    )

call :DisableVerificationFor Microsoft.CodeAnalysis.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll
call :DisableVerificationFor CompilerPackage.dll
call :DisableVerificationFor Roslyn.Compilers.BuildTasks.dll
call :DisableVerificationFor rcsc.exe
call :DisableVerificationFor rvbc.exe
call :DisableVerificationFor VBCSCompiler.exe

rem List skip verification entries
echo.
if exist "%WindowsSDK_ExecutablePath_x86%"sn.exe echo. && echo x86 verification Entries && "%WindowsSDK_ExecutablePath_x86%sn.exe" -q  -Vl
if exist "%WindowsSDK_ExecutablePath_x64%"sn.exe echo. && echo x64 verification Entries && "%WindowsSDK_ExecutablePath_x64%sn.exe" -q  -Vl
echo.

if "%unconfigure%" == "true" (
    rem Reset the RoslynDev hive from the main hive,
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Clean /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive% /F > nul 2>&1
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive%_Config /F > nul 2>&1
    )

goto :eof

:DisableVerificationFor %1
@echo %label% verification for %1
for /F %%f in ('dir /s /b "%LOCALAPPDATA%\Microsoft\VisualStudio\%targetVS%%TargetHive%\%1"') do call :CallSn %verification% "%%f" && goto :eof
goto :eof

:CallSn %1 %2
if exist "%WindowsSDK_ExecutablePath_x86%"sn.exe "%WindowsSDK_ExecutablePath_x86%sn.exe" -q  %1 %2
if exist "%WindowsSDK_ExecutablePath_x64%"sn.exe "%WindowsSDK_ExecutablePath_x64%sn.exe" -q  %1 %2
goto :eof

Enable 64 bit sn -Vr in prepare.bat (changeset 1220400)


GOTO copyrightend

	Copyright 2013-2015 Guardtime, Inc.

	This file is part of the Guardtime client SDK.

	Licensed under the Apache License, Version 2.0 (the "License").
	You may not use this file except in compliance with the License.
	You may obtain a copy of the License at
	    http://www.apache.org/licenses/LICENSE-2.0
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
	express or implied. See the License for the specific language governing
	permissions and limitations under the License.
	"Guardtime" and "KSI" are trademarks or registered trademarks of
	Guardtime, Inc., and no license to trademarks is granted; Guardtime
	reserves and retains all trademark rights.

:copyrightend

@ECHO OFF

CALL "%ProgramW6432%\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64

nmake clean
nmake RTL=MTd DLL=lib NET_PROVIDER=WINHTTP CRYPTO_PROVIDER=CRYPTOAPI all memtest

pause

GOTO copyrightend

	Copyright 2013-2015 Guardtime, Inc.

	This file is part of the Guardtime client SDK.

	Licensed under the Apache License, Version 2.0 (the "License").
	You may not use this file except in compliance with the License.
	You may obtain a copy of the License at
	    http://www.apache.org/licenses/LICENSE-2.0
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
	express or implied. See the License for the specific language governing
	permissions and limitations under the License.
	"Guardtime" and "KSI" are trademarks or registered trademarks of
	Guardtime, Inc., and no license to trademarks is granted; Guardtime
	reserves and retains all trademark rights.

:copyrightend

@ECHO OFF

CALL "%ProgramW6432%\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64

nmake clean
nmake RTL=MTd DLL=lib NET_PROVIDER=WINHTTP CRYPTO_PROVIDER=CRYPTOAPI all test

pause

Update WinBuild64.bat: remove accidental memtest target.