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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

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

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

for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGE_JSON=%%~f
    echo %PACKAGE_JSON%
    echo %%f
    echo %%~f
    echo "NPM Install: %DEPLOYMENT_SOURCE%\%PACKAGE_JSON:~-12%"
    pushd "%DEPLOYMENT_SOURCE%\%PACKAGE_JSON:~-12%"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

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

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

:: 1. Build Script
node .deploy/deploy.js

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

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

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

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

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

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

:: 1. Build Script
node .deploy/deploy.js

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Build Master:2017-02-28T18:44:28.354Z

Build Master:2017-02-28T18:44:28.354Z


@echo off

IF DEFINED JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) ELSE (
  FOR %%I IN (java.exe) DO set JAVA=%%~$PATH:I
)
IF NOT EXIST %JAVA% (
  ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
  EXIT /B 1
)

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

REM check in case a user was using this mechanism
if "%ES_CLASSPATH%" == "" (
set ES_CLASSPATH=!ES_HOME!/lib/*
) else (
ECHO Error: Don't modify the classpath with ES_CLASSPATH, Best is to add 1>&2
ECHO additional elements via the plugin mechanism, or if code must really be 1>&2
ECHO added to the main classpath, add jars to lib\, unsupported 1>&2
EXIT /B 1
)

%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker"

IF ERRORLEVEL 1 (
    ECHO Elasticsearch requires at least Java 8 but your Java version from %JAVA% does not meet this requirement
    EXIT /B 1
)

set ES_PARAMS=-Delasticsearch -Des.path.home="%ES_HOME%"

@echo off

IF DEFINED JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) ELSE (
  FOR %%I IN (java.exe) DO set JAVA="%%~$PATH:I"
)
IF NOT EXIST %JAVA% (
  ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
  EXIT /B 1
)

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

REM check in case a user was using this mechanism
if "%ES_CLASSPATH%" == "" (
set ES_CLASSPATH=!ES_HOME!/lib/*
) else (
ECHO Error: Don't modify the classpath with ES_CLASSPATH, Best is to add 1>&2
ECHO additional elements via the plugin mechanism, or if code must really be 1>&2
ECHO added to the main classpath, add jars to lib\, unsupported 1>&2
EXIT /B 1
)

%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker"

IF ERRORLEVEL 1 (
    ECHO Elasticsearch requires at least Java 8 but your Java version from %JAVA% does not meet this requirement
    EXIT /B 1
)

set ES_PARAMS=-Delasticsearch -Des.path.home="%ES_HOME%"

Fix use of spaces on Windows if JAVA_HOME not set

When JAVA_HOME is not set we try to detect the location of Java. If its
location contains a space, due to a lack of quoting we will be
unsuccessful in invoking Java. This commit adds the necessary quoting to
handle this case.

Relates #23822


Build 68

Build 68


@echo off
setlocal

rem Copyright (c) 1999, 2010 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper command based script.

rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.4 of the Wrapper.

rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper

rem The name and location of the Wrapper configuration file.
rem  (Do not remove quotes.)
set _WRAPPER_CONF_DEFAULT="../conf/neo4j-wrapper.conf"

rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem Find the application home.
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
goto search
:amd64
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
goto search
:ia64
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
goto search
:search
set _WRAPPER_EXE=%_WRAPPER_L_EXE%
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto validate
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF=""
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
goto validate

:validate
rem
rem Find the requested command.
rem
for /F %%v in ('echo %1^|findstr "^help$ ^console$ ^start$ ^pause$ ^resume$ ^stop$ ^restart$ ^install$ ^remove$"') do call :exec set COMMAND=%%v

if "%COMMAND%" == "" (
    set COMMAND=console
)

rem
rem Run the application.
rem At runtime, the current directory will be that of wrapper.exe
rem
call :%COMMAND%
if errorlevel 1 goto callerror
goto :eof

:callerror
echo An error occurred in the process.
pause
goto :eof

:help
echo Usage: %0 { console : start : stop : restart : install : remove } [command]
pause
goto :eof

:console
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
goto :eof

:start
"%_WRAPPER_EXE%" -t %_WRAPPER_CONF%
goto :eof

:pause
"%_WRAPPER_EXE%" -a %_WRAPPER_CONF%
goto :eof

:resume
"%_WRAPPER_EXE%" -e %_WRAPPER_CONF%
goto :eof

:stop
"%_WRAPPER_EXE%" -p %_WRAPPER_CONF%
goto :eof

:install
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
goto :eof

:remove
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
goto :eof

:restart
call :stop
call :start
goto :eof

:exec
%*
goto :eof

@echo off
setlocal

rem Copyright (c) 1999, 2010 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper command based script.

rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.4 of the Wrapper.

rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper

rem The name and location of the Wrapper configuration file.
rem  (Do not remove quotes.)
set _WRAPPER_CONF_DEFAULT="../conf/neo4j-wrapper.conf"

rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem Find the application home.
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
rem Note: user is responsible for only keeping one
rem wrapper in place.
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF=""
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
goto validate

:validate
rem
rem Find the requested command.
rem
for /F %%v in ('echo %1^|findstr "^help$ ^console$ ^start$ ^pause$ ^resume$ ^stop$ ^restart$ ^install$ ^remove$"') do call :exec set COMMAND=%%v

if "%COMMAND%" == "" (
    set COMMAND=console
)

rem
rem Run the application.
rem At runtime, the current directory will be that of wrapper.exe
rem
call :%COMMAND%
if errorlevel 1 goto callerror
goto :eof

:callerror
echo An error occurred in the process.
pause
goto :eof

:help
echo Usage: %0 { console : start : stop : restart : install : remove } [command]
pause
goto :eof

:console
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
goto :eof

:start
"%_WRAPPER_EXE%" -t %_WRAPPER_CONF%
goto :eof

:pause
"%_WRAPPER_EXE%" -a %_WRAPPER_CONF%
goto :eof

:resume
"%_WRAPPER_EXE%" -e %_WRAPPER_CONF%
goto :eof

:stop
"%_WRAPPER_EXE%" -p %_WRAPPER_CONF%
goto :eof

:install
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
goto :eof

:remove
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
goto :eof

:restart
call :stop
call :start
goto :eof

:exec
%*
goto :eof

Make scripts look for any windows wrapper, not assuming anyting based on guessing.

git-svn-id: d3b6981a72c34c2e21b7d6429dd2b836e77ced17@7105 0b971d98-bb2f-0410-8247-b05b2b5feb2a


nuget push LightNode.Core.1.2.0.nupkg
nuget push LightNode.Server.1.2.0.nupkg
nuget push LightNode.Client.PCL.T4.1.2.0.nupkg
nuget push LightNode.Client.UniRx.T4.1.2.0.nupkg
nuget push LightNode.Formatter.ProtoBuf.1.2.0.nupkg
nuget push LightNode.Formatter.MsgPack.1.2.0.nupkg
nuget push LightNode.Formatter.JsonNet.1.2.0.nupkg
nuget push LightNode.Formatter.Jil.1.2.0.nupkg
nuget push LightNode.Formatter.Jil.LZ4.1.2.0.nupkg
nuget push Glimpse.LightNode.1.2.0.nuspec
nuget push LightNode.Swagger.1.2.0.nuspec

nuget push LightNode.Core.1.2.0.nupkg
nuget push LightNode.Server.1.2.0.nupkg
nuget push LightNode.Client.PCL.T4.1.2.0.nupkg
nuget push LightNode.Client.UniRx.T4.1.2.0.nupkg
nuget push LightNode.Formatter.ProtoBuf.1.2.0.nupkg
nuget push LightNode.Formatter.MsgPack.1.2.0.nupkg
nuget push LightNode.Formatter.JsonNet.1.2.0.nupkg
nuget push LightNode.Formatter.Jil.1.2.0.nupkg
nuget push LightNode.Formatter.Jil.LZ4.1.2.0.nupkg
nuget push Glimpse.LightNode.1.2.0.nupkg
nuget push LightNode.Swagger.1.2.0.nupkg

fix nupush

fix nupush


@echo off

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

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   JMETER_BIN - JMeter bin directory (must end in \)
rem   JM_LAUNCH - java.exe (default) or javaw.exe
rem   JVM_ARGS - additional java options, e.g. -Dprop=val
rem   JM_START - set this to "start" to launch JMeter in a separate window
rem              this is used by the jmeterw.cmd script.
rem
rem   =====================================================

setlocal

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
set JAVAVER=%JAVAVER:"=%
for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
    set current_minor=%%w
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe

if exist jmeter.bat goto winNT1
if .%JMETER_BIN% == . set JMETER_BIN=%~dp0

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m

#Uncomment this to generate GC verbose file
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps

set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=250 -XX:G1ReservePercent=20

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

set DDRAW=
rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

rem Setting this flag to true enables hardware-accelerated scaling.
rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS%

%JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

@echo off

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

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   JMETER_BIN - JMeter bin directory (must end in \)
rem   JM_LAUNCH - java.exe (default) or javaw.exe
rem   JVM_ARGS - additional java options, e.g. -Dprop=val
rem   JM_START - set this to "start" to launch JMeter in a separate window
rem              this is used by the jmeterw.cmd script.
rem
rem   =====================================================

setlocal

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
set JAVAVER=%JAVAVER:"=%
for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
    set current_minor=%%w
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe

if exist jmeter.bat goto winNT1
if .%JMETER_BIN% == . set JMETER_BIN=%~dp0

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m

rem Uncomment this to generate GC verbose file
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps

set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=250 -XX:G1ReservePercent=20

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

set DDRAW=
rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

rem Setting this flag to true enables hardware-accelerated scaling.
rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

Fix typos in jmeter.bat

Fix typos in jmeter.bat

git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1780118 13f79535-47bb-0310-9956-ffa450edef68


@ECHO OFF
SETLOCAL
SET VERSION=%1
SET NUGET=.nuget\nuget.exe

DEL *.nupkg

"C:\Program Files (x86)\MSBuild\12.0\bin\amd64\msbuild" DWX.PortableApps.Logging.sln /target:Clean;Build /p:Configuration=Release;OutDir=..\bin

%NUGET% SetApiKey %2

FOR %%G IN (*.nuspec) DO (
  %NUGET% pack %%G -Version %VERSION%
)
REM -Symbols

FOR %%G IN (*.nupkg) DO (
  %NUGET% push %%G
)

@ECHO OFF
SETLOCAL
SET VERSION=%1
SET NUGET=.nuget\nuget.exe

DEL *.nupkg

"C:\Program Files (x86)\MSBuild\12.0\bin\amd64\msbuild" DWX.PortableApps.Logging.sln /target:Clean;Build /p:Configuration=Release;OutDir=..\bin

%NUGET% SetApiKey %2

FOR %%G IN (*.nuspec) DO (
  %NUGET% pack %%G -Version %VERSION% -Symbols
)
FOR %%G IN (*.nupkg) DO (
  %NUGET% push %%G
)

fix build script

fix build script


@echo off

REM check user wants to go ahead
 :start
echo This script will turn this copy of Topographica into one
echo suitable for binary distribution.
echo.
echo ** BE SURE YOU WANT TO DO THIS TO YOUR COPY OF TOPOGRAPHICA **
echo.
echo.
set choice=
set /p choice=Enter '1' to proceeed or '2' to quit:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto install
if '%choice%'=='2' goto end
echo "%choice%" is not valid; please enter '1' or '2'
echo.
goto start

:install

REM - copies setup.py to root directory
REM - cleans files that aren't needed for the binary version

REM Put the setup script, Topographica icon, and installation
REM script file into the topographica directory (for use while
REM creating setup.exe file)
copy ..\common\setup.py ..\..
copy ..\common\topographica.ico ..\..
copy ..\create_installer\topographica.iss ..\..

REM Clean this copy of Topographica...

cd ..\..

REM not using the makefile...
del /Q /F Makefile

REM delete files created by setup_cvs_copy\setup.bat
del /Q /F topographica
del /Q /F topographica.bat

REM **** Things the Makefile deletes
del /S /Q /F .#* *~ .cvsignore ChangeLog.txt *\.cvsignore *\*\.cvsignore
del etc\topographica.elc ImageSaver*.ppm countalerts* annotate.out
del examples\disparity_energy.ty
del examples\homeostatic.ty
del examples\joublin_bc96.ty
del examples\laminar.ty*
del examples\laminar_lissom.ty
del examples\laminar_nolearning.ty
del examples\leaky_lissom_or.ty
del examples\lissom_oo_od.ty
del examples\lissom_oo_or_dy_photo.ty
del examples\lissom_oo_or_homeomaxent.ty
del examples\lissom_or_homeomaxent.ty
del examples\lissom_or_homeoscale.ty
del examples\lissom_or_noshrinking.ty
del examples\lissom_or_noshrinking_latswitch.ty
del examples\lissom_or_sf.ty
del examples\ohzawa_science90.ty
del examples\sullivan_neurocomputing04.ty
del examples\sullivan_neurocomputing06.ty
del examples\tiny.ty

rmdir /Q /S tmp\
REM CEBHACKALERT: need to delete CVS/ dirs recursively

rmdir /Q /S CVS
cd examples\
rmdir /Q /S CVS
cd ..
cd etc\
rmdir /Q /S CVS
cd ..
cd topo\
rmdir /Q /S CVS
cd ..
REM **** end things the Makefile deletes

print %cd%
REM ** delete external/
rmdir /Q /S external

REM ** delete .pyc files
del /S /Q /F *.pyc

REM ** Finally, remove topographica-win\
REM (includes this file!)
rmdir /Q /S topographica-win

:end

@echo off

REM check user wants to go ahead
 :start
echo This script will turn this copy of Topographica into one
echo suitable for binary distribution.
echo.
echo ** BE SURE YOU WANT TO DO THIS TO YOUR COPY OF TOPOGRAPHICA **
echo.
echo.
set choice=
set /p choice=Enter '1' to proceeed or '2' to quit:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto install
if '%choice%'=='2' goto end
echo "%choice%" is not valid; please enter '1' or '2'
echo.
goto start

:install

REM - copies setup.py to root directory
REM - cleans files that aren't needed for the binary version

REM Put the setup script, Topographica icon, and installation
REM script file into the topographica directory (for use while
REM creating setup.exe file)
copy ..\common\setup.py ..\..
copy ..\common\topographica.ico ..\..
copy ..\create_installer\topographica.iss ..\..

REM Clean this copy of Topographica...

cd ..\..

REM not using the makefile...
del /Q /F Makefile

REM delete files created by setup_cvs_copy\setup.bat
del /Q /F topographica
del /Q /F topographica.bat

REM **** Things the Makefile deletes
del /S /Q /F .#* *~ .cvsignore ChangeLog.txt *\.cvsignore *\*\.cvsignore
del etc\topographica.elc ImageSaver*.ppm countalerts* annotate.out
del examples\disparity_energy.ty
del examples\homeostatic.ty
del examples\joublin_bc96.ty
del examples\laminar.ty*
del examples\laminar_lissom.ty
del examples\laminar_nolearning.ty
del examples\leaky_lissom_or.ty
del examples\lissom_oo_od.ty
del examples\lissom_oo_or_dy_photo.ty
del examples\lissom_oo_or_homeomaxent.ty
del examples\lissom_or_homeomaxent.ty
del examples\lissom_or_homeoscale.ty
del examples\lissom_or_noshrinking.ty
del examples\lissom_or_noshrinking_latswitch.ty
del examples\lissom_or_sf.ty
del examples\ohzawa_science90.ty
del examples\sullivan_neurocomputing04.ty
del examples\sullivan_neurocomputing06.ty

rmdir /Q /S tmp\
REM CEBHACKALERT: need to delete CVS/ dirs recursively

rmdir /Q /S CVS
cd examples\
rmdir /Q /S CVS
cd ..
cd etc\
rmdir /Q /S CVS
cd ..
cd topo\
rmdir /Q /S CVS
cd ..
REM **** end things the Makefile deletes

print %cd%
REM ** delete external/
rmdir /Q /S external

REM ** delete .pyc files
del /S /Q /F *.pyc

REM ** Finally, remove topographica-win\
REM (includes this file!)
rmdir /Q /S topographica-win

:end

Put tiny.ty back into the distribution

Put tiny.ty back into the distribution


@echo off
if "%1"=="" goto default_value_python:
if "%1"=="default" goto default_value_python:
set pythonexe=%1
goto start_script:

:default_value_python:
set pythonexe=c:\Python36_x64

:start_script:
set current=%~dp0
set PATH=%pythonexe%;%pythonexe%\Scripts;%PATH%
if not exist boost mkdir boost
pushd boost

:download:
set version=1_64_0
set version2=1.64.0
if exist %current%boost\boost_%version% goto booststrap:
@echo Download boost
bitsadmin /transfer wcb /priority high https://dl.bintray.com/boostorg/release/%version2%/source/boost_%version%.7z %current%boost\boost_%version%.7z
set PATH=%PATH%;C:\Program Files\7-Zip\
@echo Unzip xgboost
7z x %current%boost\boost_%version%.7z -o%current%boost\boost_%version%

:booststrap:
@echo BOOTSTRAP ---------------------
cd %current%boost\boost_%version%\tools\build
cmd /c bootstrap

:b2:
@echo B2 ---------------------
cmd /c b2 install --prefix=%current%boost\MYINST

:build:
set PATH=%PATH%;%current%boost\MYINST\bin
cd %current%boost\boost_%version%
b2 --build-dir=%current%boost\build toolset=msvc --build-type=complete msvc stage

@echo off
if "%1"=="" goto default_value_python:
if "%1"=="default" goto default_value_python:
set pythonexe=%1
goto start_script:

:default_value_python:
set pythonexe=c:\Python36_x64

:start_script:
set current=%~dp0
set PATH=%pythonexe%;%pythonexe%\Scripts;%PATH%
if not exist boost mkdir boost
pushd boost

:download:
set version=1_64_0
set version2=1.64.0
if exist %current%boost\boost_%version% goto booststrap:
@echo Download boost
bitsadmin /transfer wcb /priority high https://dl.bintray.com/boostorg/release/%version2%/source/boost_%version%.7z %current%boost\boost_%version%.7z
set PATH=%PATH%;C:\Program Files\7-Zip\
@echo Unzip xgboost
7z x %current%boost\boost_%version%.7z -o%current%boost\boost_%version%

:booststrap:
@echo BOOTSTRAP ---------------------
cd %current%boost\boost_%version%\boost_%version%\tools\build
rem cmd /c bootstrap

:b2:
@echo B2 ---------------------
rem cmd /c b2 install --prefix=%current%boost\MYINST

:python-config:
@echo [config]
rem @echo "using python : 3.6;" >> boost\MYINST\share\boost-build\example\user-config.jam

:build:
@echo [build]
set PATH=%PATH%;%current%boost\MYINST\bin
cd %current%boost\boost_%version%\boost_%version%
b2 --build-dir=%current%boost\build toolset=msvc --with-python --build-type=complete architecture=x86 address-model=64 runtime-link=static msvc stage

update boost build

update boost build


@echo off
title Operations Server Installer

REM ---------------------------------------------------------------------
REM Set user specified variables
REM ---------------------------------------------------------------------
Call InstallSettings.bat

REM ---------------------------------------------------------------------
REM Set other variables
REM ---------------------------------------------------------------------
set ops_AGSVersion=10.2
set ops_PortalVersion=10.2

REM Define PostgreSQL paths
set ops_postgresqlInstallDIR="C:\Program Files\PostgreSQL\9.2"
set ops_postgresqlDataDIR=%ops_postgresqlInstallDIR%\data

REM Define path to Esri SoftwareAuthorization.exe
set ops_softwareAuthExePath="C:\Program Files\Common Files\ArcGIS\bin\SoftwareAuthorization.exe"

REM Define path to ConfigureWebAdaptor.exe
set ops_ConfWebAdaptorExePath="C:\Program Files (x86)\Common Files\ArcGIS\WebAdaptor\IIS\Tools\ConfigureWebAdaptor.exe"

set sectionBreak=========================================================================
set ops_tempInstallDir=C:\OpsServerInstallTemp
cls

REM ---------------------------------------------------------------------
REM Check if command prompt is running in elevated permissions mode
REM (i.e. "run as administrator)
REM ---------------------------------------------------------------------
echo.
echo --Checking if Windows Command window is running as administrator
echo   by querying LOCAL SERVICE user registry entries...
echo.
reg query HKU\S-1-5-19
if "%ERRORLEVEL%"=="1" (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  You are _NOT_ running Windows Command window
    echo **  in elevated administrator mode ^(i.e., the CMD.exe
    echo **  must be "Run as administrator"^).
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

REM ---------------------------------------------------------------------
REM Check if user "installed" configuration script in correct location
REM ---------------------------------------------------------------------
echo.
echo --Checking if installation scripts are installed in the correct location...

set ops_ScriptRootName=ops-server-config
set ops_ScriptRoot=C:\%ops_ScriptRootName%\

echo %~dp0 | find /I "%ops_ScriptRoot%"

if "%ERRORLEVEL%"=="1" (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  The '%ops_ScriptRootName%' folder is not installed in
    echo **  the correct location. It should be located at:
    echo **  %ops_ScriptRoot%
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

REM ---------------------------------------------------------------------
REM Check if Software Root path exists and you have access to the folder
REM ---------------------------------------------------------------------

echo.
echo --Checking if specified software root path '%ops_softwareRoot%' exists...

if not exist %ops_softwareRoot% (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  The software root path ^(variable 'ops_softwareRoot'^)
    echo **  '%ops_softwareRoot%'
    echo **  you have specified does not exist or your account does
    echo **  not have access to this location.
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

echo.
echo --Checking if you have access to the software root path '%ops_softwareRoot%'...

dir %ops_softwareRoot%
if "%ERRORLEVEL%"=="1" (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  Your account does not have access to the sofware root
    echo **  folder path '%ops_ScriptRoot%'
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

:start
REM ---------------------------------------------------------------------
REM Start Block
REM ---------------------------------------------------------------------
echo *************************************************************************
echo *                    Operations Server Installation                     *
echo *************************************************************************
echo.
REM Display prequisites and other important install notes stored in Notes.txt
REM to user.
type Notes.txt
echo.
echo *************************************************************************
echo.
echo 1. Install Ops Server.
echo.
echo 0. Quit
echo.

set /p choice="Enter the number of your choice: "

if "%choice%"=="1" (
    set opsServerInstallType=Install
    REM was having problems with the IIS check on some systems;
    REM for now, set variable to "NO" so that it does not run
    REM the check. Not critical to run the check, since we do tell
    REM users that they have to uninstall IIS if it is already installed.
    set ops_Check_IIS_Existence=NO
    set ops_Check_DriveExistence=YES
    goto ValidationBeforeExecution
)
if "%choice%"=="0" exit
echo Invalid choice: %choice%
echo.
pause
cls
goto start

:ValidationBeforeExecution
REM ---------------------------------------------------------------------
REM Validate before executing the rest of the installation process
REM ---------------------------------------------------------------------

REM -------------------------------------------
REM Check if IIS is running
REM -------------------------------------------
if "%ops_Check_IIS_Existence%"=="YES" (
    REM ERRORLEVEL values when using the following "sc query" statement...
    REM If IIS service exists and is running: 0
    REM If IIS service exists and is stopped: 1
    REM If IIS service does not exist       : 1

    echo.
    echo.
    echo --Checking if IIS Web Server is running on this machine...
    echo.

    sc query W3SVC | find "RUNNING"
    if "%ERRORLEVEL%"=="0" (
        echo.
        echo **********************************************************
        echo **  ERROR:
        echo **  You have choosen to install Portal on a machine where
        echo **  IIS Web Server is also running. Please stop the IIS service
        echo **  ^(i.e. World Wide Web Publishing Service^) and set the startup
        echo **  type to "Manual", or uninstall IIS Web Server.
        echo **  Exiting InstallOpsServer.bat.
        echo **********************************************************
        echo.
        goto end
    )
    echo  IIS Web Server is not running or is not installed.
    echo.

)

REM -------------------------------------------
REM Check drives specified in cache and data
REM drive variables exist.
REM -------------------------------------------
if "%ops_Check_DriveExistence%"=="YES" (

    REM More info about using 'EXIST' command to determine drive
    REM existance can be found at: http://support.microsoft.com/kb/65994.
    REM An alternate choice to determine drive existance is to use:
    REM WMIC logicaldisk get name | find /I "%ops_cacheDrive%:"
    REM Then check immediately afterward if "%ERRORLEVEL%"=="1",
    REM which means drive letter does not exist.

    echo.
    echo --Checking if specified cache drive '%ops_cacheDrive%' exists...

    if not exist %ops_cacheDrive%:\NUL (
        echo.
        echo **********************************************************
        echo **  ERROR:
        echo **  The cache drive you have specified '%ops_cacheDrive%'
        echo **  does not exist. Either the 'ops_cacheDrive' variable in
        echo **  the InstallOpsServer.bat file is set to an incorrect
        echo **  drive letter or the drive is not mounted.
        echo **  Exiting InstallOpsServer.bat.
        echo **********************************************************
        echo.
        goto end
    ) else (
        echo Cache drive '%ops_cacheDrive%' exists.
    )

    echo.
    echo --Checking if specified data drive '%ops_dataDrive%' exists...

    if not exist %ops_dataDrive%:\NUL (
        echo.
        echo **********************************************************
        echo **  ERROR:
        echo **  The data drive you have specified '%ops_dataDrive%'
        echo **  does not exist. Either the 'ops_dataDrive' variable in
        echo **  the InstallOpsServer.bat file is set to an incorrect
        echo **  drive letter or the drive is not mounted.
        echo **  Exiting InstallOpsServer.bat.
        echo **********************************************************
        echo.
        goto end
    ) else (
        echo Data drive '%ops_dataDrive%' exists.
    )

)

if "%opsServerInstallType%"=="Install" goto Install

:Install
REM ---------------------------------------------------------------------
REM Install Software
REM ---------------------------------------------------------------------
echo.
echo Installation of Ops Server starting...
date /T
time /T
echo.

REM Install Java JDK 1.7
if "%ops_install_jdk1_7%"=="YES" (
    echo.
    echo %sectionBreak%
    echo Install Java JDK 1.7...
    echo.
    echo --Installing...
    echo.
    %ops_softwareRoot%\JavaJDK\jdk-7u7-windows-x64.exe /s
    PING 127.0.0.1 -n 60 > nul
)

REM Install Java JDK 1.6
if "%ops_install_jdk1_6%"=="YES" (
    echo.
    echo %sectionBreak%
    echo Install Java JDK 1.6...
    echo.
    echo --Installing...
    echo.
    %ops_softwareRoot%\JavaJDK\jdk-6u38-windows-x64.exe /s
    PING 127.0.0.1 -n 60 > nul
)

REM Install RDBMS
if "%ops_install_rdbms%"=="YES" (
    Call %~dp0PostgreSQL\InstallPostgreSQL.bat
)

REM Install ArcGIS Server
if "%ops_install_server%"=="YES" (
    Call %~dp0ArcGISServer\InstallArcGISServer.bat
)

REM Create ArcGIS Server site and data stores
if "%ops_create_ags_site%"=="YES" (
    Call %~dp0ArcGISServer\CreateArcGISServerSite.bat
)

REM Install ArcGIS GeoEvent Processor Extension for ArcGIS Server
if "%ops_install_geoevent%"=="YES" (
    Call %~dp0GeoEvent\InstallGeoEvent.bat
)

REM Install Web Adaptor
if "%ops_install_webadaptor%"=="YES" (
    Call %~dp0WebAdaptorIIS\InstallWebAdaptor.bat
)

REM Change ArcGIS security config to "HTTPS Only"
if "%ops_change_ags_security%"=="YES" (
    Call %~dp0ArcGISServer\SupportFiles\ChangeAGSSecurityConfig.bat
)

REM Register ArcGIS Server with the web adaptor as HTTPS
if "%ops_register_ags_https%"=="YES" (
    Call %~dp0WebAdaptorIIS\RegisterAGSwithWebAdaptorHTTPS.bat
)

REM Install Portal Related Software
if "%ops_install_portal%"=="YES" (
    Call %~dp0Portal\InstallPortal.bat
)

REM Create Operations Dashboard ClickOnce Application and deploy to portal folders
if "%ops_create_opsdashboard_installer%"=="YES" (
    Call %~dp0OpsDashboardUtility\CreateOneClickInstaller.bat
)

REM Create the portal primary administrator account
if "%ops_create_portal_admin_account%"=="YES" (
    Call %~dp0Portal\Portal\CreatePortalAdminAccount.bat
)

REM Register portal with the webadaptor
if "%ops_register_portal%"=="YES" (
    Call %~dp0WebAdaptorIIS\RegisterPortalwithWebAdaptor.bat
)

REM Federate ArcGIS Server site with portal, set hosted server,
REM set SSL properties, and reset Utility service URLs
if "%ops_federate_ags%"=="YES" (
    Call %~dp0ArcGISServer\SupportFiles\FederateAGS.bat
)

REM Configure GeoEvent Processor Extension for ArcGIS Server
if "%ops_configure_geoevent%"=="YES" (
    Call %~dp0GeoEvent\SupportFiles\ConfigureGeoEvent.bat
)

goto end

:end
REM ---------------------------------------------------------------------
REM End Block
REM ---------------------------------------------------------------------
echo.
echo.
echo %sectionBreak%
echo Clean Up...

REM ------------------------------------------
REM Remove temp install folder
REM ------------------------------------------
echo.
echo Removing temp OpsServer install folder if exists...

IF EXIST %ops_tempInstallDir% (
 rmdir /S /Q %ops_tempInstallDir%
)
echo.
echo.
echo Execution of InstallOpsServer.bat script completed.
date /T
time /T
echo.
pause
REM exit

@echo off
title Operations Server Installer

REM ---------------------------------------------------------------------
REM Set user specified variables
REM ---------------------------------------------------------------------
Call InstallSettings.bat

REM ---------------------------------------------------------------------
REM Set other variables
REM ---------------------------------------------------------------------
set ops_AGSVersion=10.2
set ops_PortalVersion=10.2

REM Define PostgreSQL paths
set ops_postgresqlInstallDIR="C:\Program Files\PostgreSQL\9.2"
set ops_postgresqlDataDIR=%ops_postgresqlInstallDIR%\data

REM Define path to Esri SoftwareAuthorization.exe
set ops_softwareAuthExePath="C:\Program Files\Common Files\ArcGIS\bin\SoftwareAuthorization.exe"

REM Define path to ConfigureWebAdaptor.exe
set ops_ConfWebAdaptorExePath="C:\Program Files (x86)\Common Files\ArcGIS\WebAdaptor\IIS\Tools\ConfigureWebAdaptor.exe"

set sectionBreak=========================================================================
set ops_tempInstallDir=C:\OpsServerInstallTemp
cls

REM ---------------------------------------------------------------------
REM Check if command prompt is running in elevated permissions mode
REM (i.e. "run as administrator)
REM ---------------------------------------------------------------------
echo.
echo --Checking if Windows Command window is running as administrator
echo   by querying LOCAL SERVICE user registry entries...
echo.
reg query HKU\S-1-5-19
if "%ERRORLEVEL%"=="1" (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  You are _NOT_ running Windows Command window
    echo **  in elevated administrator mode ^(i.e., the CMD.exe
    echo **  must be "Run as administrator"^).
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

REM ---------------------------------------------------------------------
REM Check if user "installed" configuration script in correct location
REM ---------------------------------------------------------------------
echo.
echo --Checking if installation scripts are installed in the correct location...

set ops_ScriptRootName=ops-server-config
set ops_ScriptRoot=C:\%ops_ScriptRootName%\

echo %~dp0 | find /I "%ops_ScriptRoot%"

if "%ERRORLEVEL%"=="1" (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  The '%ops_ScriptRootName%' folder is not installed in
    echo **  the correct location. It should be located at:
    echo **  %ops_ScriptRoot%
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

REM ---------------------------------------------------------------------
REM Check if Software Root path exists and you have access to the folder
REM ---------------------------------------------------------------------

echo.
echo --Checking if specified software root path '%ops_softwareRoot%' exists...

if not exist %ops_softwareRoot% (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  The software root path ^(variable 'ops_softwareRoot'^)
    echo **  '%ops_softwareRoot%'
    echo **  you have specified does not exist or your account does
    echo **  not have access to this location.
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

echo.
echo --Checking if you have access to the software root path '%ops_softwareRoot%'...

dir %ops_softwareRoot%
if "%ERRORLEVEL%"=="1" (
    echo.
    echo **********************************************************
    echo **  ERROR:
    echo **  Your account does not have access to the sofware root
    echo **  folder path '%ops_ScriptRoot%'
    echo **  Exiting InstallOpsServer.bat.
    echo **********************************************************
    echo.
    goto end
)
cls

:start
REM ---------------------------------------------------------------------
REM Start Block
REM ---------------------------------------------------------------------
echo *************************************************************************
echo *                    Operations Server Installation                     *
echo *************************************************************************
echo.
echo 1. Install
echo.
echo 0. Quit
echo.

set /p choice="Enter the number of your choice: "

if "%choice%"=="1" (
    set opsServerInstallType=Install
    REM was having problems with the IIS check on some systems;
    REM for now, set variable to "NO" so that it does not run
    REM the check. Not critical to run the check, since we do tell
    REM users that they have to uninstall IIS if it is already installed.
    set ops_Check_IIS_Existence=NO
    set ops_Check_DriveExistence=YES
    goto ValidationBeforeExecution
)
if "%choice%"=="0" exit
echo Invalid choice: %choice%
echo.
pause
cls
goto start

:ValidationBeforeExecution
REM ---------------------------------------------------------------------
REM Validate before executing the rest of the installation process
REM ---------------------------------------------------------------------

REM -------------------------------------------
REM Check if IIS is running
REM -------------------------------------------
if "%ops_Check_IIS_Existence%"=="YES" (
    REM ERRORLEVEL values when using the following "sc query" statement...
    REM If IIS service exists and is running: 0
    REM If IIS service exists and is stopped: 1
    REM If IIS service does not exist       : 1

    echo.
    echo.
    echo --Checking if IIS Web Server is running on this machine...
    echo.

    sc query W3SVC | find "RUNNING"
    if "%ERRORLEVEL%"=="0" (
        echo.
        echo **********************************************************
        echo **  ERROR:
        echo **  You have choosen to install Portal on a machine where
        echo **  IIS Web Server is also running. Please stop the IIS service
        echo **  ^(i.e. World Wide Web Publishing Service^) and set the startup
        echo **  type to "Manual", or uninstall IIS Web Server.
        echo **  Exiting InstallOpsServer.bat.
        echo **********************************************************
        echo.
        goto end
    )
    echo  IIS Web Server is not running or is not installed.
    echo.

)

REM -------------------------------------------
REM Check drives specified in cache and data
REM drive variables exist.
REM -------------------------------------------
if "%ops_Check_DriveExistence%"=="YES" (

    REM More info about using 'EXIST' command to determine drive
    REM existance can be found at: http://support.microsoft.com/kb/65994.
    REM An alternate choice to determine drive existance is to use:
    REM WMIC logicaldisk get name | find /I "%ops_cacheDrive%:"
    REM Then check immediately afterward if "%ERRORLEVEL%"=="1",
    REM which means drive letter does not exist.

    echo.
    echo --Checking if specified cache drive '%ops_cacheDrive%' exists...

    if not exist %ops_cacheDrive%:\NUL (
        echo.
        echo **********************************************************
        echo **  ERROR:
        echo **  The cache drive you have specified '%ops_cacheDrive%'
        echo **  does not exist. Either the 'ops_cacheDrive' variable in
        echo **  the InstallOpsServer.bat file is set to an incorrect
        echo **  drive letter or the drive is not mounted.
        echo **  Exiting InstallOpsServer.bat.
        echo **********************************************************
        echo.
        goto end
    ) else (
        echo Cache drive '%ops_cacheDrive%' exists.
    )

    echo.
    echo --Checking if specified data drive '%ops_dataDrive%' exists...

    if not exist %ops_dataDrive%:\NUL (
        echo.
        echo **********************************************************
        echo **  ERROR:
        echo **  The data drive you have specified '%ops_dataDrive%'
        echo **  does not exist. Either the 'ops_dataDrive' variable in
        echo **  the InstallOpsServer.bat file is set to an incorrect
        echo **  drive letter or the drive is not mounted.
        echo **  Exiting InstallOpsServer.bat.
        echo **********************************************************
        echo.
        goto end
    ) else (
        echo Data drive '%ops_dataDrive%' exists.
    )

)

if "%opsServerInstallType%"=="Install" goto Install

:Install
REM ---------------------------------------------------------------------
REM Install Software
REM ---------------------------------------------------------------------
echo.
echo Installation of Ops Server starting...
date /T
time /T
echo.

REM Install Java JDK 1.7
if "%ops_install_jdk1_7%"=="YES" (
    echo.
    echo %sectionBreak%
    echo Install Java JDK 1.7...
    echo.
    echo --Installing...
    echo.
    %ops_softwareRoot%\JavaJDK\jdk-7u7-windows-x64.exe /s
    PING 127.0.0.1 -n 60 > nul
)

REM Install Java JDK 1.6
if "%ops_install_jdk1_6%"=="YES" (
    echo.
    echo %sectionBreak%
    echo Install Java JDK 1.6...
    echo.
    echo --Installing...
    echo.
    %ops_softwareRoot%\JavaJDK\jdk-6u38-windows-x64.exe /s
    PING 127.0.0.1 -n 60 > nul
)

REM Install RDBMS
if "%ops_install_rdbms%"=="YES" (
    Call %~dp0PostgreSQL\InstallPostgreSQL.bat
)

REM Install ArcGIS Server
if "%ops_install_server%"=="YES" (
    Call %~dp0ArcGISServer\InstallArcGISServer.bat
)

REM Create ArcGIS Server site and data stores
if "%ops_create_ags_site%"=="YES" (
    Call %~dp0ArcGISServer\CreateArcGISServerSite.bat
)

REM Install ArcGIS GeoEvent Processor Extension for ArcGIS Server
if "%ops_install_geoevent%"=="YES" (
    Call %~dp0GeoEvent\InstallGeoEvent.bat
)

REM Install Web Adaptor
if "%ops_install_webadaptor%"=="YES" (
    Call %~dp0WebAdaptorIIS\InstallWebAdaptor.bat
)

REM Change ArcGIS security config to "HTTPS Only"
if "%ops_change_ags_security%"=="YES" (
    Call %~dp0ArcGISServer\SupportFiles\ChangeAGSSecurityConfig.bat
)

REM Register ArcGIS Server with the web adaptor as HTTPS
if "%ops_register_ags_https%"=="YES" (
    Call %~dp0WebAdaptorIIS\RegisterAGSwithWebAdaptorHTTPS.bat
)

REM Install Portal Related Software
if "%ops_install_portal%"=="YES" (
    Call %~dp0Portal\InstallPortal.bat
)

REM Create Operations Dashboard ClickOnce Application and deploy to portal folders
if "%ops_create_opsdashboard_installer%"=="YES" (
    Call %~dp0OpsDashboardUtility\CreateOneClickInstaller.bat
)

REM Create the portal primary administrator account
if "%ops_create_portal_admin_account%"=="YES" (
    Call %~dp0Portal\Portal\CreatePortalAdminAccount.bat
)

REM Register portal with the webadaptor
if "%ops_register_portal%"=="YES" (
    Call %~dp0WebAdaptorIIS\RegisterPortalwithWebAdaptor.bat
)

REM Federate ArcGIS Server site with portal, set hosted server,
REM set SSL properties, and reset Utility service URLs
if "%ops_federate_ags%"=="YES" (
    Call %~dp0ArcGISServer\SupportFiles\FederateAGS.bat
)

REM Configure GeoEvent Processor Extension for ArcGIS Server
if "%ops_configure_geoevent%"=="YES" (
    Call %~dp0GeoEvent\SupportFiles\ConfigureGeoEvent.bat
)

goto end

:end
REM ---------------------------------------------------------------------
REM End Block
REM ---------------------------------------------------------------------
echo.
echo.
echo %sectionBreak%
echo Clean Up...

REM ------------------------------------------
REM Remove temp install folder
REM ------------------------------------------
echo.
echo Removing temp OpsServer install folder if exists...

IF EXIST %ops_tempInstallDir% (
 rmdir /S /Q %ops_tempInstallDir%
)
echo.
echo.
echo Execution of InstallOpsServer.bat script completed.
date /T
time /T
echo.
pause
REM exit

Fix to issue #107

Fix to issue #107


set STEAM_NAME=steam username
set BL_NAME=backloggery username
set BL_PASS=backloggery password
set EDITOR=notepad

java -jar bltool.jar --steam-name "%STEAM_NAME%" --bl-name "%BL_NAME%" --bl-pass "%BL_PASS" --filter --from steam --to text --output games.txt
%EDITOR% games.txt
java -jar bltool.jar --bl-name "%BL_NAME%" --bl-pass "%BL_PASS" --from text --to edn --input games.txt --output games.edn

set STEAM_NAME=steam username
set BL_NAME=backloggery username
set BL_PASS=backloggery password
set EDITOR=notepad

java -jar bltool.jar --steam-name "%STEAM_NAME%" --bl-name "%BL_NAME%" --bl-pass "%BL_PASS%" --filter --from steam --to text --output games.txt
%EDITOR% games.txt
java -jar bltool.jar --bl-name "%BL_NAME%" --bl-pass "%BL_PASS%" --from text --to edn --input games.txt --output games.edn

Fix password not getting passed in steam2backloggery.bat

The `BL_PASS` variable was missing the last `%`


REM Run from project root. E.g.:
REM   bin\web-server
call nano -p 80 -h 0.0.0.0

Add shortcut to start nano web server.

Add shortcut to start nano web server.


@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl6 "%~dp0\%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl6 "%~dp0\%0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
__END__
:endofperl

@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl6 "%~dp0\%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl6 "%~dp0\%~n0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
__END__
:endofperl

Make .bat file work with powershell as well as cmd courtesy of panda.bat. retupmoca++


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

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

REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%2] NEQ [] (SET release=%2)
IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment="))

REM Get the "is continuous integration" from the parameters
SET "isci=0"
IF [%1] NEQ [] (SET isci=1)

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

ECHO.
ECHO Building Umbraco %version%
ECHO.

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

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

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

ECHO.
ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd

REM Adding the default Git path so that if it's installed it can actually be found
REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git,
REM but the path setting is lost due to SETLOCAL
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%

ECHO.
ECHO Making sure we have a web.config
IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config

ECHO.
ECHO Restoring NuGet packages
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe restore ..\src\Umbraco.Core\project.json -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe restore ..\src\umbraco.datalayer\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe restore ..\src\Umbraco.Web\project.json -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe restore ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet

ECHO.
ECHO Performing MSBuild and producing Umbraco binaries zip files
ECHO This takes a few minutes and logging is set to report warnings
ECHO and errors only so it might seems like nothing is happening for a while.
ECHO You can check the msbuild.log file for progress.
ECHO.
"%ProgramFiles(x86)%"\MSBuild\14.0\Bin\MSBuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger
IF ERRORLEVEL 1 GOTO :error

ECHO.
ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules

ECHO.
ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform

ECHO.
ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet
IF ERRORLEVEL 1 GOTO :error

:success
ECHO.
ECHO No errors were detected!
ECHO There may still be some in the output, which you would need to investigate.
ECHO Warnings are usually normal.
GOTO :EOF

:error

ECHO.
ECHO. Errors were detected!

REM don't pause if continuous integration else the build server waits forever
REM before cancelling the build (and, there is noone to read the output anyways)
IF isci NEQ 1 PAUSE

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

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

REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%2] NEQ [] (SET release=%2)
IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment="))

REM Get the "is continuous integration" from the parameters
SET "isci=0"
IF [%1] NEQ [] (SET isci=1)

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

ECHO.
ECHO Building Umbraco %version%
ECHO.

SET MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe"
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%

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

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

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

ECHO.
ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd

REM Adding the default Git path so that if it's installed it can actually be found
REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git,
REM but the path setting is lost due to SETLOCAL
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%

ECHO.
ECHO Making sure we have a web.config
IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config

ECHO.
ECHO Restoring NuGet packages
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe restore ..\src\Umbraco.Core\project.json -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe restore ..\src\umbraco.datalayer\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe restore ..\src\Umbraco.Web\project.json -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe restore ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet

ECHO.
ECHO Performing MSBuild and producing Umbraco binaries zip files
ECHO This takes a few minutes and logging is set to report warnings
ECHO and errors only so it might seems like nothing is happening for a while.
ECHO You can check the msbuild.log file for progress.
ECHO.
%MSBUILD% "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger
IF ERRORLEVEL 1 GOTO :error

ECHO.
ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules

ECHO.
ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform

ECHO.
ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet
IF ERRORLEVEL 1 GOTO :error

:success
ECHO.
ECHO No errors were detected!
ECHO There may still be some in the output, which you would need to investigate.
ECHO Warnings are usually normal.
ECHO.
ECHO.
GOTO :EOF

:error

ECHO.
ECHO. Errors were detected!
ECHO.

REM don't pause if continuous integration else the build server waits forever
REM before cancelling the build (and, there is noone to read the output anyways)
IF isci NEQ 1 PAUSE

Build - cleanup build.bat

Build - cleanup build.bat


call config.bat
rackup -p 80 -s webrick config.ru BITLY_USER=%BITLY_USER% BITLY_KEY=%BITLY_KEY% OAUTH_KEY=%OAUTH_KEY% OAUTH_SECRET=%OAUTH_SECRET% SERVER_HOST=%SERVER_HOST%

add config for windows

add config for windows


REM This script has not yet been tested on a windows environment.

@echo off
if exist config.json (
    python3 eventbot.py
) else (
    echo "{" > config.json
    echo "    \"token\": \"insert here\"," >> config.json
    echo "" >> config.json
    echo "    \"sql:\": {" >> config.json
    echo "        \"host\": \"localhost\"," >> config.json
    echo "        \"user\": \"username\"," >> config.json
    echo "        \"pass\": \"password\"" >> config.json
    echo "    }" >> config.json
    echo "}" >> config.json

    echo "config.json generated! Please modify it before running."
)

@echo off
REM This script has not yet been tested on a windows environment.

if exist config.json (
    python3 eventbot.py
) else (
    echo "{" > config.json
    echo "    \"token\": \"insert here\"," >> config.json
    echo "" >> config.json
    echo "    \"sql:\": {" >> config.json
    echo "        \"host\": \"localhost\"," >> config.json
    echo "        \"user\": \"username\"," >> config.json
    echo "        \"pass\": \"password\"" >> config.json
    echo "    }" >> config.json
    echo "}" >> config.json

    echo "config.json generated! Please modify it before running."
)

start.bat: put comment after echo off (not sure if this matters?)


@rem Utility script to call patchxml with the given arguments
@echo off
IF DEFINED JAVA_HOME (
%JAVA_HOME%\bin\java.exe -cp "%~dp0\lib\diffxml.jar" org.diffxml.patchxml.PatchXML %*
) ELSE (
java -cp "%~dp0\lib\diffxml.jar" org.diffxml.patchxml.PatchXML %*
)

@rem Utility script to call patchxml with the given arguments
@echo off
IF DEFINED JAVA_HOME (
"%JAVA_HOME%\bin\java.exe" -cp "%~dp0\lib\diffxml.jar" org.diffxml.patchxml.PatchXML %*
) ELSE (
java -cp "%~dp0\lib\diffxml.jar" org.diffxml.patchxml.PatchXML %*
)

Allow spaces in JAVA_HOME

Allow spaces in JAVA_HOME


@echo off

:: This script will create a packaged version of the app in firmware_flasher in your home folder.
:: After executing this script, use NSIS to create an installer from the firmware_flasher.win32.nsi file located there.
:: You may need to run npm install electron-packager --global once before this will work correctly.

set PLATFORM=win32
set ARCH=ia32
set OUTPUT_DIR=%userprofile%\firmware_flasher
set PACKAGE_DIR="%OUTPUT_DIR%\QMK Firmware Flasher-%PLATFORM%-%ARCH%"

call npm install

rmdir %PACKAGE_DIR% /S /Q

call node package.js

copy QMK_Firmware_Flasher.wxs %PACKAGE_DIR%

copy WixDifxAppExtension.dll %PACKAGE_DIR%
copy difxapp_x86.wixlib %PACKAGE_DIR%
copy difxapp_x64.wixlib %PACKAGE_DIR%

copy build\windows.ico %PACKAGE_DIR%

cd %PACKAGE_DIR%

call candle -ext WixDifxAppExtension.dll QMK_Firmware_Flasher.wxs

if errorlevel 1 GOTO end

call light -ext WixDifxAppExtension.dll -ext WixUIExtension difxapp_x86.wixlib QMK_Firmware_Flasher.wixobj -o QMK_Firmware_Flasher_32-bit.msi

call light -ext WixDifxAppExtension.dll -ext WixUIExtension difxapp_x64.wixlib QMK_Firmware_Flasher.wixobj -o QMK_Firmware_Flasher_64-bit.msi

:end
copy *.msi ..
cd %~dp0

@echo off

:: This script will create a packaged version of the app in firmware_flasher in your home folder.
:: After executing this script, use NSIS to create an installer from the firmware_flasher.win32.nsi file located there.
:: You may need to run npm install electron-packager --global once before this will work correctly.

set PLATFORM=win32
set ARCH=ia32
set OUTPUT_DIR=%userprofile%\firmware_flasher
set PACKAGE_DIR="%OUTPUT_DIR%\QMK Firmware Flasher-%PLATFORM%-%ARCH%"

call npm install

rmdir %PACKAGE_DIR% /S /Q
del %OUTPUT_DIR%\*.msi

call node package.js

copy QMK_Firmware_Flasher.wxs %PACKAGE_DIR%

copy WixDifxAppExtension.dll %PACKAGE_DIR%
copy difxapp_x86.wixlib %PACKAGE_DIR%
copy difxapp_x64.wixlib %PACKAGE_DIR%

copy build\windows.ico %PACKAGE_DIR%

cd %PACKAGE_DIR%

call candle -ext WixDifxAppExtension.dll QMK_Firmware_Flasher.wxs

if errorlevel 1 GOTO end

call light -ext WixDifxAppExtension.dll -ext WixUIExtension difxapp_x86.wixlib QMK_Firmware_Flasher.wixobj -o QMK_Firmware_Flasher_32-bit.msi

call light -ext WixDifxAppExtension.dll -ext WixUIExtension difxapp_x64.wixlib QMK_Firmware_Flasher.wixobj -o QMK_Firmware_Flasher_64-bit.msi

:end
copy *.msi ..
cd %~dp0

Delete old msi files before building

Delete old msi files before building


goto :start
Copyright (C) 2017 Google Inc.

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.

Windows Build Script.

:start
set BUILD_ROOT=%cd%
set SRC=%cd%\github\agi

REM Install WiX (https://wixtoolset.org/, used in package.bat to create ".msi")
mkdir wix
cd wix
wget -q https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
REM Using 'set /p' prints without CRLF newline characters, which sha256sum can't handle.
REM If sha256sum fails, 'exit /b 1' will terminate batch with error code 1.
echo | set /p dummy="2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e wix311-binaries.zip" | sha256sum --check || exit /b 1
unzip -q wix311-binaries.zip
set WIX=%cd%
cd ..

REM Use a fixed JDK.
set JAVA_HOME=c:\Program Files\Java\jdk1.8.0_152

REM Install the Android SDK components and NDK.
set ANDROID_HOME=c:\Android\android-sdk

REM Install a license file for the Android SDK to avoid license query.
REM This file might need to be updated in the future.
copy /Y "%SRC%\kokoro\windows\android-sdk-license" "%ANDROID_HOME%\licenses\"

REM Install Android SDK platform, build tools and NDK
setlocal
call %ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-26 build-tools;30.0.3
endlocal
echo on

wget -q https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip
unzip -q android-ndk-r21d-windows-x86_64.zip
set ANDROID_NDK_HOME=%CD%\android-ndk-r21d

REM Download and install MSYS2, because the pre-installed version is too old.
REM Do NOT do a system update (pacman -Syu) because it is a moving target.
wget -q http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20210228.sfx.exe
.\msys2-base-x86_64-20210228.sfx.exe -y -o%BUILD_ROOT%\

REM Start empty shell to initialize MSYS2.
%BUILD_ROOT%\msys64\usr\bin\bash --login -c " "

REM Uncomment the following line to list all packages and versions installed in MSYS2.
REM %BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -Q"

REM Install packages required by the build process.
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -S --noconfirm git patch zip unzip"

REM Download and install specific compiler version.
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-9-any.pkg.tar.zst
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-9-any.pkg.tar.zst
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.37-4-any.pkg.tar.zst
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -U --noconfirm /t/src/mingw-w64-x86_64-gcc-10.2.0-9-any.pkg.tar.zst /t/src/mingw-w64-x86_64-gcc-libs-10.2.0-9-any.pkg.tar.zst /t/src/mingw-w64-x86_64-binutils-2.37-4-any.pkg.tar.zst"

REM Configure build process to use the now installed MSYS2.
set PATH=%BUILD_ROOT%\msys64\mingw64\bin;%BUILD_ROOT%\msys64\usr\bin;%PATH%
set BAZEL_SH=%BUILD_ROOT%\msys64\usr\bin\bash

REM Get the JDK from our mirror.
set JDK_BUILD=zulu11.39.15-ca
set JDK_VERSION=11.0.7
set JDK_NAME=%JDK_BUILD%-jdk%JDK_VERSION%-win_x64
set JRE_NAME=%JDK_BUILD%-jre%JDK_VERSION%-win_x64
wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JDK_NAME%.zip
echo | set /p dummy="1d947cb3a846d87aca12d4ae94e1b51e1079fdcd9e4faea9684909b8072f8ed4 %JDK_NAME%.zip" | sha256sum --check || exit /b 1
unzip -q %JDK_NAME%.zip
set JAVA_HOME=%CD%\%JDK_NAME%

wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JRE_NAME%.zip
echo | set /p dummy="339f622f688b129de16876ce8ee252eac0ab7663d81596016abf2efacab01d86 %JRE_NAME%.zip" | sha256sum --check || exit /b 1
unzip -q %JRE_NAME%.zip
set JRE_HOME=%CD%\%JRE_NAME%

REM Install Bazel.
set BAZEL_VERSION=4.2.0
wget -q https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.zip
echo | set /p dummy="56c29f850677a7aaf9b59cbd762d0d41d9f9e158bf96c5b6022af123fd52db7f bazel-%BAZEL_VERSION%-windows-x86_64.zip" | sha256sum --check || exit /b 1
unzip -q bazel-%BAZEL_VERSION%-windows-x86_64.zip
set PATH=C:\python35;%PATH%

cd %SRC%

REM Invoke the build.
echo %DATE% %TIME%
if "%KOKORO_GITHUB_COMMIT%." == "." (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_PULL_REQUEST_COMMIT%
) else (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_COMMIT%
)

REM Make Bazel operate under BUILD_ROOT (T:\src), where files are less
REM likely to be locked by system checks.
set BAZEL_OUTPUT_USER_ROOT=%BUILD_ROOT%\build
mkdir %BAZEL_OUTPUT_USER_ROOT%

REM Build in several steps in order to avoid running out of memory.

REM Build GAPIS api modules.
%BUILD_ROOT%\bazel ^
    --output_user_root=%BAZEL_OUTPUT_USER_ROOT% ^
    build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //gapis/api/vulkan:go_default_library
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

REM Build everything else.
%BUILD_ROOT%\bazel ^
    --output_user_root=%BAZEL_OUTPUT_USER_ROOT% ^
    build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //:pkg //:symbols //cmd/vulkan_sample:vulkan_sample //tools/logo:agi_ico
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Smoketests
%BUILD_ROOT%\bazel ^
    --output_user_root=%BAZEL_OUTPUT_USER_ROOT% ^
    run -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //cmd/smoketests -- --traces test/traces
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Build the release packages.
mkdir %BUILD_ROOT%\out
call %SRC%\kokoro\windows\package.bat %BUILD_ROOT%\out %SRC%

goto :start
Copyright (C) 2017 Google Inc.

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.

Windows Build Script.

:start
set BUILD_ROOT=%cd%
set SRC=%cd%\github\agi

REM Install WiX (https://wixtoolset.org/, used in package.bat to create ".msi")
mkdir wix
cd wix
wget -q https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
REM Using 'set /p' prints without CRLF newline characters, which sha256sum can't handle.
REM If sha256sum fails, 'exit /b 1' will terminate batch with error code 1.
echo | set /p dummy="2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e wix311-binaries.zip" | sha256sum --check || exit /b 1
unzip -q wix311-binaries.zip
set WIX=%cd%
cd ..

REM Use a fixed JDK.
set JAVA_HOME=c:\Program Files\Java\jdk1.8.0_152

REM Install the Android SDK components and NDK.
set ANDROID_HOME=c:\Android\android-sdk

REM Install a license file for the Android SDK to avoid license query.
REM This file might need to be updated in the future.
copy /Y "%SRC%\kokoro\windows\android-sdk-license" "%ANDROID_HOME%\licenses\"

REM Install Android SDK platform, build tools and NDK
setlocal
call %ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-26 build-tools;30.0.3
endlocal
echo on

wget -q https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip
unzip -q android-ndk-r21d-windows-x86_64.zip
set ANDROID_NDK_HOME=%CD%\android-ndk-r21d

REM Download and install MSYS2, because the pre-installed version is too old.
REM Do NOT do a system update (pacman -Syu) because it is a moving target.
wget -q http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20220128.sfx.exe
.\msys2-base-x86_64-20220128.sfx.exe -y -o%BUILD_ROOT%\

REM Start empty shell to initialize MSYS2.
%BUILD_ROOT%\msys64\usr\bin\bash --login -c " "

REM Uncomment the following line to list all packages and versions installed in MSYS2.
REM %BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -Q"

REM Install packages required by the build process.
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -S --noconfirm git patch zip unzip"

REM Download and install specific compiler version.
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-9-any.pkg.tar.zst
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-9-any.pkg.tar.zst
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.37-4-any.pkg.tar.zst
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -U --noconfirm /t/src/mingw-w64-x86_64-gcc-10.2.0-9-any.pkg.tar.zst /t/src/mingw-w64-x86_64-gcc-libs-10.2.0-9-any.pkg.tar.zst /t/src/mingw-w64-x86_64-binutils-2.37-4-any.pkg.tar.zst"

REM Configure build process to use the now installed MSYS2.
set PATH=%BUILD_ROOT%\msys64\mingw64\bin;%BUILD_ROOT%\msys64\usr\bin;%PATH%
set BAZEL_SH=%BUILD_ROOT%\msys64\usr\bin\bash

REM Get the JDK from our mirror.
set JDK_BUILD=zulu11.39.15-ca
set JDK_VERSION=11.0.7
set JDK_NAME=%JDK_BUILD%-jdk%JDK_VERSION%-win_x64
set JRE_NAME=%JDK_BUILD%-jre%JDK_VERSION%-win_x64
wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JDK_NAME%.zip
echo | set /p dummy="1d947cb3a846d87aca12d4ae94e1b51e1079fdcd9e4faea9684909b8072f8ed4 %JDK_NAME%.zip" | sha256sum --check || exit /b 1
unzip -q %JDK_NAME%.zip
set JAVA_HOME=%CD%\%JDK_NAME%

wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JRE_NAME%.zip
echo | set /p dummy="339f622f688b129de16876ce8ee252eac0ab7663d81596016abf2efacab01d86 %JRE_NAME%.zip" | sha256sum --check || exit /b 1
unzip -q %JRE_NAME%.zip
set JRE_HOME=%CD%\%JRE_NAME%

REM Install Bazel.
set BAZEL_VERSION=4.2.0
wget -q https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.zip
echo | set /p dummy="56c29f850677a7aaf9b59cbd762d0d41d9f9e158bf96c5b6022af123fd52db7f bazel-%BAZEL_VERSION%-windows-x86_64.zip" | sha256sum --check || exit /b 1
unzip -q bazel-%BAZEL_VERSION%-windows-x86_64.zip
set PATH=C:\python35;%PATH%

cd %SRC%

REM Invoke the build.
echo %DATE% %TIME%
if "%KOKORO_GITHUB_COMMIT%." == "." (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_PULL_REQUEST_COMMIT%
) else (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_COMMIT%
)

REM Make Bazel operate under BUILD_ROOT (T:\src), where files are less
REM likely to be locked by system checks.
set BAZEL_OUTPUT_USER_ROOT=%BUILD_ROOT%\build
mkdir %BAZEL_OUTPUT_USER_ROOT%

REM Build in several steps in order to avoid running out of memory.

REM Build GAPIS api modules.
%BUILD_ROOT%\bazel ^
    --output_user_root=%BAZEL_OUTPUT_USER_ROOT% ^
    build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //gapis/api/vulkan:go_default_library
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

REM Build everything else.
%BUILD_ROOT%\bazel ^
    --output_user_root=%BAZEL_OUTPUT_USER_ROOT% ^
    build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //:pkg //:symbols //cmd/vulkan_sample:vulkan_sample //tools/logo:agi_ico
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Smoketests
%BUILD_ROOT%\bazel ^
    --output_user_root=%BAZEL_OUTPUT_USER_ROOT% ^
    run -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //cmd/smoketests -- --traces test/traces
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Build the release packages.
mkdir %BUILD_ROOT%\out
call %SRC%\kokoro\windows\package.bat %BUILD_ROOT%\out %SRC%

Fix Windows build.

Fix Windows build.


@rem Copyright 2019 gRPC authors.
@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 TODO(jtattermusch): make this generate less output
@rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync
choco install bazel -y --version 3.7.1 --limit-output

cd github/grpc
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%

@rem Generate a random UUID and store in "bazel_invocation_ids" artifact file
powershell -Command "[guid]::NewGuid().ToString()" >%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
set /p BAZEL_INVOCATION_ID=<%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids

@rem TODO(jtattermusch): windows RBE should be able to use the same credentials as Linux RBE.
bazel --bazelrc=tools/remote_build/windows.bazelrc test --invocation_id="%BAZEL_INVOCATION_ID%" %BAZEL_FLAGS% --workspace_status_command=tools/remote_build/workspace_status_kokoro.bat //test/...
set BAZEL_EXITCODE=%errorlevel%

if not "%UPLOAD_TEST_RESULTS%"=="" (
  @rem Sleep to let ResultStore finish writing results before querying
  timeout /t 60 /nobreak
  python ./tools/run_tests/python_utils/upload_rbe_results.py
)

exit /b %BAZEL_EXITCODE%

@rem Copyright 2019 gRPC authors.
@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 TODO(jtattermusch): make this generate less output
@rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync
choco install bazel -y --version 3.7.1 --limit-output

cd github/grpc
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%

@rem Generate a random UUID and store in "bazel_invocation_ids" artifact file
powershell -Command "[guid]::NewGuid().ToString()" >%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
set /p BAZEL_INVOCATION_ID=<%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids

@rem TODO(jtattermusch): windows RBE should be able to use the same credentials as Linux RBE.
bazel --bazelrc=tools/remote_build/windows.bazelrc --output_user_root=T:\_bazel_output test --invocation_id="%BAZEL_INVOCATION_ID%" %BAZEL_FLAGS% --workspace_status_command=tools/remote_build/workspace_status_kokoro.bat //test/...
set BAZEL_EXITCODE=%errorlevel%

if not "%UPLOAD_TEST_RESULTS%"=="" (
  @rem Sleep to let ResultStore finish writing results before querying
  timeout /t 60 /nobreak
  python ./tools/run_tests/python_utils/upload_rbe_results.py
)

exit /b %BAZEL_EXITCODE%

Use T drive for windows bazel RBE build (#26899)


@echo CD=%CD%
@echo HOME=%HOME%
@echo LIB=%LIB%
@echo INCLUDE=%INCLUDE%
@echo PATH=%PATH%

REM use FOR to convert from linux path separators to windows path seps
for %%I in ("%BASE_DIR%") do set BUILD_ROOT=%%~dpfI

md
REM pcre blows up if the temp path has spaces in it, so make sure that it's a short path.
for %%I in ("%TEMP%") do set TMP=%%~sdpfI
set TEMP=%TMP%

for /D %%I in ("%VS90COMNTOOLS%..") do set VS90ROOT=%%~sdpI
set VS_DIR=%VS90ROOT:~0,-1%
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VS_DIR%\bin
set DOTNET_PATH=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PERL_PATH=c:\prereq\ActivePerl-5.10.1\bin;c:\perl\bin
set ZIP_PATH=%ProgramFiles%\7-Zip
set WIX_PATH=%WIX%
set MSCONFIG_TOOLS_DIR=%BUILD_ROOT%\msconfig
set CMAKE_BIN=%ProgramFiles%\CMake 2.8\bin

set PATH=%SystemRoot%\system32;%SystemRoot%;%PERL_PATH%;%MSCONFIG_TOOLS_DIR%;%VS_DIR%\Common7\IDE;%VC_BIN%;%CMAKE_BIN%;%ZIP_PATH%;%WIX_PATH%
@echo PATH=%PATH%

set INCLUDE=%BUILD_ROOT%\src\condor_utils
@echo INCLUDE=%INCLUDE%

@echo ----  build.win.bat ENVIRONMENT --------------------------------
set
@echo ----  end build.win.bat ENVIRONMENT ----------------------------

rem @echo devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
rem devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
devenv CONDOR.sln /Rebuild RelWithDebInfo

@echo CD=%CD%
@echo HOME=%HOME%
@echo LIB=%LIB%
@echo INCLUDE=%INCLUDE%
@echo PATH=%PATH%

REM use FOR to convert from linux path separators to windows path seps
for %%I in ("%BASE_DIR%") do set BUILD_ROOT=%%~dpfI

md %BUILD_ROOT%\Temp
REM pcre blows up if the temp path has spaces in it, so make sure that it's a short path.
set TEMP=%BUILD_ROOT%\Temp
set TMP=%BUILD_ROOT%\Temp

for /D %%I in ("%VS90COMNTOOLS%..") do set VS90ROOT=%%~sdpI
set VS_DIR=%VS90ROOT:~0,-1%
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VS_DIR%\bin
set DOTNET_PATH=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PERL_PATH=c:\prereq\ActivePerl-5.10.1\bin;c:\perl\bin
set ZIP_PATH=%ProgramFiles%\7-Zip
set WIX_PATH=%WIX%
set MSCONFIG_TOOLS_DIR=%BUILD_ROOT%\msconfig
set CMAKE_BIN=%ProgramFiles%\CMake 2.8\bin

set PATH=%SystemRoot%\system32;%SystemRoot%;%PERL_PATH%;%MSCONFIG_TOOLS_DIR%;%VS_DIR%\Common7\IDE;%VC_BIN%;%CMAKE_BIN%;%ZIP_PATH%;%WIX_PATH%
@echo PATH=%PATH%

set INCLUDE=%BUILD_ROOT%\src\condor_utils
@echo INCLUDE=%INCLUDE%

@echo ----  build.win.bat ENVIRONMENT --------------------------------
set
@echo ----  end build.win.bat ENVIRONMENT ----------------------------

rem @echo devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
rem devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
devenv CONDOR.sln /Rebuild RelWithDebInfo

set TEMP and TMP to the condor job working directory for NMI windows glue


@rem = ' vim: set filetype=perl: ';
@rem = ' --*-Perl-*-- ';
@rem = '
@echo off
setlocal
set PATH=%~dp0\perl\bin;%~dp0\bin;%PATH%
perl -w "%~f0" %*
exit /B %ERRORLEVEL%
';

# StorScore
#
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

use strict;
use warnings;

use Getopt::Long;
use File::Basename;
use English;

my $script_name = basename( $PROGRAM_NAME );
my $script_dir = dirname( $PROGRAM_NAME );

my $outfile;

GetOptions(
    "outfile=s" => \$outfile,
);

unless( defined $outfile )
{
    warn "usage: $script_name --outfile=FILE\n";
    exit(-1);
}

$outfile = "$script_dir\\$outfile";

sub my_exec
{
    my $cmd = shift;

    system( "echo TEST_BEGIN >> $outfile" );
    system( "echo $cmd >> $outfile" );

    system( "$cmd >> $outfile 2>&1" );

    system( "echo TEST_END >> $outfile" );
    system( "echo. >> $outfile" );
}

sub run_one
{
    my $args = shift;

    my $cargs;
    $cargs .= "--target=1234 ";
    $cargs .= "--pretend ";
    $cargs .= "--verbose ";
    $cargs .= "--noprompt ";

    # ISSUE-REVIEW:
    # Do --target_type=ssd and --target_type=hdd here instead of below?

    # run default recipe
    my_exec(
        "storscore.cmd $cargs $args"
    );

    # run corners
    my_exec(
        "storscore.cmd $cargs $args --recipe=recipes\\corners.rcp"
    );
}

unlink( $outfile );
chdir( ".." );

# Preserve existing results directory
rename( "results", "results.orig" );

run_one( "" );
run_one( "--this_flag_does_not_exist" );
run_one( "--noinitialize" );
run_one( "--noprecondition" );
run_one( "--target_type=ssd" );
run_one( "--target_type=hdd" );
run_one( "--raw_disk" );
run_one( "--active_range=50" );
run_one( "--partition_bytes=1000000000" );
run_one( "--test_id=regr" );
run_one( "--test_id_prefix=regr" );

# Restore original results directory
system( "rmdir /S /Q results >NUL 2>&1" );
rename( "results.orig", "results" );

# Post process output file to remove noise
rename( $outfile, "$outfile.orig" );

open( my $in, "<$outfile.orig" );
open( my $out, ">$outfile" );

while( my $line = <$in> )
{
    # Remove random temp file names
    $line =~ s/AppData\\\S*//;

    # Remove ETA info
    $line =~ s/\d{2}:\d{2}:\d{2} (AM|PM)//g;

    # Remove time from autogenerated results dir
    if( $line =~ /results/ )
    {
        $line =~ s/-\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}//;
    }

    # Remove "Done" line with overall runtime
    $line =~ s/^Done.*//;

    print $out $line;
}

