@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
# Set language
# Default to en_EN
set JVM_ARGS=-Duser.language="en" -Duser.region="EN"
rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set ADD_MODS=

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
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
IF "%variable:~0,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set ADD_MODS=--add-modules java.activation
)

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 -XX:MaxMetaspaceSize=256m

rem Uncomment this to generate GC verbose file with Java prior to 9
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 -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log

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 Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

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
set SERVER=-server

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

%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 Set language
rem Default to en_EN
set JVM_ARGS=-Duser.language="en" -Duser.region="EN"
rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set ADD_MODS=

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
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
IF "%variable:~0,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set ADD_MODS=--add-modules java.activation
)

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 -XX:MaxMetaspaceSize=256m

rem Uncomment this to generate GC verbose file with Java prior to 9
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 -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log

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 Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

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
set SERVER=-server

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

%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

Correct comments. On windows these are rem instead of #.

Bugzilla Id: 61970

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1822029 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: b57585af58d2763b2aaeb6f512a1586323d527b5


add mounta command

add mounta command


@echo off
setlocal
pushd %~dp0
cd ..
goto :start

:help
echo Usage: build [debug|release] [x64|x86] [nosync] [clean|noclean]
echo nosync - do not update the git submodules.
echo clean - only clean the build
echo noclean - do not clean the build, so do incemental build

goto :exit

:start
echo ============= Building P SDK on %COMPUTERNAME% ===============

set MSBuildPath=
for /F "usebackq tokens=1,2* delims= " %%i in (`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 -v MSBuildToolsPath`) do (
   if "%%i" == "MSBuildToolsPath" set MSBuildPath=%%k
)

if not "%MSBuildPath%"=="" goto :step2

echo MSBUILD 14.0 does not appear to be installed.
echo No info found in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0
goto :eof

:step2
set TAIL=%MSBuildPath:~-6%
if "[%TAIL%]" == "[amd64\]" set MSBuildPath=%MSBuildPath:~0,-6%"
set PATH=%PATH%;%MSBuildPath%
set Configuration=Debug
set Platform=x86
set NoSync=
set CleanOnly=
set NoClean=
set SubmoduleOutOfDate=false

:parseargs
if /I "%1"=="debug" set Configuration=Debug
if /I "%1"=="release" set Configuration=Release
if /I "%1"=="x86" set Platform=x86
if /I "%1"=="x64" set Platform=x64
if /I "%1"=="nosync" set NoSync=true
if /I "%1"=="clean" set CleanOnly=true
if /I "%1"=="noclean" set NoClean=true
if /I "%1"=="" goto :step2
if /I "%1"=="/?" goto :help
if /I "%1"=="/h" goto :help
if /I "%1"=="/help" goto :help
if /I "%1"=="help" goto :help
shift
goto :parseargs

:checksubmodule
for /f "usebackq tokens=1,2*" %%i in (`git submodule summary %1`) do (
  if "%%j"=="%1" echo #### Submodule is out of date: %1 & set SubmoduleOutOfDate=true
)

goto :eof

:step2

if "%NoSync%"=="true" goto :nosync

call :checksubmodule Ext/Formula
call :checksubmodule Ext/Zing

if "%SubmoduleOutOfDate%"=="false" goto :nosync

:sync
echo ### Fixing your submodules so they are up to date...
git submodule sync --recursive
git submodule update --init --recursive

:nosync
cd ext\zing

echo msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
if ERRORLEVEL 1 goto :exit

set BinaryDrop=..\..\Bld\Drops\%Configuration%\%Platform%\Binaries
if NOT exist %BinaryDrop% mkdir %BinaryDrop%

for %%i in (zc\bin\%Platform%\Release\zc.exe
             ZingExplorer\bin\%Platform%\Release\ZingExplorer.dll
             Zinger\bin\%Platform%\Release\Zinger.exe
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Zing.dll
             Microsoft.Zing.Runtime\bin\%Platform%\Release\Microsoft.Zing.Runtime.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.Runtime.dll
             Resources\external\CCI\System.Compiler.dll
             Resources\external\CCI\System.Compiler.Framework.dll
             Resources\external\CCI\System.Compiler.Runtime.dll
             DelayingSchedulers\CustomDelayingScheduler\bin\%Platform%\Release\CustomDelayingScheduler.dll
             DelayingSchedulers\RandomDelayingScheduler\bin\%Platform%\Release\RandomDelayingScheduler.dll
             DelayingSchedulers\RoundRobinDelayingScheduler\bin\%Platform%\Release\RoundRobinDelayingScheduler.dll
             DelayingSchedulers\RunToCompletionDelayingScheduler\bin\%Platform%\Release\RunToCompletionDelayingScheduler.dll
	     DelayingSchedulers\SealingScheduler\bin\%Platform%\Release\SealingScheduler.dll) do (

    copy %%i %BinaryDrop%
)

cd ..\..
REM this code fixes a problem in MIDL compile by forcing recompile of these files for each configuration.
del Src\PrtDist\Core\NodeManager_c.c
del Src\PrtDist\Core\NodeManager_s.c

if "%NoClean%"=="true" goto :build
echo msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration%
msbuild  P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /t:Clean

:build
if "%CleanOnly%"=="true" goto :exit
msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /p:SOLVER=NOSOLVER

:exit
popd

@echo off
setlocal
pushd %~dp0
cd ..
goto :start

:help
echo Usage: build [debug|release] [x64|x86] [nosync] [clean|noclean]
echo nosync - do not update the git submodules.
echo clean - only clean the build
echo noclean - do not clean the build, so do incemental build

goto :exit

:start
echo ============= Building P SDK on %COMPUTERNAME% ===============

set MSBuildPath=
for /F "usebackq tokens=1,2* delims= " %%i in (`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 -v MSBuildToolsPath`) do (
   if "%%i" == "MSBuildToolsPath" set MSBuildPath=%%k
)

if not "%MSBuildPath%"=="" goto :step2

echo MSBUILD 14.0 does not appear to be installed.
echo No info found in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0
goto :eof

:step2
set TAIL=%MSBuildPath:~-6%
if "[%TAIL%]" == "[amd64\]" set MSBuildPath=%MSBuildPath:~0,-6%"
set PATH=%PATH%;%MSBuildPath%
set Configuration=Debug
set Platform=x86
set NoSync=
set CleanOnly=
set NoClean=
set SubmoduleOutOfDate=false

:parseargs
if /I "%1"=="debug" set Configuration=Debug
if /I "%1"=="release" set Configuration=Release
if /I "%1"=="x86" set Platform=x86
if /I "%1"=="x64" set Platform=x64
if /I "%1"=="nosync" set NoSync=true
if /I "%1"=="clean" set CleanOnly=true
if /I "%1"=="noclean" set NoClean=true
if /I "%1"=="" goto :initsub
if /I "%1"=="/?" goto :help
if /I "%1"=="/h" goto :help
if /I "%1"=="/help" goto :help
if /I "%1"=="help" goto :help
shift
goto :parseargs

:initsub
if exist "Ext\Formula\README.md" goto :updatesub

echo ### Initializing your submodules
git submodule init
git submodule update

:checksubmodule
for /f "usebackq tokens=1,2*" %%i in (`git submodule summary %1`) do (
  if "%%j"=="%1" echo #### Submodule is out of date: %1 & set SubmoduleOutOfDate=true
)

goto :eof

:updatesub
if "%NoSync%"=="true" goto :nosync

echo ### Updating your submodules
call :checksubmodule Ext/Formula
call :checksubmodule Ext/Zing

if "%SubmoduleOutOfDate%"=="false" goto :nosync

:sync
echo ### Fixing your submodules so they are up to date...
git submodule sync --recursive
git submodule update --init --recursive
goto :nosync

:nosync
cd ext\zing

echo msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
if ERRORLEVEL 1 goto :exit

set BinaryDrop=..\..\Bld\Drops\%Configuration%\%Platform%\Binaries
if NOT exist %BinaryDrop% mkdir %BinaryDrop%

for %%i in (zc\bin\%Platform%\Release\zc.exe
             ZingExplorer\bin\%Platform%\Release\ZingExplorer.dll
             Zinger\bin\%Platform%\Release\Zinger.exe
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Zing.dll
             Microsoft.Zing.Runtime\bin\%Platform%\Release\Microsoft.Zing.Runtime.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.Runtime.dll
             Resources\external\CCI\System.Compiler.dll
             Resources\external\CCI\System.Compiler.Framework.dll
             Resources\external\CCI\System.Compiler.Runtime.dll
             DelayingSchedulers\CustomDelayingScheduler\bin\%Platform%\Release\CustomDelayingScheduler.dll
             DelayingSchedulers\RandomDelayingScheduler\bin\%Platform%\Release\RandomDelayingScheduler.dll
             DelayingSchedulers\RoundRobinDelayingScheduler\bin\%Platform%\Release\RoundRobinDelayingScheduler.dll
             DelayingSchedulers\RunToCompletionDelayingScheduler\bin\%Platform%\Release\RunToCompletionDelayingScheduler.dll
	     DelayingSchedulers\SealingScheduler\bin\%Platform%\Release\SealingScheduler.dll) do (

    copy %%i %BinaryDrop%
)

cd ..\..
REM this code fixes a problem in MIDL compile by forcing recompile of these files for each configuration.
del Src\PrtDist\Core\NodeManager_c.c
del Src\PrtDist\Core\NodeManager_s.c

