REM ###########################################################################
REM #  Copyright (c) 2014-2015 libbitcoin-server developers (see COPYING).
REM #
REM #         GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
REM #
REM ###########################################################################
@echo off
SETLOCAL ENABLEEXTENSIONS
SET parent=%~dp0
SET path_base=%~1
SET nuget_pkg_path=%~1\..\nuget
SET msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3

call :pending "Build initialized..."
IF NOT EXIST "%nuget_pkg_path%" (
  call mkdir "%nuget_pkg_path%"
  IF %ERRORLEVEL% NEQ 0 (
    call :failure "mkdir %nuget_pkg_path% failed."
    exit /b 1
  )
)

call :init libbitcoin libbitcoin master
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin master failed."
  exit /b 1
)
call :init libbitcoin libbitcoin-consensus version2
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin-consensus version2 failed."
  exit /b 1
)
call :init libbitcoin libbitcoin-database master
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin-database master failed."
  exit /b 1
)
call :init libbitcoin libbitcoin-blockchain master
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin-blockchain master failed."
  exit /b 1
)
call :init libbitcoin libbitcoin-network master
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin-network master failed."
  exit /b 1
)
call :init libbitcoin libbitcoin-node master
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin-node master failed."
  exit /b 1
)
call :init libbitcoin libbitcoin-protocol master
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing repository libbitcoin libbitcoin-protocol master failed."
  exit /b 1
)
call :bld_repo libbitcoin-server
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Building libbitcoin-server failed."
  exit /b 1
)

call :success "Build complete."
exit /b 0

:init
call :pending "Initializing repository %~1/%~2/%~3..."
IF NOT EXIST "%path_base%\%~2" (
  call git clone -q --branch=%~3 https://github.com/%~1/%~2 "%path_base%\%~2"
  IF %ERRORLEVEL% NEQ 0 (
    call :failure "git clone %~1/%~2 failed."
    exit /b 1
  )
) ELSE (
  call :success "%path_base%\%~2 exists, assuming valid clone."
)

call :bld_proj %~2
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Building project %~2 failed."
  exit /b 1
)
call :success "Initialization of %~1/%~2/%~3 complete."
exit /b 0

:bld_repo
call :pending "Building respository %~1..."
call :depends "%~1"
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing dependencies %~1 failed."
  exit /b 1
)
call cd /d "%path_base%\%~1\builds\msvc\vs2013"
call msbuild %msbuild_args% %~1.sln
IF %ERRORLEVEL% NEQ 0 (
  call :failure "msbuild %msbuild_args% %~1.sln failed."
  exit /b 1
)
call :success "Building repository %~1 execution complete."
call cd /d "%path_base%"
exit /b 0

:bld_proj
call :pending "Building respository project %~1..."
call :depends %~1
IF %ERRORLEVEL% NEQ 0 (
  call :failure "Initializing dependencies %~1 failed."
  exit /b 1
)
call cd /d "%path_base%\%~1\builds\msvc\vs2013"
call msbuild %msbuild_args% /target:%~1:Rebuild %~1.sln
IF %ERRORLEVEL% NEQ 0 (
  call :failure "msbuildl %msbuild_args% /target:%~1:Rebuild %~1.sln"
  exit /b 1
)
call :success "Building repository project %~1 execution complete."
call cd /d "%path_base%"
exit /b 0

:depends
call :pending "nuget restoring dependencies for %~1..."
call nuget restore "%path_base%\%~1\builds\msvc\vs2013\%~1.sln" -Outputdir "%nuget_pkg_path%"
IF %ERRORLEVEL% NEQ 0 (
  call :failure "nuget restore failed."
  exit /b 1
)
call :success "nuget restoration for %~1 complete."
exit /b 0

:pending
echo %~1
exit /b 0

:success
echo %~1
exit /b 0

:failure
echo %~1
exit /b 0

Remove crlf line endings, rely on autocrlf git setting.


@echo off
cd %~dp0

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

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

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

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

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

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

@echo off
cd %~dp0

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

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

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

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

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

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

Update 'build.cmd' alias parameter to use full name.


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.2.7 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.2.7 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.2.7
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.2.8 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.2.8 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.2.8
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Update BuildLib 0.2.8

Update BuildLib 0.2.8


@echo off
cd %~dp0

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

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

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

:restore
IF EXIST packages\Sake goto getdnx
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
    .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
    .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

:getdnx
IF "%SKIP_DNX_INSTALL%"=="" (
    IF "%BUILDCMD_DNX_VERSION%"=="" (
        BUILDCMD_DNX_VERSION=latest
    )
    CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
    CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
    CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
)

packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=
SET BUILDCMD_DNX_VERSION=

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

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