close $in;
close $out;

unlink( "$outfile.orig" );

print "Done! Diff $outfile against another run.\n";

@rem = ' vim: set filetype=perl: ';
@rem = ' --*-Perl-*-- ';
@rem = '
@echo off
setlocal
set PATH=%~dp0\perl\bin;%~dp0\bin;%PATH%
perl -w "%~f0" %*
exit /B %ERRORLEVEL%
';

# StorScore
#
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

use strict;
use warnings;

use File::Basename;
use English;

my $script_name = basename( $PROGRAM_NAME );
my $script_dir = dirname( $PROGRAM_NAME );

unless( scalar @ARGV == 1 )
{
    warn "usage: $script_name OUTFILE\n";
    exit(-1);
}

my $outfile = "$script_dir\\$ARGV[0]";

sub my_exec
{
    my $cmd = shift;

    system( "echo TEST_BEGIN >> $outfile" );
    system( "echo $cmd >> $outfile" );

    system( "$cmd >> $outfile 2>&1" );

    system( "echo TEST_END >> $outfile" );
    system( "echo. >> $outfile" );
}

sub run_one
{
    my $args = shift;

    my $cargs;
    $cargs .= "--target=1234 ";
    $cargs .= "--pretend ";
    $cargs .= "--verbose ";
    $cargs .= "--noprompt ";

    # ISSUE-REVIEW:
    # Do --target_type=ssd and --target_type=hdd here instead of below?

    # run default recipe
    my_exec(
        "storscore.cmd $cargs $args"
    );

    # run corners
    my_exec(
        "storscore.cmd $cargs $args --recipe=recipes\\corners.rcp"
    );
}