if "%NoClean%"=="true" goto :build
echo msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration%
msbuild  P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /t:Clean

:build
if "%CleanOnly%"=="true" goto :exit
msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /p:SOLVER=NOSOLVER

:exit
popd

Fix inititial build after cloning repo.

Fix inititial build after cloning repo.


@ECHO OFF

SET BASEDIR=%~dp0..
SET USERINI=%BASEDIR%\user.ini
FOR /F "tokens=1,2 delims=:" %%a in ("%STEELTOE_PCF_CREDENTIALS%") do (
   set CF_USER=%%a
   set CF_PASS=%%b
)

SET PYTHON_HOME=C:\Python36
SET DOTNET_HOME=C:\Program Files\dotnet
SET JAVA_HOME=C:\opt\oracle-jdk-8
SET GIT_HOME=C:\Program Files\Git
SET MAVEN_HOME=C:\opt\apache-maven-3.3.9
SET CF_HOME=C:\ProgramData\chocolatey\bin
SET TEST_OUT=C:\st\%~nx1

ECHO [behave.userdata] > %USERINI%
ECHO cf_apiurl = api.run.pcfbeta.io >> %USERINI%
ECHO cf_org = STEELTOE >> %USERINI%
ECHO cf_username = %CF_USER% >> %USERINI%
ECHO cf_password = %CF_PASS% >> %USERINI%
ECHO cf_max_attempts = 250 >> %USERINI%
ECHO output = %TEST_OUT% >> %USERINI%

SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\Scripts;%DOTNET_HOME%;%CF_HOME%;%JAVA_HOME%\bin;%GIT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
PATH

RMDIR /S /Q %TEST_OUT%
REM CALL %BASEDIR%\test-setup
REM CALL %BASEDIR%\test-run %*
behave %*

@ECHO OFF

SET BASEDIR=%~dp0..
SET USERINI=%BASEDIR%\user.ini
FOR /F "tokens=1,2 delims=:" %%a in ("%STEELTOE_PCF_CREDENTIALS%") do (
   set CF_USER=%%a
   set CF_PASS=%%b
)

SET PYTHON_HOME=C:\Python36
SET DOTNET_HOME=C:\Program Files\dotnet
SET JAVA_HOME=C:\opt\oracle-jdk-8
SET GIT_HOME=C:\Program Files\Git
SET MAVEN_HOME=C:\opt\apache-maven-3.3.9
SET CF_HOME=C:\ProgramData\chocolatey\bin
SET TEST_OUT=C:\st\%~nx1

ECHO [behave.userdata] > %USERINI%
ECHO cf_apiurl = api.run.pcfbeta.io >> %USERINI%
ECHO cf_org = STEELTOE >> %USERINI%
ECHO cf_username = %CF_USER% >> %USERINI%
ECHO cf_password = %CF_PASS% >> %USERINI%
ECHO cf_max_attempts = 250 >> %USERINI%
REM ECHO output = %TEST_OUT% >> %USERINI%

SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\Scripts;%DOTNET_HOME%;%CF_HOME%;%JAVA_HOME%\bin;%GIT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
PATH

RMDIR /S /Q %TEST_OUT%
REM CALL %BASEDIR%\test-setup
REM CALL %BASEDIR%\test-run %*
behave %*

Remove override of output dir on Windows


"%PYTHON%" -m pip install . -vv

"%CC%" -c symmetry.c
"%CC%" -shared -o %SP_DIR%\goodvibes\share\symmetry_win.dll symmetry.o

:: Save source for C code and remove compiled libraries
ren "%SP_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SP_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
"%CC%" -c symmetry.c
"%CC%" -shared -o "%SP_DIR%\goodvibes\share\symmetry_win.dll" symmetry.o

Update bld.bat

Update bld.bat


# $Id$
# Called recursively from 'ant release' to build the files which can only be
# built under JDK 1.6.

# Change the following line to point to your JDK 1.6 home.
set JAVA_HOME=C:\jdk1.6.0_01
set PATH=%JAVA_HOME%\bin;%PATH%
ant compile.java

# End buildJdk16.bat

@echo off
rem $Id$
rem Called recursively from 'ant release' to build the files which can only be
rem built under JDK 1.6.

rem Change the following line to point to your JDK 1.6 home.
set JAVA_HOME=C:\jdk1.6.0_01

rem Change the following line to point to your ant home.
set ANT_HOME=C:\open\thirdparty\ant

set PATH=%JAVA_HOME%\bin;%PATH%
%ANT_HOME%\bin\ant compile.java

rem End buildJdk16.bat

MONDRIAN: Fix buildJdk16.bat; now 'ant jar' works on windows.

[git-p4: depot-paths = "//open/mondrian/": change = 10708]


set MAPNIK_INPUT_PLUGINS=c:\\mapnik-2.0\\lib\\mapnik\\input
set MAPNIK_FONTS=c:\\mapnik-2.0\\lib\\mapnik\\fonts
set target=Build
set config=Release
python gen_settings.py
python gyp/gyp build.gyp --depth=. -f msvs -G msvs_version=2010
;msbuild build.sln /t:%target% /p:Configuration=%config%
msbuild build.sln
;cp projects/makefiles/out/Default/_mapnik.node lib/_mapnik.node

add build wrapper

add build wrapper


@REM Store args
set _SolutionDir=%1%
set _TargetDir=%2%

@REM Do works
if not exist "%_SolutionDir%xiaowan" mkdir "%_SolutionDir%xiaowan" >nul

copy /y "%_TargetDir%xiaowan.exe" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%xiaowan.exe.Config" "%_SolutionDir%xiaowan\" >nul
@rem copy /y "%_TargetDir%ControlExs.dll" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%AxInterop.WMPLib.dll" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%Interop.WMPLib.dll" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%NLog.config" "%_SolutionDir%xiaowan\" >nul
@rem copy /y "%_TargetDir%NLog.dll" "%_SolutionDir%xiaowan\" >nul

if not exist "%_SolutionDir%xiaowan\en" mkdir "%_SolutionDir%xiaowan\en" >nul
if not exist "%_SolutionDir%xiaowan\zh-HanT" mkdir "%_SolutionDir%xiaowan\zh-HanT" >nul
if not exist "%_SolutionDir%xiaowan\ja-JP" mkdir "%_SolutionDir%xiaowan\ja-JP" >nul

xcopy /y "%_TargetDir%en" "%_SolutionDir%xiaowan\en" >nul
xcopy /y "%_TargetDir%zh-Hant" "%_SolutionDir%xiaowan\zh-HanT" >nul
xcopy /y "%_TargetDir%ja-JP" "%_SolutionDir%xiaowan\ja-JP" >nul

echo PostBuildEvent Completed.

@REM Store args
set _SolutionDir=%~1%
set _TargetDir=%~2%

@REM Do works
if not exist "%_SolutionDir%xiaowan" mkdir "%_SolutionDir%xiaowan" >nul

copy /y "%_TargetDir%xiaowan.exe" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%xiaowan.exe.Config" "%_SolutionDir%xiaowan\" >nul
@rem copy /y "%_TargetDir%ControlExs.dll" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%AxInterop.WMPLib.dll" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%Interop.WMPLib.dll" "%_SolutionDir%xiaowan\" >nul
copy /y "%_TargetDir%NLog.config" "%_SolutionDir%xiaowan\" >nul
@rem copy /y "%_TargetDir%NLog.dll" "%_SolutionDir%xiaowan\" >nul

if not exist "%_SolutionDir%xiaowan\en" mkdir "%_SolutionDir%xiaowan\en" >nul
if not exist "%_SolutionDir%xiaowan\zh-HanT" mkdir "%_SolutionDir%xiaowan\zh-HanT" >nul
if not exist "%_SolutionDir%xiaowan\ja-JP" mkdir "%_SolutionDir%xiaowan\ja-JP" >nul

xcopy /y "%_TargetDir%en" "%_SolutionDir%xiaowan\en" >nul
xcopy /y "%_TargetDir%zh-Hant" "%_SolutionDir%xiaowan\zh-HanT" >nul
xcopy /y "%_TargetDir%ja-JP" "%_SolutionDir%xiaowan\ja-JP" >nul

echo PostBuildEvent Completed.

Fix PostBuildScript failure when path contains whitespace


echo on
setlocal

set VERSION=%1
if [%VERSION%] == [] set VERSION=999.0.0
echo building version %VERSION%
set VERSION=%VERSION%

set HERE=%~dp0
set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%;%HERE%\tools

call :dobuild || goto :ko
goto :ok