:restore
IF EXIST packages\Sake goto getdnx
IF "%BUILDCMD_KOREBUILD_VERSION%"=="" (
    .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
    .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

:getdnx
IF "%BUILDCMD_DNX_VERSION%"=="" (
    SET BUILDCMD_DNX_VERSION=latest
)
IF "%SKIP_DNX_INSTALL%"=="" (
    CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
    CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
    CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
)

packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Fix local build break

Fix local build break


@echo off

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

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

setlocal

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.6.0

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

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

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

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

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

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

rem The following link describes the -XX options:
rem http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
rem http://java.sun.com/developer/TechTips/2000/tt1222.html has some more descriptions
rem Unfortunately TechTips no longer seem to be available

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
rem Java 8 remove Permanent generation, don't settings the PermSize
if %current_minor% LEQ "8" (
    rem Increase MaxPermSize if you use a lot of Javascript in your Test Plan :
    set PERM=-XX:PermSize=64m -XX:MaxPermSize=128m
)

set CLASS_UNLOAD=-XX:+CMSClassUnloadingEnabled
rem set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://java.sun.com/products/java-media/2D/perf_graphics.html

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

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

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

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %CLASS_UNLOAD% %DDRAW%

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

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

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

@echo off

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

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

setlocal

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.7.0

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

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

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

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

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

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

rem The following link describes the -XX options:
rem http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
rem http://java.sun.com/developer/TechTips/2000/tt1222.html has some more descriptions
rem Unfortunately TechTips no longer seem to be available

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
rem Java 8 remove Permanent generation, don't settings the PermSize
if %current_minor% LEQ "8" (
    rem Increase MaxPermSize if you use a lot of Javascript in your Test Plan :
    set PERM=-XX:PermSize=64m -XX:MaxPermSize=128m
)

set CLASS_UNLOAD=-XX:+CMSClassUnloadingEnabled
rem set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://java.sun.com/products/java-media/2D/perf_graphics.html

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

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

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

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %CLASS_UNLOAD% %DDRAW%

%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

Update windows jmeter start script to force a minimum of java 7. Thanks Andrey for reminding - again.

Bugzilla Id: 57981

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


@echo off
setlocal

set SCRIPTDIR=%~dp0
set PROJDIR=%SCRIPTDIR%..\..\
set MSBUILDBIN="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"

cd %PROJDIR%

@echo on
set BUILDDIR=%PROJDIR%build_win32\
set OUTPUTDIR=%PROJDIR%output\win32\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
cd ..

set BUILDDIR=%PROJDIR%build_win64\
set OUTPUTDIR=%PROJDIR%output\win64\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015 Win64" -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
cd ..

@echo off
setlocal

set SCRIPTDIR=%~dp0
set PROJDIR=%SCRIPTDIR%..\..\
set MSBUILDBIN="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"

cd %PROJDIR%

@echo on
set BUILDDIR=%PROJDIR%build_win32\
set OUTPUTDIR=%PROJDIR%output\win32\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
cd ..

set BUILDDIR=%PROJDIR%build_win64\
set OUTPUTDIR=%PROJDIR%output\win64\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015 Win64" -DENABLE_AVX2=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
cd ..

enable avx2 for win again.

enable avx2 for win again.


@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  Non-GUI version of JMETER.BAT (WinNT/2K only)
rem
rem  Drop a JMX file on this batch script, and it
rem  will run it in non-GUI mode, with a log file
rem  formed from the input file name but with the
rem  extension .jtl
rem
rem  Only the first parameter is used.
rem  Only works for Win2k.
rem
rem  ============================================

if "%OS%"=="Windows_NT" goto WinNT
echo "Sorry, this command file requires Windows NT/ 2000 / XP"
pause
goto END
:WinNT

rem Check file is supplied
if a == a%1 goto winNT2

rem Allow special name LAST
if LAST == %1 goto winNT3

rem Check it has extension .jmx
if "%~x1" == ".jmx" goto winNT3
:winNT2
echo Please supply a script name with the extension .jmx
pause
goto END
:winNT3

rem Change to script directory
pushd %~dp1

rem use same directory to find jmeter script
call "%~dp0"jmeter -n -t "%~nx1" -j "%~n1.log" -l "%~n1.jtl"

popd

: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  Non-GUI version of JMETER.BAT (WinNT/2K only)
rem
rem  Drop a JMX file on this batch script, and it
rem  will run it in non-GUI mode, with a log file
rem  formed from the input file name but with the
rem  extension .jtl
rem
rem  Only the first parameter is used.
rem  Only works for Win2k.
rem
rem  ============================================

if "%OS%"=="Windows_NT" goto WinNT
echo "Sorry, this command file requires Windows NT/ 2000 / XP"
pause
goto END
:WinNT

rem Check file is supplied
if a == a%1 goto winNT2

rem Allow special name LAST
if LAST == %1 goto winNT3

rem Check it has extension .jmx
if "%~x1" == ".jmx" goto winNT3
:winNT2
echo Please supply a script name with the extension .jmx
pause
goto END
:winNT3

rem Change to script directory
pushd %~dp1

rem use same directory to find jmeter script
call "%~dp0"jmeter -n -t "%~nx1" -j "%~n1.log" -l "%~n1.jtl" %2 %3 %4 %5 %6 %7 %8 %9

popd

:END

Allow additional paramters to be passed in

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

Former-commit-id: 36d43bc3f11390bfe25d6d7f0423ee27e706b011


@echo off

if NOT EXIST "variables.bat" (
    rem No variable file defined
    shutdown -s -t 0
)
rem Source variables
call variables.bat
if NOT EXIST %reportURLFile% (
    rem No report URL file defined
    shutdown -s -t 0
)
if NOT EXIST %srcDir% (
    rem No source dir defined
    shutdown -s -t 0
)

SET /P reportURL=<%reportURLFile%
SET userAgent="CCX/CI_BOT"
SET logFile="%reportFolder%/log.html"

call :postStatus "preparation" "Copy testsuite to local folder"
call :executeCommand robocopy %suiteSrcDir% %suiteDstDir% /e

call :postStatus "preparation" "Copy code to local folder"
call :executeCommand robocopy %srcDir% %dstDir% /e
call :executeCommand cd %dstDir%

call :postStatus "building" "Compiling CCExtractor"
rem Go to Windows build folder
call :executeCommand cd windows
rem Build CCExtractor using the sln script
call :executeCommand "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild" ccextractor.sln
rem check whether installation successful
if EXIST Debug\ccextractorwin.exe (
    cd Debug
    rem Run testsuite
    call :postStatus "testing" "Running tests"
    call :executeCommand cd %suiteDstDir%
    call :executeCommand "%tester%" --entries "%testFile%" --executable "%dstDir%\windows\Debug\ccextractorwin.exe" --tempfolder "%tempFolder%" --timeout 3000 --reportfolder "%reportFolder%" --resultfolder "%resultFolder%" --samplefolder "%sampleFolder%" --method Server --url "%reportURL%"
    call :postStatus "completed" "Ran all tests"
    rem Shut down
    shutdown -s -t 0
)
else
(
    call :haltAndCatchFire "build"
)
EXIT /B %ERRORLEVEL%
rem Functions to shorten the script

rem Fail when the exit status is not equal to 0
:executeCommand
%* >> "%logFile%"
SET /A status=%ERRORLEVEL%
IF %status% NEQ 0 (
    rem No message needed as we post before anyway
    call :haltAndCatchFire ""
)
EXIT /B 0

rem Post status to the server
:postStatus
curl -s -A "%userAgent%" --data "type=progress&status=%~1&message=%~2" -w "\n" "%reportURL%" >> "%logFile%"
EXIT /B 0

rem Exit script and post abort status
:haltAndCatchFire
call :postStatus "canceled" %~1 >> "%logFile%"
shutdown -s -t 0
EXIT /B 0

@echo off

if NOT EXIST "variables.bat" (
    rem No variable file defined
    shutdown -s -t 0
)
rem Source variables
call variables.bat
if NOT EXIST %reportURLFile% (
    rem No report URL file defined
    shutdown -s -t 0
)
if NOT EXIST %srcDir% (
    rem No source dir defined
    shutdown -s -t 0
)

SET /P reportURL=<%reportURLFile%
SET userAgent="CCX/CI_BOT"
SET logFile="%reportFolder%/log.html"

call :postStatus "preparation" "Copy testsuite to local folder"
call :executeCommand robocopy %suiteSrcDir% %suiteDstDir% /e

call :postStatus "preparation" "Copy code to local folder"
call :executeCommand robocopy %srcDir% %dstDir% /e
call :executeCommand cd %dstDir%

call :postStatus "building" "Compiling CCExtractor"
rem Go to Windows build folder
call :executeCommand cd windows
rem Build CCExtractor using the sln script
call :executeCommand "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild" ccextractor.sln
rem check whether installation successful
if EXIST Debug\ccextractorwin.exe (
    cd Debug
    rem Run testsuite
    call :postStatus "testing" "Running tests"
    call :executeCommand cd %suiteDstDir%
    call :executeCommand "%tester%" --entries "%testFile%" --executable "%dstDir%\windows\Debug\ccextractorwin.exe" --tempfolder "%tempFolder%" --timeout 3000 --reportfolder "%reportFolder%" --resultfolder "%resultFolder%" --samplefolder "%sampleFolder%" --method Server --url "%reportURL%"
    call :postStatus "completed" "Ran all tests"
    rem Shut down
    shutdown -s -t 0
)
else
(
    call :haltAndCatchFire "build"
)
EXIT /B %ERRORLEVEL%
rem Functions to shorten the script

rem Fail when the exit status is not equal to 0
:executeCommand
echo %* >> "%logFile%"
%* >> "%logFile%"
SET /A status=%ERRORLEVEL%
IF %status% NEQ 0 (
    echo Command exited with %status% >> "%logFile%"
    rem No message needed as we post before anyway
    call :haltAndCatchFire ""
)
EXIT /B 0

rem Post status to the server
:postStatus
curl -s -A "%userAgent%" --data "type=progress&status=%~1&message=%~2" -w "\n" "%reportURL%" >> "%logFile%"
EXIT /B 0

rem Exit script and post abort status
:haltAndCatchFire
call :postStatus "canceled" %~1 >> "%logFile%"
shutdown -s -t 0
EXIT /B 0

Update file

Update file


cmake -G"NMake Makefiles" ^
  -DBUILD_SHARED_LIBS:BOOL=ON ^
  -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
  -DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
  -DCMAKE_BUILD_TYPE:STRING=Release ^
  "%SRC_DIR%"
if errorlevel 1 exit 1

nmake
if errorlevel 1 exit 1

nmake install
if errorlevel 1 exit 1

nmake test
if errorlevel 1 exit 1

add nmake test

add nmake test


@echo off

rem Get current assembly version in environment variable
for /f %%i in ('PowerShell -File Scripts\get-version.ps1') do set CUSTOM_MAJOR_VERSION=%%i

set CUSTOM_VERSION=%CUSTOM_MAJOR_VERSION%.%APPVEYOR_BUILD_NUMBER%
set CUSTOM_INFORMATIONAL_VERSION=%CUSTOM_VERSION%

if not %APPVEYOR_REPO_BRANCH%==master ( set CUSTOM_INFORMATIONAL_VERSION=%CUSTOM_INFORMATIONAL_VERSION%-prerelease )

set APPVEYOR_BUILD_VERSION=%CUSTOM_INFORMATIONAL_VERSION%

echo Patched version: %CUSTOM_VERSION%
echo Patched informational version: %CUSTOM_INFORMATIONAL_VERSION%
echo AppVeyor build version: %APPVEYOR_BUILD_VERSION%

@echo off

echo Patching version numbers...

rem Get current assembly version in environment variable
for /f %%i in ('PowerShell -File Scripts\get-version.ps1') do set CUSTOM_MAJOR_VERSION=%%i

set CUSTOM_VERSION=%CUSTOM_MAJOR_VERSION%.%APPVEYOR_BUILD_NUMBER%
set CUSTOM_INFORMATIONAL_VERSION=%CUSTOM_VERSION%

if not %APPVEYOR_REPO_BRANCH%==master ( set CUSTOM_INFORMATIONAL_VERSION=%CUSTOM_INFORMATIONAL_VERSION%-prerelease )

set APPVEYOR_BUILD_VERSION=%APPVEYOR_REPO_BRANCH%-%CUSTOM_INFORMATIONAL_VERSION%
appveyor UpdateBuild -Version "%APPVEYOR_BUILD_VERSION%"

echo Patched version: %CUSTOM_VERSION%
echo Patched informational version: %CUSTOM_INFORMATIONAL_VERSION%
echo AppVeyor build version: %APPVEYOR_BUILD_VERSION%

Update AppVeyor build version with branch and assembly version.


@echo off
rem
rem function install
rem

setlocal ENABLEEXTENSIONS

set serviceName=Neo4j-Server
set serviceDisplayName="Neo4j Graph Database"
set serviceStartType=auto
set classpath="\"-DserverClasspath=lib/*.jar;system/lib/*.jar;plugins/**/*.jar;./conf*\""
set mainclass="\"-DserverMainClass=#{neo4j.mainClass}\""
set configFile="\"conf\neo4j-wrapper.conf\""
set wrapperJarFilename=windows-service-wrapper-5.jar

if NOT [%2]==[] set serviceName=%2
if NOT [%3]==[] set serviceDisplayName=%3

if NOT %serviceName: =% == %serviceName% goto :usage

rem if NOT "%2" == "" set serviceName=%2
rem if NOT "%3" == "" set serviceDisplayName="%3"

goto :main %1 %2 %3

:getStatus
  set status=""

  rem get the state line from the sc output
  for /F "tokens=1,2 delims=:" %%a in ('sc query %serviceName%^|findstr "STATE"') do set status=%%b

  rem Remove ALL space, concatenating the numerical and the string - no prob
  set status=%status: =%

  rem done, if non existent it will be empty
  rem note that the strings we compare to normally
  rem have two spaces between numerical and
  rem string description. The substitution
  rem above swallowed these, though
  if "%status%" == "4RUNNING" (
    set status="RUNNING"
  ) else if "%status%" == "1STOPPED" (
    set status="STOPPED"
  ) else (
    set status="NOT INSTALLED"
  )
  goto:eof

:status
  call :getStatus
  echo %status%
  goto :eof

:install
  call "%~dps0functions.bat" :findJavaHome
  if not "%javaHomeError%" == "" (
    echo %javaHomeError%
    call:instructions
    goto:eof
  )

  call:verifySupportedJavaVersion
  if not "%javaVersionError%" == "" (
    echo %javaVersionError%
    call:instructions
    goto:eof
  )
  rem Remove quotes from javaPath so that it can have /bin/java appended to it
  rem See http://ss64.com/nt/syntax-esc.html, "Removing quotes"
  set javaPath=###%javaPath%###
  set javaPath=%javaPath:"###=%
  set javaPath=%javaPath:###"=%
  set javaPath=%javaPath:###=%

  set binPath="\"%javaPath%\bin\java.exe\" -DworkingDir=\"%~dps0..\" -DconfigFile=%configFile% %classpath% %mainclass% -Dorg.neo4j.cluster.logdirectory=\"%~dps0..\data\log\" -jar \"%~dps0%wrapperJarFilename%\"  %serviceName%"

  sc create "%serviceName%" binPath= %binPath% DisplayName= "%serviceDisplayName:"=%" start= %serviceStartType%
  sc start %serviceName%
  @echo off
  goto :eof

:remove
  call :stop
  sc delete %serviceName%
  goto :eof

:start
  call :getStatus
  if %status% == "NOT INSTALLED" (
    call:console
  ) else if %status% == "RUNNING" (
    echo Service is already running, no action taken
  ) else (
    sc start %serviceName%
  )
  goto :eof

:stop
  sc stop %serviceName%
  goto:eof

:restart
  call :stop
  call :start
  goto :eof

:usage
  echo Usage: %~0Neo4jInstaller.bat ^<install^|remove^> [service name] [service display name]
  echo        - Service Name - Optional, must NOT contain spaces
  echo        - Service Display Name - Optional, The name displayed in the services window, surround with quotes to use spaces
  goto:eof

:main
  if "%1" == "" goto :usage
  if "%1" == "remove"  goto :remove
  if "%1" == "install" goto :install
  if "%1" == "stop" goto :stop
  if "%1" == "start" goto :start
  if "%1" == "status" goto :status
  call :usage
  goto :eof

rem end function remove

:verifySupportedJavaVersion

  set javaVersionError=
  set javaCommand=%javaPath:"=%\bin\java.exe

  rem Remove leading spaces
  for /f "tokens=* delims= " %%a in ("%javaCommand%") do set javaCommand=%%a

  rem Find version
  for /f "usebackq tokens=3" %%g in (`"%javaCommand%" -version 2^>^&1`) do (
      set JAVAVER=%%g
      goto:breakJavaVersionLoop
  )
  :breakJavaVersionLoop

  set JAVAVER=%JAVAVER:"=%
  set "JAVAVER=%JAVAVER:~0,3%"

  if "%JAVAVER%"=="1.7" goto:eof
  if "%JAVAVER%"=="1.8" (
    echo ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
    goto:eof
  )
  set javaVersionError=ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
  goto:eof

:instructions
  echo * Please use Oracle(R) Java(TM) 7 to run Neo4j Server. Download "Java Platform (JDK) 7" from:
  echo   http://www.oracle.com/technetwork/java/javase/downloads/index.html
  echo * Please see http://neo4j.com/docs/ for Neo4j Server installation instructions.
  goto:eof

@echo off
rem
rem function install
rem

setlocal ENABLEEXTENSIONS

set serviceName=Neo4j-Server
set serviceDisplayName="Neo4j Graph Database"
set serviceStartType=auto
set classpath="\"-DserverClasspath=lib/*.jar;system/lib/*.jar;plugins/**/*.jar;./conf*\""
set mainclass="\"-DserverMainClass=#{neo4j.mainClass}\""
set configFile="\"conf\neo4j-wrapper.conf\""
set wrapperJarFilename=windows-service-wrapper-5.jar

if NOT [%2]==[] set serviceName=%2
if NOT [%3]==[] set serviceDisplayName=%3

if NOT %serviceName: =% == %serviceName% goto :usage

rem if NOT "%2" == "" set serviceName=%2
rem if NOT "%3" == "" set serviceDisplayName="%3"

goto :main %1 %2 %3

:getStatus
  set status=""

  rem get the state line from the sc output
  for /F "tokens=1,2 delims=:" %%a in ('sc query %serviceName%^|findstr "STATE"') do set status=%%b

  rem Remove ALL space, concatenating the numerical and the string - no prob
  set status=%status: =%

  rem done, if non existent it will be empty
  rem note that the strings we compare to normally
  rem have two spaces between numerical and
  rem string description. The substitution
  rem above swallowed these, though
  if "%status%" == "4RUNNING" (
    set status="RUNNING"
  ) else if "%status%" == "1STOPPED" (
    set status="STOPPED"
  ) else (
    set status="NOT INSTALLED"
  )
  goto:eof

:status
  call :getStatus
  echo %status%
  goto :eof

:install
  call "%~dps0functions.bat" :findJavaHome
  if not "%javaHomeError%" == "" (
    echo %javaHomeError%
    call:instructions
    goto:eof
  )

  call:verifySupportedJavaVersion
  if not "%javaVersionError%" == "" (
    echo %javaVersionError%
    call:instructions
    goto:eof
  )
  rem Remove quotes from javaPath so that it can have /bin/java appended to it
  rem See http://ss64.com/nt/syntax-esc.html, "Removing quotes"
  set javaPath=###%javaPath%###
  set javaPath=%javaPath:"###=%
  set javaPath=%javaPath:###"=%
  set javaPath=%javaPath:###=%

  set binPath="\"%javaPath%\bin\java.exe\" -DworkingDir=\"%~dps0..\" -DconfigFile=%configFile% %classpath% %mainclass% -Dorg.neo4j.cluster.logdirectory=\"%~dps0..\data\log\" -jar \"%~dps0%wrapperJarFilename%\"  %serviceName%"

  sc create "%serviceName%" binPath= %binPath% DisplayName= "%serviceDisplayName:"=%" start= %serviceStartType%
  sc start %serviceName%
  @echo off
  goto :eof

:remove
  call :stop
  sc delete %serviceName%
  goto :eof

:start
  call :getStatus
  if %status% == "NOT INSTALLED" (
    call:console
  ) else if %status% == "RUNNING" (
    echo Service is already running, no action taken
  ) else (
    sc start %serviceName%
  )
  goto :eof

:stop
  sc stop %serviceName%
  goto:eof

:restart
  call :stop
  call :start
  goto :eof

:usage
  echo Usage: %~0Neo4jInstaller.bat ^<install^|remove^> [service name] [service display name]
  echo        - Service Name - Optional, must NOT contain spaces
  echo        - Service Display Name - Optional, The name displayed in the services window, surround with quotes to use spaces
  goto:eof

:main
  if "%1" == "" goto :usage
  if "%1" == "remove"  goto :remove
  if "%1" == "install" goto :install
  if "%1" == "stop" goto :stop
  if "%1" == "start" goto :start
  if "%1" == "status" goto :status
  call :usage
  goto :eof

rem end function remove

:verifySupportedJavaVersion

  set javaVersionError=
  set javaCommand=%javaPath:"=%\bin\java.exe

  rem Remove leading spaces
  for /f "tokens=* delims= " %%a in ("%javaCommand%") do set javaCommand=%%a

  rem Find version
  for /f "usebackq tokens=3" %%g in (`"%javaCommand%" -version 2^>^&1`) do (
      set JAVAVER=%%g
      goto:breakJavaVersionLoop
  )
  :breakJavaVersionLoop

  set JAVAVER=%JAVAVER:"=%
  set "JAVAVER=%JAVAVER:~0,3%"

  if "%JAVAVER%"=="1.7" goto:eof
  set javaVersionError=ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
  goto:eof

:instructions
  echo * Please use Oracle(R) Java(TM) 7 to run Neo4j Server. Download "Java Platform (JDK) 7" from:
  echo   http://www.oracle.com/technetwork/java/javase/downloads/index.html
  echo * Please see http://neo4j.com/docs/ for Neo4j Server installation instructions.
  goto:eof

Remove Java 1.8 error check

Remove Java 1.8 error check


@ECHO OFF & SETLOCAL EnableDelayedExpansion
TITLE ghacks user.js updater

REM ## ghacks-user.js updater for Windows
REM ## author: @claustromaniac
REM ## version: 4.8
REM ## instructions: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts

SET v=4.8

VERIFY ON
CD /D "%~dp0"
SET _myname=%~n0
SET _myparams=%*

:parse
IF "%~1"=="" (GOTO endparse)
IF /I "%~1"=="-unattended" (SET _ua=1)
IF /I "%~1"=="-log" (SET _log=1)
IF /I "%~1"=="-logp" (SET _log=1 & SET _logp=1)
IF /I "%~1"=="-multioverrides" (SET _multi=1)
IF /I "%~1"=="-merge" (SET _merge=1)
IF /I "%~1"=="-updatebatch" (SET _updateb=1)
IF /I "%~1"=="-singlebackup" (SET _singlebackup=1)
IF /I "%~1"=="-esr" (SET _esr=1)
SHIFT
GOTO parse
:endparse

IF DEFINED _updateb (
	REM The normal flow here goes from phase 1 to phase 2 and then phase 3.
	IF NOT "!_myname:~0,9!"=="[updated]" (
		IF EXIST "[updated]!_myname!.bat" (
			REM ## Phase 3 ##: The new script, with the original name, will:
			REM 	* Delete the [updated]*.bat and *.bat.old scripts
			REM 	* Begin the normal routine
			FC "[updated]!_myname!.bat" "!_myname!.bat.old" >nul
			IF NOT "!errorlevel!"=="0" (
				CALL :message "Script updated to version !v!"
				TIMEOUT 3 >nul
			)
			REN "[updated]!_myname!.bat" "[updated]!_myname!.bat.old"
			DEL /F "!_myname!.bat.old" "[updated]!_myname!.bat.old"
			GOTO begin
		)
		REM ## Phase 1 ##
		REM 	* Download new batch and name it [updated]*.bat
		REM 	* Start that script in a new CMD window
		REM 	* Exit
		CALL :message "Updating script..."
		REM Uncomment the next line and comment out the PowerShell call for testing.
		REM COPY /B /Y "!_myname!.bat" "[updated]!_myname!.bat" >nul
		(
			PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/updater.bat', '[updated]!_myname!.bat')"
		) >nul 2>&1
		IF EXIST "[updated]!_myname!.bat" (
			START /min CMD /C "[updated]!_myname!.bat" !_myparams!
		) ELSE (
			CALL :message "Failed. Make sure PowerShell is allowed internet access."
			TIMEOUT 120 >nul
		)
	) ELSE (
		IF "!_myname!"=="[updated]" (
			CALL :message "The [updated] label is reserved. Rename this script and try again."
			TIMEOUT 300 >nul
		) ELSE (
			REM ## Phase 2 ##: The [updated]*.bat script will:
			REM 	* Rename the old script and make a copy of itself with the original name.
			REM 	* Run that copy in a new CMD instance
			REM 	* Exit
			IF EXIST "!_myname:~9!.bat" ( REN "!_myname:~9!.bat" "!_myname:~9!.bat.old" )
			COPY /B /Y "!_myname!.bat" "!_myname:~9!.bat"
			START CMD /C "!_myname:~9!.bat" !_myparams!
		)
	)
	EXIT /B
)

:begin
CLS
ECHO:
ECHO:
ECHO:                ########################################
ECHO:                ####  user.js Updater for Windows   ####
ECHO:                ####       by claustromaniac        ####
ECHO:                ####             v!v!               ####
ECHO:                ########################################
ECHO:
SET /A "_line=0"
IF NOT EXIST user.js (
	CALL :message "user.js not detected in the current directory."
) ELSE (
	FOR /F "skip=1 tokens=1,* delims=:" %%G IN (user.js) DO (
		SET /A "_line+=1"
		IF !_line! GEQ 4 (GOTO exitloop)
		IF !_line! EQU 1 (SET _name=%%H)
		IF !_line! EQU 2 (SET _date=%%H)
		IF !_line! EQU 3 (SET _version=%%G)
	)
	:exitloop
	IF NOT "!_name!"=="" (
		IF /I NOT "!_name!"=="!_name:ghacks=!" (
			CALL :message "!_name! !_version:~2!,!_date!"
		) ELSE (CALL :message "Current user.js version not recognised.")
	) ELSE (CALL :message "Current user.js version not recognised.")
)
ECHO:
IF NOT DEFINED _ua (
	CALL :message "This batch should be run from your Firefox profile directory."
	ECHO:  It will download the latest version of ghacks user.js from github and then
	CALL :message "append any of your own changes from user-overrides.js to it."
	CALL :message "Visit the wiki for more detailed information."
	ECHO:
	TIMEOUT 1 /nobreak >nul
	CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
	CLS
	IF ERRORLEVEL 3 (EXIT /B)
	IF ERRORLEVEL 2 (GOTO :showhelp)
)
IF DEFINED _log (
	CALL :log >>user.js-update-log.txt 2>&1
	IF DEFINED _logp (START user.js-update-log.txt)
	EXIT /B
	:log
	SET _log=2
	ECHO:##################################################################
	ECHO:  %date%, %time%
)
IF EXIST user.js.new (DEL /F "user.js.new")
CALL :message "Retrieving latest user.js file from github repository..."
(
	PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js', 'user.js.new')"
) >nul 2>&1
IF EXIST user.js.new (
	IF DEFINED _esr (
		CALL :message "Activating ESR section..."
		CALL :esr user.js.new
	)
	IF DEFINED _multi (
		FORFILES /P user.js-overrides /M *.js >nul 2>&1
		IF NOT ERRORLEVEL 1 (
			IF DEFINED _merge (
				CALL :message "Merging..."
				COPY /B /Y user.js-overrides\*.js user-overrides-merged.js
				CALL :merge user-overrides-merged.js
				COPY /B /Y user.js.new+user-overrides-merged.js user.js.new
				CALL :merge user.js.new
			) ELSE (
				CALL :message "Appending..."
				COPY /B /Y user.js.new+"user.js-overrides\*.js" user.js.new
			)
		) ELSE (CALL :message "No override files found.")
	) ELSE (
		IF EXIST "user-overrides.js" (
			COPY /B /Y user.js.new+"user-overrides.js" "user.js.new"
			IF DEFINED _merge (
				CALL :message "Merging user-overrides.js..."
				CALL :merge user.js.new
			) ELSE (
				CALL :message "user-overrides.js appended."
			)
		) ELSE (CALL :message "user-overrides.js not found.")
	)
	IF EXIST user.js (
		FC user.js.new user.js >nul && SET "_changed=false" || SET "_changed=true"
	)
	IF "!_changed!"=="true" (
		CALL :message "Backing up..."
		IF DEFINED _singlebackup (
			MOVE /Y user.js user.js.bak >nul
		) ELSE (
			SET "_time=!time: =0!"
			MOVE /Y user.js "user-backup-!date:/=-!_!_time::=.!.js" >nul
		)
		REN user.js.new user.js
		CALL :message "Update complete."
	) ELSE (
		IF "!_changed!"=="false" (
			DEL /F user.js.new >nul
			CALL :message "Update completed without changes."
		) ELSE (
			REN user.js.new user.js
			CALL :message "Update complete."
			SET "_changed=true"
		)
	)
) ELSE (
	CALL :message "Update failed. Make sure PowerShell is allowed internet access."
	ECHO:  No changes were made.
)
IF NOT DEFINED _log (
	IF NOT DEFINED _ua (
		IF EXIST prefsCleaner.bat (
			IF "!_changed!"=="true" (
				CALL :message "Would you like to run the prefsCleaner now?"
				CHOICE /C YN /N /M "(Y/N) "
				IF "1"=="!errorlevel!" ( START "" cmd.exe /C "prefsCleaner.bat" )
			) ELSE (PAUSE)
		) ELSE (PAUSE)
	)
)
EXIT /B

REM ########### Message Function ###########
:message
SETLOCAL DisableDelayedExpansion
IF NOT "2"=="%_log%" (ECHO:)
ECHO:  %~1
IF NOT "2"=="%_log%" (ECHO:)
ENDLOCAL
GOTO :EOF

REM ############ ESR Function ############
:esr
SETLOCAL DisableDelayedExpansion
(
	FOR /F "tokens=1,* delims=:" %%G IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%H"
		SETLOCAL EnableDelayedExpansion
		IF NOT "!_temp:~-37!"==".x still uses all the following prefs" (
			ENDLOCAL & ECHO:%%H
		) ELSE (
			ECHO://!_temp:~2!
			ENDLOCAL
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

REM ############ Merge Function ############
:merge
SETLOCAL DisableDelayedExpansion
FOR /F tokens^=2^,^*^ delims^=^'^" %%G IN ('FINDSTR /R /C:"^user_pref[ 	]*\([ 	]*[\"'].*[\"'][ 	]*,.*\)[ 	]*;" "%~1"') DO (SET "[%%G]=%%H")
FOR /F tokens^=2^,^*^ delims^=^' %%G IN ('FINDSTR /R /C:"^//// --- comment-out --- '[^'][^']*'.*" "%~1"') DO (SET "__unset__%%G=1")
(
	FOR /F "tokens=1,* delims=:" %%I IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%J"
		SETLOCAL EnableDelayedExpansion
		IF NOT "!_temp:~0,9!"=="user_pref" (
			ENDLOCAL & ECHO:%%J
		) ELSE (
			IF "!_temp:;=!"=="!_temp!" (
				ENDLOCAL & ECHO:%%J
			) ELSE (
				ENDLOCAL
				FOR /F tokens^=2^ delims^=^'^" %%K IN ("%%J") DO (
					IF NOT "_user.js.parrot"=="%%K" (
						IF DEFINED __unset__%%K (
							ECHO://%%J
						) ELSE (
							IF DEFINED [%%K] (
								SETLOCAL EnableDelayedExpansion
								FOR /F "delims=" %%L IN ("![%%K]!") DO (
									ENDLOCAL & ECHO:user_pref("%%K"%%L
									SET "[%%K]="
								)
							)
						)
					) ELSE (ECHO:%%J)
				)
			)
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

REM ############### Help ##################
:showhelp
MODE 80,50
CLS
CALL :message "Available arguments (case-insensitive):"
CALL :message "  -esr"
ECHO:     Activate ESR related preferences
CALL :message "  -log"
ECHO:     Write the console output to a logfile (user.js-update-log.txt)
CALL :message "  -logP"
ECHO:     Like -log, but also open the logfile after updating.
CALL :message "  -merge"
ECHO:     Merge overrides instead of appending them. Single-line comments and
ECHO:     _user.js.parrot lines are appended normally. Overrides for inactive
ECHO:     user.js prefs will be appended. When -Merge and -MultiOverrides are used
ECHO:     together, a user-overrides-merged.js file is also generated in the root
ECHO:     directory for quick reference. It contains only the merged data from
ECHO:     override files and can be safely discarded after updating, or used as the
ECHO:     new user-overrides.js. When there are conflicting records for the same
ECHO:     pref, the value of the last one declared will be used. Visit the wiki
ECHO:     for usage examples and more detailed information.
CALL :message "  -multiOverrides"
ECHO:     Use any and all .js files in a user.js-overrides sub-folder as overrides
ECHO:     instead of the default user-overrides.js file. Files are appended in
ECHO:     alphabetical order.
CALL :message "  -unattended"
ECHO:     Run without user input.
CALL :message "  -singleBackup"
ECHO:     Use a single backup file and overwrite it on new updates, instead of
ECHO:     cumulative backups. This was the default behaviour before v4.3.
CALL :message "  -updatebatch"
ECHO:     Update the script itself on execution, before the normal routine.
CALL :message ""
PAUSE
MODE 80,25
GOTO :begin

@ECHO OFF & SETLOCAL EnableDelayedExpansion
TITLE ghacks user.js updater

REM ## ghacks-user.js updater for Windows
REM ## author: @claustromaniac
REM ## version: 4.8
REM ## instructions: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts

SET v=4.8

VERIFY ON
CD /D "%~dp0"
SET _myname=%~n0
SET _myparams=%*

:parse
IF "%~1"=="" (GOTO endparse)
IF /I "%~1"=="-unattended" (SET _ua=1)
IF /I "%~1"=="-log" (SET _log=1)
IF /I "%~1"=="-logp" (SET _log=1 & SET _logp=1)
IF /I "%~1"=="-multioverrides" (SET _multi=1)
IF /I "%~1"=="-merge" (SET _merge=1)
IF /I "%~1"=="-updatebatch" (SET _updateb=1)
IF /I "%~1"=="-singlebackup" (SET _singlebackup=1)
IF /I "%~1"=="-esr" (SET _esr=1)
IF /I "%~1"=="-rfpalts" (SET _rfpalts=1)
SHIFT
GOTO parse
:endparse

IF DEFINED _updateb (
	REM The normal flow here goes from phase 1 to phase 2 and then phase 3.
	IF NOT "!_myname:~0,9!"=="[updated]" (
		IF EXIST "[updated]!_myname!.bat" (
			REM ## Phase 3 ##: The new script, with the original name, will:
			REM 	* Delete the [updated]*.bat and *.bat.old scripts
			REM 	* Begin the normal routine
			FC "[updated]!_myname!.bat" "!_myname!.bat.old" >nul
			IF NOT "!errorlevel!"=="0" (
				CALL :message "Script updated to version !v!"
				TIMEOUT 3 >nul
			)
			REN "[updated]!_myname!.bat" "[updated]!_myname!.bat.old"
			DEL /F "!_myname!.bat.old" "[updated]!_myname!.bat.old"
			GOTO begin
		)
		REM ## Phase 1 ##
		REM 	* Download new batch and name it [updated]*.bat
		REM 	* Start that script in a new CMD window
		REM 	* Exit
		CALL :message "Updating script..."
		REM Uncomment the next line and comment out the PowerShell call for testing.
		REM COPY /B /Y "!_myname!.bat" "[updated]!_myname!.bat" >nul
		(
			PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/updater.bat', '[updated]!_myname!.bat')"
		) >nul 2>&1
		IF EXIST "[updated]!_myname!.bat" (
			START /min CMD /C "[updated]!_myname!.bat" !_myparams!
		) ELSE (
			CALL :message "Failed. Make sure PowerShell is allowed internet access."
			TIMEOUT 120 >nul
		)
	) ELSE (
		IF "!_myname!"=="[updated]" (
			CALL :message "The [updated] label is reserved. Rename this script and try again."
			TIMEOUT 300 >nul
		) ELSE (
			REM ## Phase 2 ##: The [updated]*.bat script will:
			REM 	* Rename the old script and make a copy of itself with the original name.
			REM 	* Run that copy in a new CMD instance
			REM 	* Exit
			IF EXIST "!_myname:~9!.bat" ( REN "!_myname:~9!.bat" "!_myname:~9!.bat.old" )
			COPY /B /Y "!_myname!.bat" "!_myname:~9!.bat"
			START CMD /C "!_myname:~9!.bat" !_myparams!
		)
	)
	EXIT /B
)

:begin
CLS
ECHO:
ECHO:
ECHO:                ########################################
ECHO:                ####  user.js Updater for Windows   ####
ECHO:                ####       by claustromaniac        ####
ECHO:                ####             v!v!               ####
ECHO:                ########################################
ECHO:
SET /A "_line=0"
IF NOT EXIST user.js (
	CALL :message "user.js not detected in the current directory."
) ELSE (
	FOR /F "skip=1 tokens=1,* delims=:" %%G IN (user.js) DO (
		SET /A "_line+=1"
		IF !_line! GEQ 4 (GOTO exitloop)
		IF !_line! EQU 1 (SET _name=%%H)
		IF !_line! EQU 2 (SET _date=%%H)
		IF !_line! EQU 3 (SET _version=%%G)
	)
	:exitloop
	IF NOT "!_name!"=="" (
		IF /I NOT "!_name!"=="!_name:ghacks=!" (
			CALL :message "!_name! !_version:~2!,!_date!"
		) ELSE (CALL :message "Current user.js version not recognised.")
	) ELSE (CALL :message "Current user.js version not recognised.")
)
ECHO:
IF NOT DEFINED _ua (
	CALL :message "This batch should be run from your Firefox profile directory."
	ECHO:  It will download the latest version of ghacks user.js from github and then
	CALL :message "append any of your own changes from user-overrides.js to it."
	CALL :message "Visit the wiki for more detailed information."
	ECHO:
	TIMEOUT 1 /nobreak >nul
	CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
	CLS
	IF ERRORLEVEL 3 (EXIT /B)
	IF ERRORLEVEL 2 (GOTO :showhelp)
)
IF DEFINED _log (
	CALL :log >>user.js-update-log.txt 2>&1
	IF DEFINED _logp (START user.js-update-log.txt)
	EXIT /B
	:log
	SET _log=2
	ECHO:##################################################################
	ECHO:  %date%, %time%
)
IF EXIST user.js.new (DEL /F "user.js.new")
CALL :message "Retrieving latest user.js file from github repository..."
(
	PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js', 'user.js.new')"
) >nul 2>&1
IF EXIST user.js.new (
	IF DEFINED _esr (
		CALL :message "Activating ESR section..."
		CALL :esr user.js.new
	)
	IF DEFINED _rfpalts (
		CALL :message "Activating RFP Alternatives section..."
		CALL :rfpalts user.js.new
	)
	IF DEFINED _multi (
		FORFILES /P user.js-overrides /M *.js >nul 2>&1
		IF NOT ERRORLEVEL 1 (
			IF DEFINED _merge (
				CALL :message "Merging..."
				COPY /B /Y user.js-overrides\*.js user-overrides-merged.js
				CALL :merge user-overrides-merged.js
				COPY /B /Y user.js.new+user-overrides-merged.js user.js.new
				CALL :merge user.js.new
			) ELSE (
				CALL :message "Appending..."
				COPY /B /Y user.js.new+"user.js-overrides\*.js" user.js.new
			)
		) ELSE (CALL :message "No override files found.")
	) ELSE (
		IF EXIST "user-overrides.js" (
			COPY /B /Y user.js.new+"user-overrides.js" "user.js.new"
			IF DEFINED _merge (
				CALL :message "Merging user-overrides.js..."
				CALL :merge user.js.new
			) ELSE (
				CALL :message "user-overrides.js appended."
			)
		) ELSE (CALL :message "user-overrides.js not found.")
	)
	IF EXIST user.js (
		FC user.js.new user.js >nul && SET "_changed=false" || SET "_changed=true"
	)
	IF "!_changed!"=="true" (
		CALL :message "Backing up..."
		IF DEFINED _singlebackup (
			MOVE /Y user.js user.js.bak >nul
		) ELSE (
			SET "_time=!time: =0!"
			MOVE /Y user.js "user-backup-!date:/=-!_!_time::=.!.js" >nul
		)
		REN user.js.new user.js
		CALL :message "Update complete."
	) ELSE (
		IF "!_changed!"=="false" (
			DEL /F user.js.new >nul
			CALL :message "Update completed without changes."
		) ELSE (
			REN user.js.new user.js
			CALL :message "Update complete."
			SET "_changed=true"
		)
	)
) ELSE (
	CALL :message "Update failed. Make sure PowerShell is allowed internet access."
	ECHO:  No changes were made.
)
IF NOT DEFINED _log (
	IF NOT DEFINED _ua (
		IF EXIST prefsCleaner.bat (
			IF "!_changed!"=="true" (
				CALL :message "Would you like to run the prefsCleaner now?"
				CHOICE /C YN /N /M "(Y/N) "
				IF "1"=="!errorlevel!" ( START "" cmd.exe /C "prefsCleaner.bat" )
			) ELSE (PAUSE)
		) ELSE (PAUSE)
	)
)
EXIT /B

REM ########### Message Function ###########
:message
SETLOCAL DisableDelayedExpansion
IF NOT "2"=="%_log%" (ECHO:)
ECHO:  %~1
IF NOT "2"=="%_log%" (ECHO:)
ENDLOCAL
GOTO :EOF

REM ############ ESR Function ############
:esr
SETLOCAL DisableDelayedExpansion
(
	FOR /F "tokens=1,* delims=:" %%G IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%H"
		SETLOCAL EnableDelayedExpansion
		IF NOT "!_temp:~-37!"==".x still uses all the following prefs" (
			ENDLOCAL & ECHO:%%H
		) ELSE (
			ECHO://!_temp:~2!
			ENDLOCAL
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

REM ############ RFP Alts Function ############
:rfpalts
SETLOCAL DisableDelayedExpansion
(
	FOR /F "tokens=1,* delims=:" %%G IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%H"
		SETLOCAL EnableDelayedExpansion
		IF "!_temp:[SETUP-non-RFP]=!"=="!_temp!" (
			ENDLOCAL & ECHO:%%H
		) ELSE (
			ECHO://!_temp:~2!
			ENDLOCAL
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

REM ############ Merge Function ############
:merge
SETLOCAL DisableDelayedExpansion
FOR /F tokens^=2^,^*^ delims^=^'^" %%G IN ('FINDSTR /R /C:"^user_pref[ 	]*\([ 	]*[\"'].*[\"'][ 	]*,.*\)[ 	]*;" "%~1"') DO (SET "[%%G]=%%H")
FOR /F tokens^=2^,^*^ delims^=^' %%G IN ('FINDSTR /R /C:"^//// --- comment-out --- '[^'][^']*'.*" "%~1"') DO (SET "__unset__%%G=1")
(
	FOR /F "tokens=1,* delims=:" %%I IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%J"
		SETLOCAL EnableDelayedExpansion
		IF NOT "!_temp:~0,9!"=="user_pref" (
			ENDLOCAL & ECHO:%%J
		) ELSE (
			IF "!_temp:;=!"=="!_temp!" (
				ENDLOCAL & ECHO:%%J
			) ELSE (
				ENDLOCAL
				FOR /F tokens^=2^ delims^=^'^" %%K IN ("%%J") DO (
					IF NOT "_user.js.parrot"=="%%K" (
						IF DEFINED __unset__%%K (
							ECHO://%%J
						) ELSE (
							IF DEFINED [%%K] (
								SETLOCAL EnableDelayedExpansion
								FOR /F "delims=" %%L IN ("![%%K]!") DO (
									ENDLOCAL & ECHO:user_pref("%%K"%%L
									SET "[%%K]="
								)
							)
						)
					) ELSE (ECHO:%%J)
				)
			)
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

REM ############### Help ##################
:showhelp
MODE 80,53
CLS
CALL :message "Available arguments (case-insensitive):"
CALL :message "  -esr"
ECHO:     Activate ESR related preferences
CALL :message "  -log"
ECHO:     Write the console output to a logfile (user.js-update-log.txt)
CALL :message "  -logP"
ECHO:     Like -log, but also open the logfile after updating.
CALL :message "  -merge"
ECHO:     Merge overrides instead of appending them. Single-line comments and
ECHO:     _user.js.parrot lines are appended normally. Overrides for inactive
ECHO:     user.js prefs will be appended. When -Merge and -MultiOverrides are used
ECHO:     together, a user-overrides-merged.js file is also generated in the root
ECHO:     directory for quick reference. It contains only the merged data from
ECHO:     override files and can be safely discarded after updating, or used as the
ECHO:     new user-overrides.js. When there are conflicting records for the same
ECHO:     pref, the value of the last one declared will be used. Visit the wiki
ECHO:     for usage examples and more detailed information.
CALL :message "  -multiOverrides"
ECHO:     Use any and all .js files in a user.js-overrides sub-folder as overrides
ECHO:     instead of the default user-overrides.js file. Files are appended in
ECHO:     alphabetical order.
CALL :message "  -unattended"
ECHO:     Run without user input.
CALL :message "  -singleBackup"
ECHO:     Use a single backup file and overwrite it on new updates, instead of
ECHO:     cumulative backups. This was the default behaviour before v4.3.
CALL :message "  -rfpAlts"
ECHO:     Activate RFP Alternatives section
CALL :message "  -updateBatch"
ECHO:     Update the script itself on execution, before the normal routine.
CALL :message ""
PAUSE
MODE 80,25
GOTO :begin

add -RFPalts option (#745)

add -RFPalts option (#745)


Correct windows dev start script

Correct windows dev start script


@echo off
cls
:start
echo Starting server...

"Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.63" -password "" -tcpLobby "149.202.51.185" 25565

echo.
echo Restarting server...
echo.
goto start

@echo off
cls
:start
echo Starting server...

"Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.70" -password "" -tcpLobby "149.202.51.185" 25565

echo.
echo Restarting server...
echo.
goto start

Patch for 0.70 update

[Nomad] Patch for 0.70 update


@echo off

java -Xms512m -Xmx1024m -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -Dproject.basedir="..\" -jar target\hippo-on-spring-boot-spring-boot-deploy-1.0.0-SNAPSHOT.jar %1

@echo off

java -Xms512m -Xmx1024m -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -Dproject.basedir="..\\" -jar target\hippo-on-spring-boot-spring-boot-deploy-1.0.0-SNAPSHOT.jar %1

Update test.bat

Update test.bat

Fixing and closing #3 by double backslash. Thanks to @fdeberle!


start qemu-system-arm.exe -M mini2440 -kernel ..\bsp\mini2440\rtthread-mini2440.axf -show-cursor -sd SDCARD -serial telnet:127.0.0.1:1200,server

add startup option for QEMU/mini2440 emulator

git-svn-id: 839522a79b1d56a78fa446d2fd3a0c499f8e535e@353 bbd45198-f89e-11dd-88c7-29a3b14d5316


@echo off

rem ********************************************************************************
rem Ensure configured.
rem ********************************************************************************
if not exist "%~dp0.agent" and "%~dp1" neq "--yaml" (
    echo "Must configure first. Run config.cmd"
    exit /B 1
)

rem ********************************************************************************
rem Unblock specific files.
rem ********************************************************************************
setlocal
if defined VERBOSE_ARG (
  set VERBOSE_ARG='Continue'
) else (
  set VERBOSE_ARG='SilentlyContinue'
)

rem Unblock the following types of files:
rem 1) The files in the root of the layout folder. E.g. .cmd files.
rem
rem 2) The PowerShell scripts delivered with the agent. E.g. capability scan scripts under "bin\"
rem and legacy handler scripts under "externals\vstshost\".
rem
rem 3) The DLLs potentially loaded from a PowerShell script (e.g. DLLs in Agent.ServerOMDirectory).
rem Otherwise, Add-Type may result in the following error:
rem   Add-Type : Could not load file or assembly 'file:///[...].dll' or one of its dependencies.
rem   Operation is not supported.
rem Reproduced on Windows 8 in PowerShell 4. Changing the execution policy did not appear to make
rem a difference. The error reproduced even with the execution policy set to Bypass. It may be a
rem a policy setting.
powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$VerbosePreference = %VERBOSE_ARG% ; Get-ChildItem -LiteralPath '%~dp0' | ForEach-Object { Write-Verbose ('Unblock: {0}' -f $_.FullName) ; $_ } | Unblock-File | Out-Null ; Get-ChildItem -Recurse -LiteralPath '%~dp0bin', '%~dp0externals' | Where-Object { $_ -match '\.(ps1|psd1|psm1)$' } | ForEach-Object { Write-Verbose ('Unblock: {0}' -f $_.FullName) ; $_ } | Unblock-File | Out-Null ; Get-ChildItem -LiteralPath '%~dp0externals\vstsom', '%~dp0externals\vstshost' | Where-Object { $_ -match '\.(dll|exe)$' } | ForEach-Object { Write-Verbose ('Unblock: {0}' -f $_.FullName) ; $_ } | Unblock-File | Out-Null"

rem ********************************************************************************
rem Run the listener process.
rem ********************************************************************************
"%~dp0bin\Agent.Listener.exe" run %*

@echo off

rem ********************************************************************************
rem Ensure configured.
rem ********************************************************************************
if not exist "%~dp0.agent" (
  if "%~1" neq "--yaml" (
    echo "Must configure first. Run config.cmd"
    exit /B 1
  )
)

rem ********************************************************************************
rem Unblock specific files.
rem ********************************************************************************
setlocal
if defined VERBOSE_ARG (
  set VERBOSE_ARG='Continue'
) else (
  set VERBOSE_ARG='SilentlyContinue'
)

rem Unblock the following types of files:
rem 1) The files in the root of the layout folder. E.g. .cmd files.
rem
rem 2) The PowerShell scripts delivered with the agent. E.g. capability scan scripts under "bin\"
rem and legacy handler scripts under "externals\vstshost\".
rem
rem 3) The DLLs potentially loaded from a PowerShell script (e.g. DLLs in Agent.ServerOMDirectory).
rem Otherwise, Add-Type may result in the following error:
rem   Add-Type : Could not load file or assembly 'file:///[...].dll' or one of its dependencies.
rem   Operation is not supported.
rem Reproduced on Windows 8 in PowerShell 4. Changing the execution policy did not appear to make
rem a difference. The error reproduced even with the execution policy set to Bypass. It may be a
rem a policy setting.
powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$VerbosePreference = %VERBOSE_ARG% ; Get-ChildItem -LiteralPath '%~dp0' | ForEach-Object { Write-Verbose ('Unblock: {0}' -f $_.FullName) ; $_ } | Unblock-File | Out-Null ; Get-ChildItem -Recurse -LiteralPath '%~dp0bin', '%~dp0externals' | Where-Object { $_ -match '\.(ps1|psd1|psm1)$' } | ForEach-Object { Write-Verbose ('Unblock: {0}' -f $_.FullName) ; $_ } | Unblock-File | Out-Null ; Get-ChildItem -LiteralPath '%~dp0externals\vstsom', '%~dp0externals\vstshost' | Where-Object { $_ -match '\.(dll|exe)$' } | ForEach-Object { Write-Verbose ('Unblock: {0}' -f $_.FullName) ; $_ } | Unblock-File | Out-Null"

rem ********************************************************************************
rem Run the listener process.
rem ********************************************************************************
"%~dp0bin\Agent.Listener.exe" run %*

Fix run.cmd on Win

Fix run.cmd on Win


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

Update to Gradle 3.4.1, please note that you need to uncheck "separate modules for sourceSets" in IntelliJ until version 2017.1, see https://youtrack.jetbrains.com/issue/IDEA-167412


java^
 -Xms64m^
 -Xmx6144m^
 -XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot^
 -XX:-OmitStackTraceInFastThrow^
 -jar sw.jar

add exclude GlyphView,getBreakSpot argument


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

echo Configuring Lucy...

setlocal
set CL=
cl >nul 2>nul
endlocal
if not errorlevel 1 goto found_cl

gcc -v >nul 2>nul
if not errorlevel 1 goto found_gcc

echo No C compiler found
exit /b 1

:found_cl
echo Using C compiler 'cl'
echo cl /nologo ..\common\charmonizer.c
cl /nologo ..\common\charmonizer.c
if errorlevel 1 exit /b 1
echo Running charmonizer
charmonizer.exe --cc=cl --enable-c --enable-makefile %*
exit /b

:found_gcc
echo Using C compiler 'gcc'
echo gcc ..\common\charmonizer.c -o charmonizer.exe
gcc ..\common\charmonizer.c -o charmonizer.exe
if errorlevel 1 exit /b 1
echo Running charmonizer
charmonizer.exe --cc=gcc --host=c --enable-c --enable-makefile %*
exit /b

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

echo Configuring Lucy...

setlocal
set CL=
cl >nul 2>nul
endlocal
if not errorlevel 1 goto found_cl

gcc -v >nul 2>nul
if not errorlevel 1 goto found_gcc

echo No C compiler found
exit /b 1

:found_cl
echo Using C compiler 'cl'
echo cl /nologo ..\common\charmonizer.c
cl /nologo ..\common\charmonizer.c
if errorlevel 1 exit /b 1
echo Running charmonizer
charmonizer.exe --cc=cl --host=c --enable-c --enable-makefile %*
exit /b

:found_gcc
echo Using C compiler 'gcc'
echo gcc ..\common\charmonizer.c -o charmonizer.exe
gcc ..\common\charmonizer.c -o charmonizer.exe
if errorlevel 1 exit /b 1
echo Running charmonizer
charmonizer.exe --cc=gcc --host=c --enable-c --enable-makefile %*
exit /b

Set charmonizer host for Windows build

Set charmonizer host for Windows build


::*******************************************************************************************************
::  BuildNightly.bat - Gbtc
::
::  Tennessee Valley Authority, 2009
::  No copyright is claimed pursuant to 17 USC  105.  All Other Rights Reserved.
::
::  This software is made freely available under the TVA Open Source Agreement (see below).
::
::  Code Modification History:
::  -----------------------------------------------------------------------------------------------------
::  10/20/2009 - Pinal C. Patel
::       Generated original version of source code.
::  09/14/2010 - Mihir Brahmbhatt
::		 Change Framework path from v3.5 to v4.0
::  10/03/2010 - Pinal C. Patel
::       Updated to use MSBuild 4.0.
::
::*******************************************************************************************************

@ECHO OFF

SetLocal

IF NOT "%1" == "" SET logflag=/l:FileLogger,Microsoft.Build.Engine;logfile=%1

ECHO BuildNightly: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe openXDA.buildproj /p:ForceBuild=true %logflag%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" openXDA.buildproj /p:ForceBuild=true %logFlag%

::*******************************************************************************************************
::  BuildNightly.bat - Gbtc
::
::  Tennessee Valley Authority, 2009
::  No copyright is claimed pursuant to 17 USC  105.  All Other Rights Reserved.
::
::  This software is made freely available under the TVA Open Source Agreement (see below).
::
::  Code Modification History:
::  -----------------------------------------------------------------------------------------------------
::  10/20/2009 - Pinal C. Patel
::       Generated original version of source code.
::  09/14/2010 - Mihir Brahmbhatt
::		 Change Framework path from v3.5 to v4.0
::  10/03/2010 - Pinal C. Patel
::       Updated to use MSBuild 4.0.
::
::*******************************************************************************************************

@ECHO OFF

SetLocal

IF NOT "%1" == "" SET logflag=/l:FileLogger,Microsoft.Build.Engine;logfile=%1

ECHO BuildNightly: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe openXDA.buildproj /p:ForceBuild=false %logflag%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" openXDA.buildproj /p:ForceBuild=false %logFlag%

Set ForceBuild to false in the BuildNightly.bat script.


@echo off
set /p DUMMY=PuTTY rules, TeraTerm drools. Press ENTER to accept ...
for /f "tokens=3 delims=M " %%a in ('nrfjprog --com') do (
	start "" "C:\Program Files (x86)\teraterm\ttermpro.exe" /C=%%a /BAUD=115200 /CDATABIT=8 /CSTOPBIT=1 /CPARITY=none /CFLOWCTR=none
 	)

@echo off
for /f "tokens=3 delims=M " %%a in ('nrfjprog --com') do (
	start "" "C:\Program Files (x86)\teraterm\ttermpro.exe" /C=%%a /BAUD=115200 /CDATABIT=8 /CSTOPBIT=1 /CPARITY=none /CFLOWCTR=none
 	)

Remove snarky delay message

Remove snarky delay message


regsvr32 C:\RML\source\Agramtab\Debug\agramtab.dll
regsvr32 /s C:\RML\source\Graphan\Debug\graphan.dll
regsvr32 /s C:\RML\source\Lemmatizer\Debug\Lemmatizer.dll
regsvr32 /s C:\RML\source\MAPost\Debug\MAPost.dll
regsvr32 /s C:\RML\source\seman\Debug\seman.dll
regsvr32 /s C:\RML\source\structDict\Debug\structDict.dll
regsvr32 /s C:\RML\source\synAn\Debug\synAn.dll

use pcre internally

use pcre internally


if not defined ULTRADEFRAG_32_URL set ULTRADEFRAG_32_URL=http://downloads.sourceforge.net/ultradefrag/ultradefrag-portable-7.0.2.bin.i386.zip
if not defined ULTRADEFRAG_64_URL set ULTRADEFRAG_64_URL=http://downloads.sourceforge.net/ultradefrag/ultradefrag-portable-7.0.2.bin.amd64.zip

::::::::::::
:main
::::::::::::

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
    msiexec /qb /i C:\Windows\Temp\7z920-x64.msi
)

if defined ProgramFiles(x86) (
  set ULTRADEFRAG_URL=%ULTRADEFRAG_64_URL%
) else (
  set ULTRADEFRAG_URL=%ULTRADEFRAG_32_URL%
)

for %%i in ("%ULTRADEFRAG_URL%") do set ULTRADEFRAG_ZIP=%%~nxi
set ULTRADEFRAG_DIR=%TEMP%\ultradefrag
set ULTRADEFRAG_PATH=%ULTRADEFRAG_DIR%\%ULTRADEFRAG_ZIP%

echo ==^> Creating "%ULTRADEFRAG_DIR%"
mkdir "%ULTRADEFRAG_DIR%"
pushd "%ULTRADEFRAG_DIR%"

echo ==^> Downloading "%ULTRADEFRAG_URL%" to "%ULTRADEFRAG_PATH%"
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%ULTRADEFRAG_URL%', '%ULTRADEFRAG_PATH%')" <NUL

echo ==^> Unzipping "%ULTRADEFRAG_PATH%" to "%ULTRADEFRAG_DIR%"
7z e -y -o"%ULTRADEFRAG_DIR%" "%ULTRADEFRAG_PATH%" *\udefrag.exe *\*.dll

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e -o"%ULTRADEFRAG_DIR%" "%ULTRADEFRAG_PATH%"
ver>nul

for /r %%i in (udefrag.exe) do if exist "%%~i" set ULTRADEFRAG_EXE=%%~i

if not exist "%ULTRADEFRAG_EXE%" echo ==^> ERROR: File not found: udefrag.exe in "%ULTRADEFRAG_DIR%" & goto exit1

echo ==^> Running UltraDefrag on %SystemDrive%
"%ULTRADEFRAG_EXE%" --optimize --repeat %SystemDrive%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%ULTRADEFRAG_EXE%" --optimize --repeat %SystemDrive%
ver>nul

popd

echo ==^> Removing "%ULTRADEFRAG_DIR%"
rmdir /q /s "%ULTRADEFRAG_DIR%"

:exit0

@ping 127.0.0.1
@ver>nul

@goto :exit

:exit1

@ping 127.0.0.1
@verify other 2>nul

:exit

@echo ==^> Script exiting with errorlevel %ERRORLEVEL%
@exit /b %ERRORLEVEL%

if not defined ULTRADEFRAG_32_URL set ULTRADEFRAG_32_URL=http://downloads.sourceforge.net/ultradefrag/ultradefrag-portable-7.0.2.bin.i386.zip
if not defined ULTRADEFRAG_64_URL set ULTRADEFRAG_64_URL=http://downloads.sourceforge.net/ultradefrag/ultradefrag-portable-7.0.2.bin.amd64.zip

::::::::::::
:main
::::::::::::

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
    msiexec /qb /i C:\Windows\Temp\7z920-x64.msi
)

if defined ProgramFiles(x86) (
  set ULTRADEFRAG_URL=%ULTRADEFRAG_64_URL%
) else (
  set ULTRADEFRAG_URL=%ULTRADEFRAG_32_URL%
)

for %%i in ("%ULTRADEFRAG_URL%") do set ULTRADEFRAG_ZIP=%%~nxi
set ULTRADEFRAG_DIR=%TEMP%\ultradefrag
set ULTRADEFRAG_PATH=%ULTRADEFRAG_DIR%\%ULTRADEFRAG_ZIP%

echo ==^> Creating "%ULTRADEFRAG_DIR%"
mkdir "%ULTRADEFRAG_DIR%"
pushd "%ULTRADEFRAG_DIR%"

echo ==^> Downloading "%ULTRADEFRAG_URL%" to "%ULTRADEFRAG_PATH%"
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%ULTRADEFRAG_URL%', '%ULTRADEFRAG_PATH%')" <NUL

echo ==^> Unzipping "%ULTRADEFRAG_PATH%" to "%ULTRADEFRAG_DIR%"
"C:\Program Files\7-Zip\7z.exe" e -y -o"%ULTRADEFRAG_DIR%" "%ULTRADEFRAG_PATH%" *\udefrag.exe *\*.dll

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e -o"%ULTRADEFRAG_DIR%" "%ULTRADEFRAG_PATH%"
ver>nul

for /r %%i in (udefrag.exe) do if exist "%%~i" set ULTRADEFRAG_EXE=%%~i

if not exist "%ULTRADEFRAG_EXE%" echo ==^> ERROR: File not found: udefrag.exe in "%ULTRADEFRAG_DIR%" & goto exit1

echo ==^> Running UltraDefrag on %SystemDrive%
"%ULTRADEFRAG_EXE%" --optimize --repeat %SystemDrive%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%ULTRADEFRAG_EXE%" --optimize --repeat %SystemDrive%
ver>nul

popd

echo ==^> Removing "%ULTRADEFRAG_DIR%"
rmdir /q /s "%ULTRADEFRAG_DIR%"

:exit0

@ping 127.0.0.1
@ver>nul

@goto :exit

:exit1

@ping 127.0.0.1
@verify other 2>nul

:exit

@echo ==^> Script exiting with errorlevel %ERRORLEVEL%
@exit /b %ERRORLEVEL%

Use full path to 7z

Use full path to 7z


@echo off

set cmake="C:\Program Files\CMake\bin\cmake"
:: "C:\Qt5.14\5.14.0\msvc2017_64"
set qt=%1
set cfg=Release

cd bin
%cmake% ..\Superbuild -DCMAKE_BUILD_TYPE=%cfg% -G"Visual Studio 15 2017" -Ax64 -DQt5_PATH:PATH=%qt%
%cmake% --build . --config %cfg% -j6

for %%D in (Qt5Core Qt5Gui Qt5Network Qt5OpenGL Qt5PrintSupport Qt5Svg Qt5Widgets) do (copy %qt%\bin\%%D.dll SCIRun\%cfg%\)
copy Externals\Build\Qwt_external\src\%cfg%\qwt.dll SCIRun\%cfg%\
copy Externals\Source\Python_external\PCbuild\amd64\python38.dll SCIRun\%cfg%\
xcopy /s %qt%\plugins\platforms SCIRun\%cfg%\

@echo off

set cmake="C:\Program Files\CMake\bin\cmake"
:: "C:\Qt5.14\5.14.0\msvc2017_64"
set qt=%1
set cfg=Release

cd bin
%cmake% ..\Superbuild -DCMAKE_BUILD_TYPE=%cfg% -G"Visual Studio 15 2017" -Ax64 -DQt5_PATH:PATH=%qt%
%cmake% --build . --config %cfg% -j6

for %%D in (Qt5Core Qt5Gui Qt5Network Qt5OpenGL Qt5PrintSupport Qt5Svg Qt5Widgets) do (copy %qt%\bin\%%D.dll SCIRun\%cfg%\)
copy Externals\Build\Qwt_external\src\%cfg%\qwt.dll SCIRun\%cfg%\
copy Externals\Source\Python_external\PCbuild\amd64\python38.dll SCIRun\%cfg%\
cd SCIRun\%cfg%\
mkdir platforms
cd ..\..
xcopy /s %qt%\plugins\platforms SCIRun\%cfg%\platforms\

Update windowsBuild.bat

Update windowsBuild.bat


:: 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

:: 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
md %SP_DIR%\goodvibes\share\
"%CC%" -c symmetry.c
"%CC%" -shared -o "%SP_DIR%\goodvibes\share\symmetry_win.dll" symmetry.o

Update bld.bat

Update bld.bat