unlink( $outfile );
chdir( ".." );

# Preserve existing results directory
rename( "results", "results.orig" );

run_one( "" );
run_one( "--this_flag_does_not_exist" );
run_one( "--noinitialize" );
run_one( "--noprecondition" );
run_one( "--target_type=ssd" );
run_one( "--target_type=hdd" );
run_one( "--raw_disk" );
run_one( "--active_range=50" );
run_one( "--partition_bytes=1000000000" );
run_one( "--test_id=regr" );
run_one( "--test_id_prefix=regr" );

# Restore original results directory
system( "rmdir /S /Q results >NUL 2>&1" );
rename( "results.orig", "results" );

# Post process output file to remove noise
rename( $outfile, "$outfile.orig" );

open( my $in, "<$outfile.orig" );
open( my $out, ">$outfile" );

while( my $line = <$in> )
{
    # Remove random temp file names
    $line =~ s/AppData\\\S*//;

    # Remove ETA info
    $line =~ s/\d{2}:\d{2}:\d{2} (AM|PM)//g;

    # Remove time from autogenerated results dir
    if( $line =~ /results/ )
    {
        $line =~ s/-\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}//;
    }

    # Remove "Done" line with overall runtime
    $line =~ s/^Done.*//;

    print $out $line;
}

close $in;
close $out;

unlink( "$outfile.orig" );

print "Done! Diff $outfile against another run.\n";

Simplify regr command line.

Simplify regr command line.