:dobuild
refbin\fullbuild install || goto :ko
refbin\fullbuild view fullbuild src/* || goto :ko
refbin\fullbuild rebuild --version %VERSION% fullbuild || goto :ko
goto :eof

:ok
exit /b 0

:ko
exit /b 5

echo on
setlocal

set VERSION=%1
if [%VERSION%] == [] set VERSION=999.0.0
echo building version %VERSION%
set VERSION=%VERSION%

set HERE=%~dp0
set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%HERE%\tools;%PATH%

call :dobuild || goto :ko
goto :ok

:dobuild
refbin\fullbuild install || goto :ko
refbin\fullbuild view fullbuild src/* || goto :ko
refbin\fullbuild rebuild --version %VERSION% fullbuild || goto :ko
goto :eof

:ok
exit /b 0

:ko
exit /b 5

use tools folder before

use tools folder before


@echo off
setlocal
cls

git show-branch --list release-*
echo.
SET /P release_branch="Please enter version of release branch: release-"
echo.
echo.
echo Change local branch to master
git checkout master
echo.
echo.
echo Merge release branch to master
git merge --no-ff release-%release_branch%
echo.
echo.
echo Create a tag of this version on master branch
git tag -a v%release_branch% -m "Creating Tag for Release %release_branch%"
echo.
echo.
echo Push changes to master and push tag
git push origin master
git push origin v%release_branch%
echo.
echo.
echo Change to develop workspace
git checkout develop
echo.
echo.
echo Merge changs from release branch
git merge --no-ff release-%release_branch%
echo.
echo.
echo Update Versions
call "%M2_HOME%/bin/mvn" versions:set -DnextSnapshot=true -DprocessAllModules=true
echo.
echo.
echo Delete the local release branch
git branch -d release-%release_branch%
echo.
echo.
echo Commiting update POM Files
:: commit the pom file with the updated version
git commit -m "changing develop version to new version" *pom.xml
echo.
echo.
echo Push the merge with version change to GitHub
git push origin develop
echo.
echo.
echo Changing to Master repository
git checkout v%release_branch%
echo.
echo.
echo Deploy new master version
call "%M2_HOME%/bin/mvn" deploy
echo.
echo.
echo Finally Change back to develop workspace
git checkout develop

add deploy request to release

add deploy request to release


@echo off

setlocal EnableDelayedExpansion

set registryRoot=HKCU\Software\Classes

reg delete %registryRoot%\*\shell\grepWin...
reg delete %registryRoot%\*\shell\grepWin...
reg delete %registryRoot%\Directory\background\shell\grepWin...
reg delete %registryRoot%\Directory\shell\grepWin...
reg delete %registryRoot%\Drive\shell\grepWin...
reg delete %registryRoot%\Folder\shell\grepWin...

Add script to remove global grepWin context menu


@echo off
rem Update .ccls project file for ccls LPS and compile_flags.txt for clangd

if "%~1"=="" (
    echo missing argument: the location of Qt's include directory
    EXIT /B 0
)

set qt_inc=%~1
set qt_inc=%qt_inc:\=\\%

(
    echo clang
    echo -fcxx-exceptions
    echo -std=c++11
    echo -Isrc
    echo -Isrc\\dialog
    echo -Isrc\\utils
    echo -Isrc\\widgets
    echo -Ihoedown
    echo -Ipeg-highlight
    echo -I%qt_inc%
    echo -I%qt_inc%\\QtCore
    echo -I%qt_inc%\\QtWebEngineWidgets
    echo -I%qt_inc%\\QtSvg
    echo -I%qt_inc%\\QtPrintSupport
    echo -I%qt_inc%\\QtWidgets
    echo -I%qt_inc%\\QtWebEngineCore
    echo -I%qt_inc%\\QtGui
    echo -I%qt_inc%\\QtWebChannel
    echo -I%qt_inc%\\QtNetwork
    echo -I%qt_inc%\\QtTest
) > ".ccls"

copy /Y .ccls compile_flags.txt

add coc_update.cmd

add coc_update.cmd


netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

title Enabling Remote Desktop. Please wait...

:: Open firewall port 3389
echo ==^> Openning Firewall Port 3389
netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389

:: Allow remote connections to this computer
echo ==^> Allow remote connections to this computer
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

add debug handling

add debug handling


xcopy /s /f include\cereal %LIBRARY_INC%

add debug output on Windows

add debug output on Windows


@SET CONFIGURATION=Release

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -property installationPath > temp.txt
set /p $MSBUILDROOT=<temp.txt
del temp.txt

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationVersion > temp.txt
Rem lower VS version
Rem set /p $MSBUILDVER=<temp.txt
Rem higher/unique VS
for /f "delims==" %%a in (temp.txt) do set $MSBUILDVER=%%a
del temp.txt

for /f "tokens=1 delims=." %%G in ("%$MSBUILDVER%") do set Current=%%G.0
Rem VS2017 => ~\MSBuild\15.0\Bin\MSBuild.exe
Rem VS2019 => ~\MsBuild\Current\Bin\MSBuild.exe
If "%Current%" NEQ "15.0" set Current=Current

@set $MSBUILDPATH="%$MSBUILDROOT%\MsBuild\%Current%\Bin\MSBuild.exe"

%$MSBUILDPATH% YAF.NET.sln /p:Configuration=%CONFIGURATION% /p:Platform="Any CPU" /p:WarningLevel=0 /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9

@SET CONFIGURATION=Release

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -property installationPath > temp.txt
set /p $MSBUILDROOT=<temp.txt
del temp.txt

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationVersion > temp.txt
Rem lower VS version
Rem set /p $MSBUILDVER=<temp.txt
Rem higher/unique VS
for /f "delims==" %%a in (temp.txt) do set $MSBUILDVER=%%a
del temp.txt

for /f "tokens=1 delims=." %%G in ("%$MSBUILDVER%") do set Current=%%G.0
Rem VS2017 => ~\MSBuild\15.0\Bin\MSBuild.exe
Rem VS2019 => ~\MsBuild\Current\Bin\MSBuild.exe
If "%Current%" NEQ "15.0" set Current=Current

@set $MSBUILDPATH="%$MSBUILDROOT%\MsBuild\%Current%\Bin\MSBuild.exe"

%$MSBUILDPATH% YAF.NET-SqlServer.sln /p:Configuration=%CONFIGURATION% /p:Platform="Any CPU" /p:WarningLevel=0 /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9

Update build.bat

Update build.bat


@echo off

::macros for normal windows commands
doskey c=cls
doskey e=echo. $*
doskey x=exit
doskey k=taskkill $*

doskey cd=if "$*"=="" (^
@cd ^
) else if "$1"=="/d" (^
@cd "$*"^
) else if "$1"=="/D" (^
@cd "$*"^
) else (^
@cd /d "$*"^
)

::macros for Linux-like commands.(include GNU tools,etc...)

::Additional macros
doskey fe=if exist "%%CD%%$*\" (^
Explorer /root, "%%CD%%$*\"^
) else if exist "%%CD%%\$*\" (^
Explorer /root, "%%CD%%\$*\"^
) else if exist "$*\" (^
Explorer /root, "$*"^
) else (^
Explorer /select, "$*"^
)

:: Navigation
doskey ..=cd ..
doskey ...=cd ../..
doskey ....=cd ../../..
doskey .....=cd ../../../..
doskey ~=cd /d %USERPROFILE%
doskey /=cd \
doskey \=cd \

@echo on

@echo off

::macros for normal windows commands
doskey c=cls
doskey e=echo. $*
doskey x=exit
doskey k=taskkill $*

::macros for Linux-like commands.(include GNU tools,etc...)

::Additional macros
doskey fe=if exist "%%CD%%$*\" (^
Explorer /root, "%%CD%%$*\"^
) else if exist "%%CD%%\$*\" (^
Explorer /root, "%%CD%%\$*\"^
) else if exist "$*\" (^
Explorer /root, "$*"^
) else (^
Explorer /select, "$*"^
)

:: Navigation
doskey ..=cd ..
doskey ...=cd ../..
doskey ....=cd ../../..
doskey .....=cd ../../../..
doskey ~=cd /d %USERPROFILE%
doskey /=cd \
doskey \=cd \

@echo on

remove buggy cd macro

_cmd/cmdrc.bat: remove buggy cd macro


@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

REM This Windows batch file mounts a virtual hard drive, creates a file in it, removes the file, and then unmounts the hard drive.
REM
REM Setup:
REM   1.  Open _Disk Management_ through the Start menu
REM   2.  Navigate to _Action_ and select _Create VHD_
REM   3.  Select the location for the virtual hard drive file and set the size to 10MB or greater
REM   4.  Right click the new disk, select _Initialize Disk_, and click _OK_
REM   5.  Right-click on the unallocated space in the new disk and select _New Simple Volume_
REM   6.  Follow the wizard; in the screen _Assign Drive Letter or Path_, choose not to assign them
REM   7.  Open a new command line window and type MOUNTVOL
REM   8.  From the output, copy the volume name of your newly created hard drive (e.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}) into the configuration variable VOLUME below
REM   9.  Assign the volume an unused drive letter in the configuration variable DRIVE below
REM   10. Execute this script

ECHO [Script executed at %DATE%-%TIME%]

REM Volume: Configuration variable
REM Volume: Unique identifier for the volume; open command prompt and type MOUNTVOL to find the volume name
REM Volume: E.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}\
SET VOLUME=

REM Drive: Configuration variable
REM Drive: Letter to denote the mount point
REM Drive: E.g. D
SET DRIVE=

REM Flesh out configuration variables
SET DRIVE=%DRIVE%:

REM Check for empty drive
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Drive %DRIVE% is already in use.
  EXIT /B %RETVAL%
)

REM Mount and check volume
MOUNTVOL %DRIVE% %VOLUME%
CALL :CheckMounted %DRIVE% RETVAl
IF %RETVAL% neq 0 (
  ECHO Error: Failed to mount volume on drive %DRIVE%. Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Add and remove file
ECHO This file can be deleted.> %DRIVE%\tmp.txt
DEL %DRIVE%\tmp.txt

REM Unmount volume and check empty drive
MOUNTVOL %DRIVE% /P
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to unmount volume from drive %DRIVE% . Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

ECHO [Script finished at %DATE%-%TIME%]
EXIT /B 0

REM This function checks that a certain drive is mounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2. Return value
REM     Equals 0 if the drive is mounted
REM     Equals Non-zero in any other case
:CheckMounted
SET DRIVE=%~1
MOUNTVOL %DRIVE% /L > NUL 2>&1
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is unmounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2. Return value
REM     Equals 0 if the drive is not mounted
REM     Equals 1 in any other case
:CheckUnmounted
SET DRIVE=%~1
SET EXITCODE=1
MOUNTVOL %DRIVE% /L > NUL 2>&1
IF %ERRORLEVEL% EQU 1 (  REM Must be immediately after MOUNTVOL
  SET EXITCODE=0
)
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

REM This Windows batch file mounts a virtual hard drive, creates a file in it, removes the file, and then unmounts the hard drive.
REM
REM Setup:
REM   1.  Open _Disk Management_ through the Start menu
REM   2.  Navigate to _Action_ and select _Create VHD_
REM   3.  Select the location for the virtual hard drive file and set the size to 10MB or greater
REM   4.  Right click the new disk, select _Initialize Disk_, and click _OK_
REM   5.  Right-click on the unallocated space in the new disk and select _New Simple Volume_
REM   6.  Follow the wizard; in the screen _Assign Drive Letter or Path_, choose not to assign them
REM   7.  Open a new command line window and type MOUNTVOL
REM   8.  From the output, copy the volume name of your newly created hard drive (e.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}) into the configuration variable VOLUME below
REM   9.  Assign the volume an unused drive letter in the configuration variable DRIVE below
REM   10. Execute this script

ECHO [Script executed at %DATE%-%TIME%]

REM Volume: Configuration variable
REM Volume: Unique identifier for the volume; open command prompt and type MOUNTVOL to find the volume name
REM Volume: E.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}\
SET VOLUME=

REM Drive: Configuration variable
REM Drive: Letter to denote the mount point
REM Drive: E.g. D
SET DRIVE=

REM Flesh out configuration variables
SET DRIVE=%DRIVE%:

REM Check for empty drive
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Drive %DRIVE% is already in use.
  EXIT /B %RETVAL%
)

REM Mount and check volume
MOUNTVOL %DRIVE% %VOLUME%
CALL :CheckMounted %DRIVE% RETVAl
IF %RETVAL% neq 0 (
  ECHO Error: Failed to mount volume on drive %DRIVE%. Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Add and remove file
ECHO This file can be deleted.> %DRIVE%\tmp.txt
DEL %DRIVE%\tmp.txt

REM Unmount volume and check empty drive
MOUNTVOL %DRIVE% /P
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to unmount volume from drive %DRIVE% . Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

ECHO [Script finished at %DATE%-%TIME%]
EXIT /B 0

REM This function checks that a certain drive is mounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2: Return value
REM     Equals 0 if the drive is mounted
REM     Equals Non-zero in any other case
:CheckMounted
SET DRIVE=%~1
MOUNTVOL %DRIVE% /L > NUL 2>&1
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is unmounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2: Return value
REM     Equals 0 if the drive is not mounted
REM     Equals 1 in any other case
:CheckUnmounted
SET DRIVE=%~1
SET EXITCODE=1
MOUNTVOL %DRIVE% /L > NUL 2>&1
IF %ERRORLEVEL% EQU 1 (  REM Must be immediately after MOUNTVOL
  SET EXITCODE=0
)
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

[Misc] Change param numbers' punctuation to be consistent


@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

REM This Windows batch file mounts a virtual hard drive, creates a file in it, removes the file, and then unmounts the hard drive.
REM
REM Setup:
REM   1.  Open _Disk Management_ through the Start menu
REM   2.  Navigate to _Action_ and select _Create VHD_
REM   3.  Select the location for the virtual hard drive file and set the size to 10MB or greater
REM   4.  Set the configuration variable VIRTUALDRIVE to the path of the virtual hard drive file created in the previous step
REM   5.  Right click the new disk, select _Initialize Disk_, and click _OK_
REM   6.  Right-click on the unallocated space in the new disk and select _New Simple Volume_
REM   7.  Follow the wizard; in the screen _Assign Drive Letter or Path_, choose not to assign them
REM   8.  Open a new command line window and type MOUNTVOL
REM   9.  From the output, copy the volume name of your newly created hard drive (e.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}) into the configuration variable VOLUME below
REM   10. Assign the volume an unused drive letter in the configuration variable DRIVE below
REM   11. Execute this script

ECHO [Script executed at %DATE%-%TIME%]

REM VirtualDrive: Configuration variable
REM VirtualDrive: Path of the virtual hard drive file created using _Disk Management_ during setup
REM VirtualDrive: E.g. C:\drive\virtual_hard_drive.vhd
SET VIRTUALDRIVE=

REM Volume: Configuration variable
REM Volume: Unique identifier for the volume; open command prompt and type MOUNTVOL to find the volume name
REM Volume: E.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}\
SET VOLUME=

REM Drive: Configuration variable
REM Drive: Letter to denote the mount point
REM Drive: E.g. D
SET DRIVE=

REM Flesh out configuration variables
SET DRIVE=%DRIVE%:

REM Attach virtual hard drive
CALL :AttachDrive %VIRTUALDRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Virtual hard drive %VIRTUALDRIVE% could not be attached.
  EXIT /B %RETVAL%
)

REM Check for empty drive letter
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Drive %DRIVE% is already in use.
  EXIT /B %RETVAL%
)

REM Mount volume to the drive and check status of drive
MOUNTVOL %DRIVE% %VOLUME%
CALL :CheckMounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to mount volume on drive %DRIVE%. Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Add and remove file
ECHO This file can be deleted.> %DRIVE%\tmp.txt
DEL %DRIVE%\tmp.txt

REM Unmount volume from the drive and check status of drive
MOUNTVOL %DRIVE% /P
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to unmount volume from drive %DRIVE% . Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Detach virtual hard drive
CALL :DetachDrive %VIRTUALDRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Virtual hard drive %VIRTUALDRIVE% could not be detached.
  EXIT /B %RETVAL%
)

ECHO [Script finished at %DATE%-%TIME%]
EXIT /B 0

REM This function attaches a virtual hard drive.
REM
REM Parameters:
REM   1. Path to the virtual hard drive file (e.g. C:\drive\virtual_hard_drive.vhd)
REM   2. Return value
REM     Equals 0 if the drive is successfully attached
REM     Equals 1 in any other case
:AttachDrive
SET VIRTUALDRIVEPATH=%~1
SET TEMPSCRIPT=%TEMP%\diskpart-script-%RANDOM%
TYPE NUL > %TEMPSCRIPT%
ECHO SELECT VDISK FILE=%VIRTUALDRIVEPATH% >> %TEMPSCRIPT%
ECHO ATTACH VDISK >> %TEMPSCRIPT%

SET EXITCODE=0
DISKPART /s %TEMPSCRIPT% > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 (
  SET EXITCODE=1
)

DEL %TEMPSCRIPT%
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function detaches a virtual hard drive.
REM
REM Parameters:
REM   1. Path to the virtual hard drive file (e.g. C:\drive\virtual_hard_drive.vhd)
REM   2. Return value
REM     Equals 0 if the drive is successfully detached
REM     Equals 1 in any other case
:DetachDrive
SET VIRTUALDRIVEPATH=%~1
SET TEMPSCRIPT=%TEMP%\diskpart-script-%RANDOM%
TYPE NUL > %TEMPSCRIPT%
ECHO SELECT VDISK FILE=%VIRTUALDRIVEPATH% >> %TEMPSCRIPT%
ECHO DETACH VDISK >> %TEMPSCRIPT%

SET EXITCODE=0
DISKPART /s %TEMPSCRIPT% > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 (
  SET EXITCODE=1
)

DEL %TEMPSCRIPT%
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is mounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2: Return value
REM     Equals 0 if the drive is mounted
REM     Equals non-zero in any other case
:CheckMounted
SET DRIVE=%~1
MOUNTVOL %DRIVE% /L > NUL 2>&1
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is unmounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2: Return value
REM     Equals 0 if the drive is not mounted
REM     Equals 1 in any other case
:CheckUnmounted
SET DRIVE=%~1
SET EXITCODE=1
MOUNTVOL %DRIVE% /L > NUL 2>&1
IF %ERRORLEVEL% EQU 1 (  REM Must be immediately after MOUNTVOL
  SET EXITCODE=0
)
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

REM This Windows batch file mounts a virtual hard drive, creates a file in it, removes the file, and then unmounts the hard drive.
REM
REM Setup:
REM   1.  Open _Disk Management_ through the Start menu
REM   2.  Navigate to _Action_ and select _Create VHD_
REM   3.  Select the location for the virtual hard drive file and set the size to 10MB or greater
REM   4.  Set the configuration variable VIRTUALDRIVE to the path of the virtual hard drive file created in the previous step
REM   5.  Right click the new disk, select _Initialize Disk_, and click _OK_
REM   6.  Right-click on the unallocated space in the new disk and select _New Simple Volume_
REM   7.  Follow the wizard; in the screen _Assign Drive Letter or Path_, choose not to assign them
REM   8.  Open a new command line window and type MOUNTVOL
REM   9.  From the output, copy the volume name of your newly created hard drive (e.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}) into the configuration variable VOLUME below
REM   10. Detach the drive from _Disk Management_ by right-clicking the new disk and selecting _Detach VHD_
REM   11. Assign the volume an unused drive letter in the configuration variable DRIVE below
REM   12. Execute this script

ECHO [Script executed at %DATE%-%TIME%]

REM VirtualDrive: Configuration variable
REM VirtualDrive: Path of the virtual hard drive file created using _Disk Management_ during setup
REM VirtualDrive: E.g. C:\drive\virtual_hard_drive.vhd
SET VIRTUALDRIVE=

REM Volume: Configuration variable
REM Volume: Unique identifier for the volume; open command prompt and type MOUNTVOL to find the volume name
REM Volume: E.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}\
SET VOLUME=

REM Drive: Configuration variable
REM Drive: Letter to denote the mount point
REM Drive: E.g. D
SET DRIVE=

REM Flesh out configuration variables
SET DRIVE=%DRIVE%:

REM Check for empty drive letter
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Drive %DRIVE% is already in use.
  EXIT /B %RETVAL%
)

REM Attach virtual hard drive
CALL :AttachDrive %VIRTUALDRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Virtual hard drive %VIRTUALDRIVE% could not be attached.
  EXIT /B %RETVAL%
)

REM Mount volume to the drive and check status of drive
MOUNTVOL %DRIVE% %VOLUME%
CALL :CheckMounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to mount volume on drive %DRIVE%. Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Add and remove file
ECHO This file can be deleted.> %DRIVE%\tmp.txt
DEL %DRIVE%\tmp.txt

REM Unmount volume from the drive and check status of drive
MOUNTVOL %DRIVE% /P
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to unmount volume from drive %DRIVE% . Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Detach virtual hard drive
CALL :DetachDrive %VIRTUALDRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Virtual hard drive %VIRTUALDRIVE% could not be detached.
  EXIT /B %RETVAL%
)

ECHO [Script finished at %DATE%-%TIME%]
EXIT /B 0

REM This function attaches a virtual hard drive.
REM
REM Parameters:
REM   1. Path to the virtual hard drive file (e.g. C:\drive\virtual_hard_drive.vhd)
REM   2. Return value
REM     Equals 0 if the drive is successfully attached
REM     Equals 1 in any other case
:AttachDrive
SET VIRTUALDRIVEPATH=%~1
SET TEMPSCRIPT=%TEMP%\diskpart-script-%RANDOM%
TYPE NUL > %TEMPSCRIPT%
ECHO SELECT VDISK FILE=%VIRTUALDRIVEPATH% >> %TEMPSCRIPT%
ECHO ATTACH VDISK >> %TEMPSCRIPT%

SET EXITCODE=0
DISKPART /s %TEMPSCRIPT% > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 (
  SET EXITCODE=1
)

DEL %TEMPSCRIPT%
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function detaches a virtual hard drive.
REM
REM Parameters:
REM   1. Path to the virtual hard drive file (e.g. C:\drive\virtual_hard_drive.vhd)
REM   2. Return value
REM     Equals 0 if the drive is successfully detached
REM     Equals 1 in any other case
:DetachDrive
SET VIRTUALDRIVEPATH=%~1
SET TEMPSCRIPT=%TEMP%\diskpart-script-%RANDOM%
TYPE NUL > %TEMPSCRIPT%
ECHO SELECT VDISK FILE=%VIRTUALDRIVEPATH% >> %TEMPSCRIPT%
ECHO DETACH VDISK >> %TEMPSCRIPT%

SET EXITCODE=0
DISKPART /s %TEMPSCRIPT% > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 (
  SET EXITCODE=1
)

DEL %TEMPSCRIPT%
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is mounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2: Return value
REM     Equals 0 if the drive is mounted
REM     Equals non-zero in any other case
:CheckMounted
SET DRIVE=%~1
MOUNTVOL %DRIVE% /L > NUL 2>&1
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is unmounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2: Return value
REM     Equals 0 if the drive is not mounted
REM     Equals 1 in any other case
:CheckUnmounted
SET DRIVE=%~1
SET EXITCODE=1
MOUNTVOL %DRIVE% /L > NUL 2>&1
IF %ERRORLEVEL% EQU 1 (  REM Must be immediately after MOUNTVOL
  SET EXITCODE=0
)
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

Move CheckUnmounted check to earlier and correct setup instructions


echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

if "%ANACONDA_USERNAME%" == "" (
  set /p ANACONDA_USERNAME="Username: "
) else (
  echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
  set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
  echo %ANACONDA_USERNAME%'s password: [secure];
)

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit "%ANACONDA_UPLOAD_FLAGS%
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo ON

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
  anaconda logout
  exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
  cd ..
  anaconda logout
  rmdir toolchain /s /q
  exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%x in (%UPLOAD_TARGETS%) do (
  echo | set /p "for /f %%i in ('conda build " > _upload.bat
  more _upload.bat
  <nul set /p %%x >> _upload.bat
  more _upload.bat
  <nul set /p " -c " >> _upload.bat
  more _upload.bat
  <nul set /p %ANACONDA_CHANNEL% >> _upload.bat
  more _upload.bat
  <nul set /p " " >> _upload.bat
  more _upload.bat
  <nul set /p %ANACONDA_FLAGS% >> _upload.bat
  echo --output >> _upload.bat
  more _upload.bat
  echo anaconda upload --user %ANACONDA_CHANNEL% %UPLOAD_FILE% >> _upload.bat
  more _upload.bat
  echo if \%errorlevel\% neq 0 echo upload failed
  more _upload.bat
  del _upload.bat
)

anaconda logout

echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

if "%ANACONDA_USERNAME%" == "" (
  set /p ANACONDA_USERNAME="Username: "
) else (
  echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
  set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
  echo %ANACONDA_USERNAME%'s password: [secure];
)

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit "%ANACONDA_UPLOAD_FLAGS%
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo ON

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
  anaconda logout
  exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
  cd ..
  anaconda logout
  rmdir toolchain /s /q
  exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%x in (%UPLOAD_TARGETS%) do (
  echo | set /p "for /f %%i in ('conda build " > _upload.bat
  more _upload.bat
  <nul set /p %%x >> _upload.bat
  more _upload.bat
  <nul set /p " -c " >> _upload.bat
  more _upload.bat
  <nul set /p %ANACONDA_CHANNEL% >> _upload.bat
  more _upload.bat
  <nul set /p " " >> _upload.bat
  more _upload.bat
  <nul set /p %ANACONDA_FLAGS% >> _upload.bat
  echo --output >> _upload.bat
  more _upload.bat
  echo anaconda upload --user %ANACONDA_CHANNEL% %UPLOAD_FILE% >> _upload.bat
  more _upload.bat
  echo if \%errorlevel\% neq 0 echo upload failed >> _upload.bat
  more _upload.bat
  del _upload.bat
)

anaconda logout

Update upload.bat

Update upload.bat


@echo off
setlocal
SET JDK=c:\jdk1.3
set JING_HOME=%~d0%~p0..
%JDK%\bin\java -Dant.home=%JING_HOME% -cp %JING_HOME%\lib\ant.jar;%JING_HOME%\lib\saxon.jar;%JING_HOME%\lib\crimson.jar;%JING_HOME%\lib\optional.jar;%JDK%\lib\tools.jar;%JING_HOME%\lib\junit.jar;%JING_HOME%\lib\regex.jar;%JING_HOME%\lib\isorelax.jar org.apache.tools.ant.Main -buildfile %JING_HOME%\build.xml %*

@echo off
setlocal
SET JDK=c:\jdk1.3
set JING_HOME=%~d0%~p0..
%JDK%\bin\java -Dant.home=%JING_HOME% -cp %JING_HOME%\lib\ant.jar;%JING_HOME%\lib\saxon.jar;%JING_HOME%\lib\crimson.jar;%JING_HOME%\lib\optional.jar;%JDK%\lib\tools.jar;%JING_HOME%\lib\junit.jar;%JING_HOME%\lib\regex.jar;%JING_HOME%\lib\regex2.jar;%JING_HOME%\lib\isorelax.jar org.apache.tools.ant.Main -buildfile %JING_HOME%\build.xml %*

Add regex2.jar

Add regex2.jar


@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../
REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 2.7.0 https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 14 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y
cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 14 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building glog...
if exist glog (rd glog /q /s)
git clone -b v035 https://github.com/google/glog.git

cd glog
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Release|x64"
copy Debug\*.lib ..\..\lib\Debug /Y
copy Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...

if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/ArkGame/evpp.git

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project evpp_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project evpp_static.vcxproj
cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

@echo off

echo Building dependencies...

echo Building evpp...

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project libevpp.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project libevpp.vcxproj
cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

modify evpp build bat

modify evpp build bat

Former-commit-id: 098267b8dcf2234909fe70a178e7cab0ce2afc52 [formerly 246df95989e458225b5023e1f24f55a8934fa8d2] [formerly c7f78811efc4cb8355da04864170e579e975b16c] [formerly 2ab61b4ad3e1952964bddc9c16bd7f796e72042f]
Former-commit-id: d53d8b34d3e33b131f0c3e6d92760b7bbee1fe55
Former-commit-id: e5c97dca72235539c29b64b901d62edc6aae4ec4
Former-commit-id: ce5a2877629c1acda76aef6c902c7bd135a227d8


@echo off
:##############################################################################
:#                                                                            #
:#  Filename        python.bat                                                #
:#                                                                            #
:#  Description     Run python.exe, even when it's not in the PATH            #
:#                                                                            #
:#  Notes 	    The default instance of Python is considered to be        #
:#		    the one associated with the .py file extension in         #
:#		    the registry; Not necessarily the one in the PATH.        #
:#                                                                            #
:#  History                                                                   #
:#   2017-01-16 JFL Created this file.                                        #
:#   2019-09-30 JFL Added option -X.                                          #
:#   2019-10-01 JFL Added options --, -# and -l.                              #
:#   2019-10-02 JFL Use DisableDelayedExpansion to avoid issues w. ! in args. #
:#                  Added option -V.                                          #
:#                                                                            #
:#          Copyright 2019 Hewlett Packard Enterprise Development LP         #
:# Licensed under the Apache 2.0 license  www.apache.org/licenses/LICENSE-2.0 #
:##############################################################################

setlocal EnableExtensions DisableDelayedExpansion
set "VERSION=2019-10-02"
set "SCRIPT=%~nx0"		&:# Script name
set "SNAME=%~n0"		&:# Script name, without its extension
set "SPATH=%~dp0"		&:# Script path
set "SPATH=%SPATH:~0,-1%"	&:# Script path, without the trailing \
set "SFULL=%~f0"		&:# Script full pathname
set ^"ARG0=%0^"			&:# Script invokation name
set ^"ARGS=%*^"			&:# Argument line
goto :main

:# Get the first (#0) trailing argument
:GetArg0 %1=VARNAME %2=ARG0 %3... ignored
set "%~1=%~2"
exit /b

:# Get the Nth trailing argument
:GetArgN %1=VARNAME %2=N %3=ARG0 %4=ARG1 ...
setlocal DisableDelayedExpansion
set "VAR=%~1"
for /l %%n in (1,1,%~2) do shift
endlocal & set "%VAR%=%~3"
exit /b

:# Append an element to a list. The list is walkable using a for %%e in (!LIST!) ...
:lappend %1=LISTNAME %2=value
if defined %~1 (
  call set %%~1=%%%1%% %%2
) else (
  set %~1=%2
)
exit /b

:# Get the Nth element of a list.
:lindex %1=LISTNAME %2=index %3=VARNAME
call call :GetArgN %%3 %%2 %%%~1%%
exit /b

:# Get the command line used to open a given file type
:GetOpenCommand %1=type %2=VARNAME
set "%~2="
for /f "delims== tokens=2" %%c in ('ftype %~1 2^>NUL') do set "%~2=%%c"
exit /b

:# Get the default python.exe executable
:GetPythonExe %1=VARNAME
call :GetOpenCommand Python.File %1
if defined %~1 call call :GetArg0 %%1 %%%~1%%
exit /b

:# Get a list of all python.exe executables
:GetAllPythonExe %1=LISTNAME
setlocal EnableDelayedExpansion
set "LIST=" &:# List of instances found. Used to avoid reporting one twice.
:# List first the default instance
call :GetPythonExe PYTHON
if defined PYTHON call :lappend LIST "%PYTHON%"
:# Then look for other instances in well known places
for %%b in ("C:" "%ProgramFiles%" "%ProgramFiles(x86)%") do (
  for /d %%p in ("%%~b\Python*" "%%~b\Microsoft Visual Studio\Shared\Python*") do (
    for %%x in ("%%~p\python.exe") do if exist "%%~x" (
      set "FOUND=" &:# Avoid duplications, for example with the default instance
      for %%y in (!LIST!) do if not defined FOUND if /i "%%~fx"=="%%~y" set "FOUND=1"
      if not defined FOUND call :lappend LIST "%%~fx"
    )
  )
)
endlocal & set %~1=%LIST%
exit /b

:# List python.exe instances
:list
setlocal EnableDelayedExpansion
call :GetAllPythonExe LIST
set "N=0"
for %%e in (!LIST!) do (
  echo #!N! %%~e
  set /a "N+=1"
)
endlocal
exit /b

:#----------------------------------------------------------------------------#
:# Main routine

:usage
echo.
echo %SCRIPT% - Run python.exe, even when it's not in the PATH
echo.
echo Usage: %SNAME% [OPTIONS] [PYTHON.EXE OPTIONS AND ARGUMENTS]
echo.
echo Options:
echo   -?          Display this help
echo   --          End of %SCRIPT% arguments
echo   -# N ^| #N   Use python instance #N in the list. Default=instance #0
echo   -l          List python instances installed, with the default instance first
echo   -X          Display the python command line to execute, but don't run it
echo.
echo python.exe options:
exit /b

:main
set "EXEC="
set "PYARGS="
set "INSTANCE=0"

goto :get_arg
:next_arg
shift
:get_arg
if [%1]==[] goto :go
set "ARG=%~1"
if "%ARG%"=="-?" call :usage & set "PYARGS=-?" & goto :go
if "%ARG%"=="--" goto :next_pyarg &:# All remaining arguments are for python.exe
if "%ARG%"=="-#" set "INSTANCE=%~2" & shift & goto :next_arg
if "%ARG:~0,1%"=="#" set "INSTANCE=%ARG:~1%" & goto :next_arg
if "%ARG%"=="-l" call :list & exit /b
if "%ARG%"=="-V" (echo %SCRIPT% %VERSION%) & set "PYARGS=-V" & goto :go
if "%ARG%"=="-X" set "EXEC=echo" & goto :next_arg
:get_pyarg
if [%1]==[] goto :go
call :lappend PYARGS %1
:next_pyarg
shift
goto :get_pyarg

:go

:# Get the Nth Python instance
set "PYTHON="
if %INSTANCE%==0 ( :# Performance optimization for instance #0
  call :GetPythonExe PYTHON
)
if not defined PYTHON ( :# For %INSTANCE% > 0, or if the above search for #0 failed
  call :GetAllPythonExe LIST
  call :lindex LIST %INSTANCE% PYTHON
)
if not defined PYTHON (
  echo %SCRIPT%: Error: No python interpreter found
  exit /b 1
)
%EXEC% "%PYTHON%" %PYARGS%

@echo off
:##############################################################################
:#                                                                            #
:#  Filename        python.bat                                                #
:#                                                                            #
:#  Description     Run python.exe, even when it's not in the PATH            #
:#                                                                            #
:#  Notes 	    The default instance of Python is considered to be        #
:#		    the one associated with the .py file extension in         #
:#		    the registry; Not necessarily the one in the PATH.        #
:#                                                                            #
:#  History                                                                   #
:#   2017-01-16 JFL Created this file.                                        #
:#   2019-09-30 JFL Added option -X.                                          #
:#   2019-10-01 JFL Added options --, -# and -l.                              #
:#   2019-10-02 JFL Use DisableDelayedExpansion to avoid issues w. ! in args. #
:#                  Added option -V.                                          #
:#   2019-11-29 JFL Make the python instance number inheritable.              #
:#                                                                            #
:#          Copyright 2019 Hewlett Packard Enterprise Development LP         #
:# Licensed under the Apache 2.0 license  www.apache.org/licenses/LICENSE-2.0 #
:##############################################################################

setlocal EnableExtensions DisableDelayedExpansion
set "VERSION=2019-11-29"
set "SCRIPT=%~nx0"		&:# Script name
set "SNAME=%~n0"		&:# Script name, without its extension
set "SPATH=%~dp0"		&:# Script path
set "SPATH=%SPATH:~0,-1%"	&:# Script path, without the trailing \
set "SFULL=%~f0"		&:# Script full pathname
set ^"ARG0=%0^"			&:# Script invokation name
set ^"ARGS=%*^"			&:# Argument line
goto :main

:# Get the first (#0) trailing argument
:GetArg0 %1=VARNAME %2=ARG0 %3... ignored
set "%~1=%~2"
exit /b

:# Get the Nth trailing argument
:GetArgN %1=VARNAME %2=N %3=ARG0 %4=ARG1 ...
setlocal DisableDelayedExpansion
set "VAR=%~1"
for /l %%n in (1,1,%~2) do shift
endlocal & set "%VAR%=%~3"
exit /b

:# Append an element to a list. The list is walkable using a for %%e in (!LIST!) ...
:lappend %1=LISTNAME %2=value
if defined %~1 (
  call set %%~1=%%%1%% %%2
) else (
  set %~1=%2
)
exit /b

:# Get the Nth element of a list.
:lindex %1=LISTNAME %2=index %3=VARNAME
call call :GetArgN %%3 %%2 %%%~1%%
exit /b

:# Get the command line used to open a given file type
:GetOpenCommand %1=type %2=VARNAME
set "%~2="
for /f "delims== tokens=2" %%c in ('ftype %~1 2^>NUL') do set "%~2=%%c"
exit /b

:# Get the default python.exe executable
:GetPythonExe %1=VARNAME
call :GetOpenCommand Python.File %1
if defined %~1 call call :GetArg0 %%1 %%%~1%%
exit /b

:# Get a list of all python.exe executables
:GetAllPythonExe %1=LISTNAME
setlocal EnableDelayedExpansion
set "LIST=" &:# List of instances found. Used to avoid reporting one twice.
:# List first the default instance
call :GetPythonExe PYTHON
if defined PYTHON call :lappend LIST "%PYTHON%"
:# Then look for other instances in well known places
for %%b in ("C:" "%ProgramFiles%" "%ProgramFiles(x86)%") do (
  for /d %%p in ("%%~b\Python*" "%%~b\Microsoft Visual Studio\Shared\Python*") do (
    for %%x in ("%%~p\python.exe") do if exist "%%~x" (
      set "FOUND=" &:# Avoid duplications, for example with the default instance
      for %%y in (!LIST!) do if not defined FOUND if /i "%%~fx"=="%%~y" set "FOUND=1"
      if not defined FOUND call :lappend LIST "%%~fx"
    )
  )
)
endlocal & set %~1=%LIST%
exit /b

:# List python.exe instances
:list
setlocal EnableDelayedExpansion
call :GetAllPythonExe LIST
set "N=0"
for %%e in (!LIST!) do (
  echo #!N! %%~e
  set /a "N+=1"
)
endlocal
exit /b

:#----------------------------------------------------------------------------#
:# Main routine

:usage
echo.
echo %SCRIPT% - Run python.exe, even when it's not in the PATH
echo.
echo Usage: %SNAME% [OPTIONS] [PYTHON.EXE OPTIONS AND ARGUMENTS]
echo.
echo Options:
echo   -?          Display this help
echo   --          End of %SCRIPT% arguments
echo   -# N ^| #N   Use python instance #N in the list. Default=instance #0
echo   -l          List python instances installed, with the default instance first
echo   -X          Display the python command line to execute, but don't run it
echo.
echo python.exe options:
exit /b

:main
set "EXEC="
set "PYARGS="
if not defined PY# set "PY#=0"

goto :get_arg
:next_arg
shift
:get_arg
if [%1]==[] goto :go
set "ARG=%~1"
if "%ARG%"=="-?" call :usage & set "PYARGS=-?" & goto :go
if "%ARG%"=="--" goto :next_pyarg &:# All remaining arguments are for python.exe
if "%ARG%"=="-#" set "PY#=%~2" & shift & goto :next_arg
if "%ARG:~0,1%"=="#" set "PY#=%ARG:~1%" & goto :next_arg
if "%ARG%"=="-l" call :list & exit /b
if "%ARG%"=="-V" (echo %SCRIPT% %VERSION%) & set "PYARGS=-V" & goto :go
if "%ARG%"=="-X" set "EXEC=echo" & goto :next_arg
:get_pyarg
if [%1]==[] goto :go
call :lappend PYARGS %1
:next_pyarg
shift
goto :get_pyarg

:go

:# Get the Nth Python instance
set "PYTHON="
if %PY#%==0 ( :# Performance optimization for instance #0
  call :GetPythonExe PYTHON
)
if not defined PYTHON ( :# For %PY#% > 0, or if the above search for #0 failed
  call :GetAllPythonExe LIST
  call :lindex LIST %PY#% PYTHON
)
if not defined PYTHON (
  echo %SCRIPT%: Error: No python interpreter found
  exit /b 1
)
%EXEC% "%PYTHON%" %PYARGS%


@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   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
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   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
set "%JMETER_HOME%=%~dp0\.."
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

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
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

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 not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined 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

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
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 -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -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 Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

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

if not defined DDRAW (
    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 Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

%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   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
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   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
set "JMETER_HOME=%~dp0\.."
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

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
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

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 not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined 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

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
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 -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -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 Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

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

if not defined DDRAW (
    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 Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

%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

Set JMETER_HOME variable correctly.

Set JMETER_HOME variable correctly.

Bugzilla Id: 62128

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1825385 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: fc71cd74c7c5192398a25bf84cb6e24cee6cf505


@echo off
setlocal enabledelayedexpansion
title Eliminador de autorun.inf
echo Eliminador de autoruns v1.0

if "%1"=="" (
	:metodouno
	if exist autorun.inf (
		echo Intentando eliminar todos los autoruns existentes dentro de la ruta especificada

		attrib -r -s -h autorun.inf
		del /f /q autorun.inf

		if not exist autorun.inf (
			echo Autorun.inf borrado correctamente

		) else (
			echo Hubo un problema al borrar el autorun
		)

		goto fin

	) else (
		echo No se encontro ningun autorun.inf en el directorio:
		chdir
		goto fin
	)

) else (

	if "%2"=="" (

		cd %1
		goto metodouno

	) else (
		if "%2"=="/r" (
			rem Modo recursivo
			set /a flag = 0
			for /r %1 %%v in (*.inf) do (
				set /a flag = !flag! + 1
				goto sig
			)

			:sig
			if !flag! gtr 0 (
				cd %1
				attrib -r -s -h autorun.inf /s /d

				del *.inf /s /f /q
				goto fin

			) else (
				echo No se encontro ningun autorun.inf en el directorio:
				echo %1
				goto fin
			)

		) else (
			echo El segundo parametro debe ser /r para activar el modo recursivo
			goto fin
		)
	)
)

:fin
pause

Create eliminador.bat

Create eliminador.bat

Programa que elimina archivos autorun.inf
Para usarlo solo ejecuta el archivo con doble clic y eliminará el autorun.inf que esté dentro del directorio el cual se encuentre el eliminador.bat
Otra forma de usarlo es mediante prompt, con el comando: eliminador [PATH] donde PATH es la ruta la cual quieres que se eliminen los autoruns. El archivo también recibe un segundo parámetro el cual es: /r lo que activará una búsqueda recursiva de autoruns.inf dentro de todo el sistema de carpetas encontrado en PATH. Ejemplo:

eliminador C:\users\nombredeusuario\desktop /r

Lo que provocará que se busquen y se eliminen todos los autorun.inf dentro de la carpeta desktop y las carpetas que se encuentren en desktop.


@echo off
set EXTERN_PATH=%~dp0..\extern
pushd %~dp0..\build
cmake -G "Visual Studio 14 Win64" -DGLM_ROOT_DIR=%EXTERN_PATH%\glm -DGLFW_ROOT=%EXTERN_PATH%\glfw^
 -DCMAKE_PREFIX_PATH=%EXTERN_PATH%\DevIL;%EXTERN_PATH%\DevIL\lib\x64\Release^
 -DBOOST_ROOT=C:\Development\boost_1_64_0 ..
popd

@echo off
set EXTERN_PATH=%~dp0..\extern
pushd %~dp0..\build
cmake -G "Visual Studio 14 Win64" -DGLM_ROOT_DIR=%EXTERN_PATH%\glm -DGLFW_ROOT=%EXTERN_PATH%\glfw^
 -DCMAKE_PREFIX_PATH=%EXTERN_PATH%\DevIL;%EXTERN_PATH%\DevIL\lib\x64\Release^
 -DBOOST_ROOT=%EXTERN_PATH%\boost ..
popd

Update generator script

Update generator script


@ECHO OFF
ECHO This will install Topographica and its package dependencies.
if "%1"=="" ECHO If default path is not acceptable, enter path as parameter to setup.bat
if NOT "%1"=="" ECHO Target is %1\Topographica\

REM Developer's Note: Install Python then call the setup.py script
REM inside the external/win32 directory.
REM $Id: setup.bat,v 1.6 2004/06/30 15:43:59 judah Exp $

external\win32\util\Y_OR_N /Q /A "Do you wish to continue? [Y/n]"

IF ERRORLEVEL 3 GOTO :INSTALL
IF ERRORLEVEL 2 GOTO :EXIT
IF ERRORLEVEL 1 GOTO :INSTALL

:INSTALL
ftype Python.File | findstr "Python.File="
IF ERRORLEVEL 1 GOTO :INSTALL_PYTHON
IF ERRORLEVEL 0 GOTO :RUN_SETUP

:INSTALL_PYTHON
ECHO Python file associations not detected: Installing Python 2.4
start /wait external\win32\python-2.4.msi

:RUN_SETUP
cd external\win32
cd
start /wait setup.py configure
start /wait /B setup.py install %1

:EXIT
ECHO Install Complete

@ECHO OFF
ECHO This will install Topographica and its package dependencies.
if "%1"=="" ECHO If default path is not acceptable, enter path as parameter to setup.bat
if NOT "%1"=="" ECHO Target is %1\Topographica\

REM Developer's Note: Install Python then call the setup.py script
REM inside the external/win32 directory.
REM $Id: setup.bat,v 1.6 2004/06/30 15:43:59 judah Exp $

external\win32\util\Y_OR_N /Q /A "Do you wish to continue? [Y/n]"

IF ERRORLEVEL 3 GOTO :INSTALL
IF ERRORLEVEL 2 GOTO :EXIT
IF ERRORLEVEL 1 GOTO :INSTALL

:INSTALL
ftype Python.File | findstr "Python.File="
IF ERRORLEVEL 1 GOTO :INSTALL_PYTHON
IF ERRORLEVEL 0 GOTO :RUN_SETUP

:INSTALL_PYTHON
ECHO Python file associations not detected: Installing Python 2.4
start /wait external\win32\python-2.4.2.msi

:RUN_SETUP
cd external\win32
cd
start /wait setup.py configure
start /wait /B setup.py install %1

:EXIT
ECHO Install Complete

Upgrade Python 2.4.2 for Windows

Upgrade Python 2.4.2 for Windows


:Beg
driver --load --path C:\Code\hadesmem\dist\debug\x64\chimera.sys --name Chimera
driver --unload --path C:\Code\hadesmem\dist\debug\x64\chimera.sys --name Chimera
goto Beg

[Scripts] Add a script for stress testing load/unload.


@echo
REM This file is part of couchapp released under the Apache 2 license.
REM See the NOTICE for more information.

pythonw.exe -OO -c "import couchapp:dispatch" %*

@echo off
rem Windows script for Couchapp

rem Use a full path to Python (relative to this script) as the standard Python
rem install does not put python.exe on the PATH...
rem %~dp0 is the directory of this script

"%~dp0..\python" "%~dp0couchapp" %*
endlocal

fix windows script

fix windows  script


@setlocal
@prompt $G$S
@set CMDHOME=%~dp0.

@if NOT "%VS120COMNTOOLS%"=="" (
  @set VSTOOLSDIR="%VS120COMNTOOLS%"
  @set VSVER=Visual Studio 2013
) else (
  @set VSTOOLSDIR="%VS110COMNTOOLS%"
  @set VSVER=Visual Studio 2012
)

@set PKG=Orleans Tools for %VSVER%

@echo --- Uninstalling %PKG%
@Echo -- VS Tools directory = %VSTOOLSDIR%

@Echo - Unsetting OrleansSDK environment variable
SetX.exe OrleansSDK ""

@ECHO - Uninstalling Visual Studio extension package %PKG%
%VSTOOLSDIR%\..\IDE\vsixinstaller.exe /uninstall:462db41f-31a4-48f0-834c-1bdcc0578511

@echo --- Finished uninstalling %PKG%
@pause

@setlocal
@prompt $G$S
@set CMDHOME=%~dp0.

@if NOT "%VS140COMNTOOLS%"=="" (
  @set VSTOOLSDIR="%VS140COMNTOOLS%"
  @set VSVER=Visual Studio 2015
) else (
  @if NOT "%VS120COMNTOOLS%"=="" (
    @set VSTOOLSDIR="%VS120COMNTOOLS%"
    @set VSVER=Visual Studio 2013
  ) else (
    @set VSTOOLSDIR="%VS110COMNTOOLS%"
    @set VSVER=Visual Studio 2012
  )
)

@set PKG=Orleans Tools for %VSVER%

@echo --- Uninstalling %PKG%
@Echo -- VS Tools directory = %VSTOOLSDIR%

@Echo - Unsetting OrleansSDK environment variable
SetX.exe OrleansSDK ""

@ECHO - Uninstalling Visual Studio extension package %PKG%
%VSTOOLSDIR%\..\IDE\vsixinstaller.exe /uninstall:462db41f-31a4-48f0-834c-1bdcc0578511

@echo --- Finished uninstalling %PKG%
@pause

Add path to 2015 VS Tools.

Add path to 2015 VS Tools.


curl -sSf https://static.rust-lang.org/dist/rust-1.22.1-i686-pc-windows-msvc.exe -o rust.exe
rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
set PATH=%PATH%;C:\Rust\bin

curl -sSf http://releases.llvm.org/%LLVM_VERSION%/LLVM-%LLVM_VERSION%-win32.exe -o LLVM.exe
7z x LLVM.exe -oC:\LLVM
set PATH=%PATH%;C:\LLVM\bin
set LIBCLANG_PATH=C:\LLVM\bin

curl -sSf https://static.rust-lang.org/dist/rust-1.24.0-i686-pc-windows-msvc.exe -o rust.exe
rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
set PATH=%PATH%;C:\Rust\bin

curl -sSf http://releases.llvm.org/%LLVM_VERSION%/LLVM-%LLVM_VERSION%-win32.exe -o LLVM.exe
7z x LLVM.exe -oC:\LLVM
set PATH=%PATH%;C:\LLVM\bin
set LIBCLANG_PATH=C:\LLVM\bin

Update Rust version used by Appveyor

Update Rust version used by Appveyor


@echo off

java -Xmx2048m -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=256m -client -jar third_party\jruby\jruby-complete.jar -X-C -S rake %*

@echo off

java -Xmx2048m -XX:MetaspaceSize=1024m -XX:ReservedCodeCacheSize=256m -client -jar third_party\jruby\jruby-complete.jar -X-C -S rake %*

Fix MaxPermsize => MetaspaceSize

Fix MaxPermsize => MetaspaceSize

This should have been done 2 years ago in d345587


REM install db
call C:\funda_components\programs_manager\programs_manager_database\program_manager_test_database\install_program_manager_test_db.bat

REM test_action_enter_edit_programs
"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f ..\action_enter_edit_programs.sql 1> test_action_enter_edit_programs.log 2>&1

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f test_action_enter_edit_programs.sql  1>> test_action_enter_edit_programs.log 2>>&1

REM install db
call C:\funda_components\programs_manager\programs_manager_database\program_manager_test_database\install_program_manager_test_db.bat

REM test_action_enter_edit_programs
"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f ..\action_enter_edit_programs.sql 1> test_action_enter_edit_programs.log 2>&1

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f C:\funda_components\programs_manager\programs_manager_database\utility_functions\trig_log_programs_history.sql 1>> test_action_enter_edit_programs.log 2>>&1

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f test_action_enter_edit_programs.sql  1>> test_action_enter_edit_programs.log 2>>&1

Add history trigger installation

Add history trigger installation


@echo off

::Ensure we have administrative privileges in order to install files and set environment variables
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' == '0' (
    ::If no error is encountered, we have administrative privileges
    goto GotAdminPrivileges
)
echo Requesting administrative privileges...
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadminprivileges.vbs"
set params = %*:"=""
echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadminprivileges.vbs"
"%temp%\getadminprivileges.vbs"
exit /B
:GotAdminPrivileges
if exist "%temp%\getadminprivileges.vbs" ( del "%temp%\getadminprivileges.vbs" )
pushd "%CD%"
cd /D "%~dp0"

title Install Java

set jdk_version=10.0.2
set jdk_filename=openjdk-%jdk_version%_windows-x64_bin
set jdk_url=https://download.java.net/java/GA/jdk10/%jdk_version%/19aef61b38124481863b1413dce1855f/13/%jdk_filename%.tar.gz

echo Downloading required files
powershell -Command "Invoke-WebRequest %jdk_url% -OutFile $env:temp\%jdk_filename%.tar.gz"
::Download 7zip (command line version) in order to extract the tar.gz file since there is no native support in Windows
powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"

echo Extracting and installing JDK
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar.gz" -o"%TEMP%" -r -y
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar" -o"%TEMP%\openjdk-%jdk_version%" -r -y
if exist "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%" (
    rmdir /S /Q "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%"
) else (
    md "%PROGRAMFILES%\Java\openjdk"
)
move "%TEMP%\openjdk-%jdk_version%\jdk-%jdk_version%" "%PROGRAMFILES%\Java\openjdk"

echo Setting environment variables
setx /M JAVA_HOME "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%"
set java_bin=%%JAVA_HOME%%\bin
echo %PATH%|find /i "%java_bin%">nul  || setx /M PATH "%PATH%;%java_bin%"

echo Removing downloaded files
rmdir /S /Q %TEMP%\7za920
del /Q %TEMP%\7za920.zip
rmdir /S /Q %TEMP%\openjdk-%jdk_version%
del /Q %TEMP%\%jdk_filename%.tar
del /Q %TEMP%\%jdk_filename%.tar.gz

pause

@echo off

::Ensure we have administrative privileges in order to install files and set environment variables
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' == '0' (
    ::If no error is encountered, we have administrative privileges
    goto GotAdminPrivileges
)
echo Requesting administrative privileges...
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadminprivileges.vbs"
set params = %*:"=""
echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadminprivileges.vbs"
"%temp%\getadminprivileges.vbs"
exit /B
:GotAdminPrivileges
if exist "%temp%\getadminprivileges.vbs" ( del "%temp%\getadminprivileges.vbs" )
pushd "%CD%"
cd /D "%~dp0"

title Install Java

set jdk_version=10.0.2
set jdk_filename=openjdk-%jdk_version%_windows-x64_bin
set jdk_url=https://download.java.net/java/GA/jdk10/%jdk_version%/19aef61b38124481863b1413dce1855f/13/%jdk_filename%.tar.gz

if exist "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%" (
    echo %PROGRAMFILES%\Java\openjdk\jdk-%jdk_version% already exists, skipping install
    goto SetEnvVars
)

echo Downloading required files to %TEMP%
powershell -Command "Invoke-WebRequest %jdk_url% -OutFile $env:temp\%jdk_filename%.tar.gz"
::Download 7zip (command line version) in order to extract the tar.gz file since there is no native support in Windows
powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"

echo Extracting and installing JDK to %PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar.gz" -o"%TEMP%" -r -y
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar" -o"%TEMP%\openjdk-%jdk_version%" -r -y
md "%PROGRAMFILES%\Java\openjdk"
move "%TEMP%\openjdk-%jdk_version%\jdk-%jdk_version%" "%PROGRAMFILES%\Java\openjdk"

echo Removing downloaded files
rmdir /S /Q %TEMP%\7za920
del /Q %TEMP%\7za920.zip
rmdir /S /Q %TEMP%\openjdk-%jdk_version%
del /Q %TEMP%\%jdk_filename%.tar
del /Q %TEMP%\%jdk_filename%.tar.gz

:SetEnvVars
echo Setting environment variables
setx /M JAVA_HOME "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%"
set java_bin=%%JAVA_HOME%%\bin
echo %PATH%|find /i "%java_bin%">nul  || setx /M PATH "%PATH%;%java_bin%"

pause

Update install_java.bat

Update install_java.bat

If the JDK is already installed, there is no need to download,
extract, and install it again. Just need to ensure the environment
variables are set.