@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

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

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

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

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

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

echo Handling function App deployment.

if "%SCM_USE_FUNCPACK%" == "1" (
  call :DeployWithFuncPack
) else (
  call :DeployWithoutFuncPack
)

goto end

:DeployWithFuncPack
setlocal

echo Using funcpack to optimize cold start

:: 1. Copy to local storage
echo Copying repository files to local storage
xcopy "%DEPLOYMENT_SOURCE%\functions" "%DEPLOYMENT_TEMP%" /seyiq
IF !ERRORLEVEL! NEQ 0 goto error

:: 2. Restore npm
call :RestoreNpmPackages "%DEPLOYMENT_TEMP%"

:: 3. FuncPack
pushd "%DEPLOYMENT_TEMP%"
call funcpack pack .
IF !ERRORLEVEL! NEQ 0 goto error
popd

:: 4. KuduSync
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd;node_modules"
IF !ERRORLEVEL! NEQ 0 goto error

exit /b %ERRORLEVEL%

:DeployWithoutFuncPack
setlocal

echo Not using funcpack because SCM_USE_FUNCPACK is not set to 1

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

:: 2. Restore npm
call :RestoreNpmPackages "%DEPLOYMENT_TARGET%"

exit /b %ERRORLEVEL%

:RestoreNpmPackages
setlocal

echo Restoring npm packages in %1

IF EXIST "%1\package.json" (
  pushd "%1"
  call npm install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

FOR /F "tokens=*" %%i IN ('DIR /B %1 /A:D') DO (
  IF EXIST "%1\%%i\package.json" (
    pushd "%1\%%i"
    call npm install --production
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
  )
)

exit /b %ERRORLEVEL%

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

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

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

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

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

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

echo Handling function App deployment.

if "%SCM_USE_FUNCPACK%" == "1" (
  call :DeployWithFuncPack
) else (
  call :DeployWithoutFuncPack
)

goto end

:DeployWithFuncPack
setlocal

echo Using funcpack to optimize cold start

:: 1. Copy to local storage
echo Copying repository files to local storage
xcopy "%DEPLOYMENT_SOURCE%\functions" "%DEPLOYMENT_TEMP%" /seyiq
IF !ERRORLEVEL! NEQ 0 goto error

:: 2. Restore npm
call :RestoreNpmPackages "%DEPLOYMENT_TEMP%"

:: 3. FuncPack
pushd "%DEPLOYMENT_TEMP%"
call funcpack pack .
IF !ERRORLEVEL! NEQ 0 goto error
popd

:: 4. KuduSync
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd;node_modules"
IF !ERRORLEVEL! NEQ 0 goto error

exit /b %ERRORLEVEL%

:DeployWithoutFuncPack
setlocal

echo Not using funcpack because SCM_USE_FUNCPACK is not set to 1

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

echo Copying package.json
xcopy "%DEPLOYMENT_SOURCE%\package.json" "%DEPLOYMENT_TARGET%" /yiq
IF !ERRORLEVEL! NEQ 0 goto error

:: 2. Restore npm
call :RestoreNpmPackages "%DEPLOYMENT_TARGET%"

exit /b %ERRORLEVEL%

:RestoreNpmPackages
setlocal

echo Restoring npm packages in %1

IF EXIST "%1\package.json" (
  pushd "%1"
  call npm install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

FOR /F "tokens=*" %%i IN ('DIR /B %1 /A:D') DO (
  IF EXIST "%1\%%i\package.json" (
    pushd "%1\%%i"
    call npm install --production
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
  )
)

exit /b %ERRORLEVEL%

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

copy package.json

copy package.json


@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

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

REM ***** JAVA options *****

if "%CRATE_MIN_MEM%" == "" (
set CRATE_MIN_MEM=256m
)

if "%CRATE_MAX_MEM%" == "" (
set CRATE_MAX_MEM=1g
)

if NOT "%CRATE_HEAP_SIZE%" == "" (
set CRATE_MIN_MEM=%CRATE_HEAP_SIZE%
set CRATE_MAX_MEM=%CRATE_HEAP_SIZE%
)

set JAVA_OPTS=%JAVA_OPTS% -Xms%CRATE_MIN_MEM% -Xmx%CRATE_MAX_MEM%

if NOT "%CRATE_HEAP_NEWSIZE%" == "" (
set JAVA_OPTS=%JAVA_OPTS% -Xmn%CRATE_HEAP_NEWSIZE%
)

if NOT "%CRATE_DIRECT_SIZE%" == "" (
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxDirectMemorySize=%CRATE_DIRECT_SIZE%
)

set JAVA_OPTS=%JAVA_OPTS% -Xss256k

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

set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC

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

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

REM Ensure UTF-8 encoding by default (e.g. filenames)
set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8

REM log4j options
set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true

REM Disable netty recycler
set JAVA_OPTS=%JAVA_OPTS% -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0

if "%CRATE_CLASSPATH%" == "" (
    set CRATE_CLASSPATH=%CRATE_HOME%/lib/*;%CRATE_HOME%/lib/enterprise/*;%CRATE_HOME%/lib/sigar/*
) else (
    ECHO Error: Don't modify the classpath with CRATE_CLASSPATH. 1>&2
    ECHO Add plugins and their dependencies into the plugins/ folder instead. 1>&2
    EXIT /B 1
)
set CRATE_PARAMS=-Epath.home="%CRATE_HOME%"

setlocal enabledelayedexpansion
set params='%*'

for /F "usebackq tokens=* delims= " %%A in (!params!) do (
    set param=%%A

    if "!param:~0,5!" equ "-Des." (
        echo "Support for defining Crate specific settings with the -D option and the es prefix has been dropped."
        echo "Please use the -C option to configure Crate."
        EXIT /B 1
    ) else if "!param:~0,2!" equ "-C" (
        set param=!param:-C=-E!
    )

    if "x!newparams!" neq "x" (
        set newparams=!newparams! !param!
    ) else (
        set newparams=!param!
    )
)

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CRATE_JAVA_OPTS% -cp "%CRATE_CLASSPATH%" "io.crate.bootstrap.CrateDB" %CRATE_PARAMS% !newparams!
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

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

REM ***** JAVA options *****

if "%CRATE_MIN_MEM%" == "" (
set CRATE_MIN_MEM=256m
)

if "%CRATE_MAX_MEM%" == "" (
set CRATE_MAX_MEM=1g
)

if NOT "%CRATE_HEAP_SIZE%" == "" (
set CRATE_MIN_MEM=%CRATE_HEAP_SIZE%
set CRATE_MAX_MEM=%CRATE_HEAP_SIZE%
)

set JAVA_OPTS=%JAVA_OPTS% -Xms%CRATE_MIN_MEM% -Xmx%CRATE_MAX_MEM%

if NOT "%CRATE_HEAP_NEWSIZE%" == "" (
set JAVA_OPTS=%JAVA_OPTS% -Xmn%CRATE_HEAP_NEWSIZE%
)

if NOT "%CRATE_DIRECT_SIZE%" == "" (
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxDirectMemorySize=%CRATE_DIRECT_SIZE%
)

set JAVA_OPTS=%JAVA_OPTS% -Xss256k

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

set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC

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

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

REM Disables explicit GC
set JAVA_OPTS=%JAVA_OPTS% -XX:+DisableExplicitGC

REM Use our provided JNA always versus the system one
set JAVA_OPTS=%JAVA_OPTS% -Djna.nosys=true

REM Ensure UTF-8 encoding by default (e.g. filenames)
set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8

REM log4j options
set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true

REM Disable netty recycler
set JAVA_OPTS=%JAVA_OPTS% -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0

if "%CRATE_CLASSPATH%" == "" (
    set CRATE_CLASSPATH=%CRATE_HOME%/lib/*;%CRATE_HOME%/lib/enterprise/*;%CRATE_HOME%/lib/sigar/*
) else (
    ECHO Error: Don't modify the classpath with CRATE_CLASSPATH. 1>&2
    ECHO Add plugins and their dependencies into the plugins/ folder instead. 1>&2
    EXIT /B 1
)
set CRATE_PARAMS=-Epath.home="%CRATE_HOME%"

setlocal enabledelayedexpansion
set params='%*'

for /F "usebackq tokens=* delims= " %%A in (!params!) do (
    set param=%%A

    if "!param:~0,5!" equ "-Des." (
        echo "Support for defining Crate specific settings with the -D option and the es prefix has been dropped."
        echo "Please use the -C option to configure Crate."
        EXIT /B 1
    ) else if "!param:~0,2!" equ "-C" (
        set param=!param:-C=-E!
    )

    if "x!newparams!" neq "x" (
        set newparams=!newparams! !param!
    ) else (
        set newparams=!param!
    )
)

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CRATE_JAVA_OPTS% -cp "%CRATE_CLASSPATH%" "io.crate.bootstrap.CrateDB" %CRATE_PARAMS% !newparams!
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

update JVM parameters in windows bat script


mkdir build
cd build

cmake ^
    -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DUDEV_INSTALL=False ^
    -DENABLE_OPENCV=1
    %SRC_DIR%
if errorlevel 1 exit 1

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

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1

Create bld.bat

Create bld.bat


@ echo off
set base_dir=%~dp0
%base_dir:~0,2%
pushd %base_dir%
copy data/network.db data/network.db.backup
popd

@ echo off
set base_dir=%~dp0
%base_dir:~0,2%
pushd %base_dir%
copy data/network.db data/network.db.backup /y
popd

copy cover

copy cover


..\.nuget\NuGet.exe push ..\Topshelf.Autofac\bin\Release\Topshelf.Autofac.*.nupkg -Source https://www.nuget.org/api/v2/package

Add push package script :cow:

Add push package script :cow:


echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\installed\x64-windows\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=perfThread_build ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_59=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    LIBS+=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\installed\x64-windows\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=perfThread_build ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_59=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

Configure for Qt SDK version 5.9.

Configure for Qt SDK version 5.9.


cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_libuv.c -I"..\..\libdepwin\libuv\include" -I"..\..\include"
link /DEBUG ring_libuv.obj  ..\..\lib\ring.lib ..\..\libdepwin\libuv\libuv.lib /DLL /OUT:..\..\bin\ring_uv.dll /SUBSYSTEM:WINDOWS,"5.01" /NODEFAULTLIB:msvcrt.lib
del ring_libuv.obj

cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_libuv.c -I"..\..\extensions\libdepwin\libuv\include" -I"..\..\include"
link /DEBUG ring_libuv.obj  ..\..\lib\ring.lib ..\..\extensions\libdepwin\libuv\libuv.lib /DLL /OUT:..\..\bin\ring_uv.dll /SUBSYSTEM:WINDOWS,"5.01" /NODEFAULTLIB:msvcrt.lib
del ring_libuv.obj

Update RingLibUV - extensions/ringlibuv/buildvc.bat


rem we remove everything from dist
echo off
del /Q dist\*.*

rem python 3.3

set pythonexe="c:\Python33_x64\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64

set pythonexe="c:\Python33\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
%pythonexe% setup.py bdist_wininst

rem python 3.4

set pythonexe="c:\Python34_x64\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64

set pythonexe="c:\Python34\pythonw"
%pythonexe% clean_pyd.py
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
%pythonexe% setup.py bdist_wininst

rem help

%pythonexe% -u make_help.py
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html

rem we remove everything from dist
echo off
del /Q dist\*.*

rem python 3.3

set pythonexe="c:\Python33_x64\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64

set pythonexe="c:\Python33\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
%pythonexe% setup.py bdist_wininst

rem python 3.4

set pythonexe="c:\Python34_x64\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64

set pythonexe="c:\Python34\python"
%pythonexe% clean_pyd.py
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
%pythonexe% setup.py bdist_wininst

rem help

%pythonexe% -u make_help.py
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html

fix the script generating the setup

fix the script generating the setup


@ECHO OFF

REM ----------------------------------------------------------------------
REM PHP version 4.0
REM ----------------------------------------------------------------------
REM Copyright (c) 1997-2002 The PHP Group
REM ----------------------------------------------------------------------
REM  This source file is subject to version 2.02 of the PHP license,
REM  that is bundled with this package in the file LICENSE, and is
REM  available at through the world-wide-web at
REM  http://www.php.net/license/2_02.txt.
REM  If you did not receive a copy of the PHP license and are unable to
REM  obtain it through the world-wide-web, please send a note to
REM  license@php.net so we can mail you a copy immediately.
REM ----------------------------------------------------------------------
REM  Authors:     Alexander Merz (alexmerz@php.net)
REM ----------------------------------------------------------------------
REM
REM  $Id: pear.bat,v 1.8 2002/06/12 16:31:53 cox Exp $

REM change this lines to match the paths of your system
REM -------------------

set PHP_BIN=c:\php\php.exe
set PEAR_PATH=c:\php\pear

%PHP_BIN% -C -d include_path=%PEAR_PATH% -f %PEAR_PATH%\scripts\pear.in -- %1 %2 %3 %4 %5 %6 %7 %8 %9
@ECHO ON

@ECHO OFF

REM ----------------------------------------------------------------------
REM PHP version 4.0
REM ----------------------------------------------------------------------
REM Copyright (c) 1997-2002 The PHP Group
REM ----------------------------------------------------------------------
REM  This source file is subject to version 2.02 of the PHP license,
REM  that is bundled with this package in the file LICENSE, and is
REM  available at through the world-wide-web at
REM  http://www.php.net/license/2_02.txt.
REM  If you did not receive a copy of the PHP license and are unable to
REM  obtain it through the world-wide-web, please send a note to
REM  license@php.net so we can mail you a copy immediately.
REM ----------------------------------------------------------------------
REM  Authors:     Alexander Merz (alexmerz@php.net)
REM ----------------------------------------------------------------------
REM
REM  $Id: pear.bat,v 1.9 2002/07/26 10:48:20 cox Exp $

REM change this lines to match the paths of your system
REM -------------------

set PHP_BIN=c:\php\php.exe
set PEAR_PATH=c:\php\pear

%PHP_BIN% -C -d output_buffer=0 -d include_path=%PEAR_PATH% -f %PEAR_PATH%\scripts\pear.in -- %1 %2 %3 %4 %5 %6 %7 %8 %9
@ECHO ON

use -d output_buffer=0 to workarround the PHP flush() problem


:<<"::IGNORE_THIS_LINE"
@ECHO OFF
GOTO :CMDSCRIPT
::IGNORE_THIS_LINE

# This is a small script to stitch panorama videos produced
# by Samsung Gear360
#
# TODOs:
# - output file name is currently static
# - add check for gear360pano script
# - ffmpeg and jpg or png?
#
# Trick with Win/Linux from here:
# http://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash

################################ Linux part here

# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
DIR=$(dirname `which $0`)

# Clean-up function
clean_up() {
    echo "Removing temporary directories..."
    if [ -d "$FRAMESTMPDIR" ]; then
        rm -rf "$FRAMESTMPDIR"
    fi
    if [ -d "$OUTTEMPDIR" ]; then
        rm -rf "$OUTTEMPDIR"
    fi
}

# Function to check if a command fails
# http://stackoverflow.com/questions/5195607/checking-bash-exit-status-of-several-commands-efficiently
run_command() {
    "$@"
    local status=$?
    if [ $status -ne 0 ]; then
        echo "Error while running $1" >&2
        if [ $1 != "notify-send" ]; then
           # Display error in a nice graphical popup if available
           run_command notify-send -a $0 "Error while running $1"
        fi
        clean_up
        exit 1
    fi
    return $status
}

# Do stuff to make this thing run on various POSIX operating systems
# http://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux
os_check() {
    case "$(uname -s)" in

    Darwin)
        ;;

    Linux)
        ;;

    CYGWIN*|MINGW32*|MSYS*)
        # Naive approach, should read Hugin installation
        # path from registry or something...
        export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Hugin/bin":"/cygdrive/c/Program Files/Hugin/bin"
        ;;
    *)
        ;;
    esac
}

# Check argument(s)
if [ -z "$1" ]; then
    echo "Small script to stitch panoramic videos."
    echo -e "Script originally writen for Samsung Gear 360.\n"
    echo -e "Usage:\n$0 inputdir [outputfile]\n"
    echo "Where inputfile is a panoramic video file,"
    echo "output parameter is optional."
    run_command notify-send -a $0 "Please provide an input file."
    sleep 2
    exit 1
fi

# Output name as second argument
if [ -z "$2" ]; then
    # If invoked by nautilus open-with, we need to remember the proper directory in the outname
    OUTNAME=`dirname "$1"`/`basename "${1%.*}"`_pano.mp4
    echo "DEBUG: output filename: $OUTNAME"
fi

# OS check, custom settings for various OSes
os_check

# Check if we have the software to do it
# http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
type ffmpeg >/dev/null 2>&1 || { echo >&2 "ffmpeg required but it's not installed. Aborting."; exit 1; }
# TODO: add check for gear360pano.cmd script

# On some systems not using '-p .' (temp in current dir) might cause problems
FRAMESTEMPDIR=`mktemp -d -p .`
OUTTEMPDIR=`mktemp -d`
IMAGETMPL="image%05d.jpg"
IMAGETMPLENC="image%05d_pano.jpg"
PTOTMPL="gear360video.pto"
TMPAUDIO="tmpaudio.aac"
TMPVIDEO="tmpvideo.mp4"
STARTTS=`date +%s`

# Extract frames from video
run_command notify-send -a $0 "Starting panoramic video stitching..."
echo "Extracting frames from video (this might take a while)..."
run_command ffmpeg -y -i "$1" "$FRAMESTEMPDIR/$IMAGETMPL"

# Stitch frames
echo "Stitching frames..."
for i in $FRAMESTEMPDIR/*.jpg; do
    echo Frame: $i
    run_command "/bin/bash" "$DIR/gear360pano.cmd" "-o" "$OUTTEMPDIR" "$i" "$PTOTMPL"
done

# Put stitched frames together
echo "Recoding the video..."
run_command ffmpeg -y -f image2 -i "$OUTTEMPDIR/$IMAGETMPLENC" -r 30 -s 3840:1920 -vcodec libx264 "$OUTTEMPDIR/$TMPVIDEO"

echo "Extracting audio..."
run_command notify-send -a $0 "Extracting audio..."
run_command ffmpeg -y -i "$1" -vn -acodec copy "$OUTTEMPDIR/$TMPAUDIO"

echo "Merging audio..."
run_command notify-send -a $0 "Merging audio..."
run_command ffmpeg -y -i "$OUTTEMPDIR/$TMPVIDEO" -i "$OUTTEMPDIR/$TMPAUDIO" -c:v copy -c:a aac -strict experimental "$OUTNAME"

# Remove temporary directories
clean_up

# Inform user about the result
ENDTS=`date +%s`
RUNTIME=$((ENDTS-STARTTS))
echo Video written to $OUTNAME, took: $RUNTIME s
run_command notify-send -a $0 "'Conversion complete. Video written to $OUTNAME, took: $RUNTIME s'"
exit 0

################################ Windows part here

:CMDSCRIPT

set FFMPEGPATH=c:/Program Files/ffmpeg/bin
set FRAMESTEMPDIR=frames
set OUTTEMPDIR=frames_stitched
set PTOTMPL=gear360video.pto
:: %% is an escape character (note: this will fail on wine's cmd.exe)
set IMAGETMPL=image%%05d.jpg
set IMAGETMPLENC=image%%05d_pano.jpg
set TMPAUDIO=tmpaudio.aac
set TMPVIDEO=tmpvideo.mp4

:: Check arguments
IF [%1] == [] GOTO NOARGS

:SETNAMEOK

:: Check ffmpeg...
if exist "%FFMPEGPATH%/ffmpeg.exe" goto FFMPEGOK
goto NOFFMPEG

:FFMPEGOK

:: Create temporary directories
mkdir %FRAMESTEMPDIR%
mkdir %OUTTEMPDIR%

:: Execute commands (as simple as it is)
echo Converting video to images...
"%FFMPEGPATH%/ffmpeg.exe" -y -i %1 %FRAMESTEMPDIR%/%IMAGETMPL%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Stitching
echo Stitching frames...
for %%f in (%FRAMESTEMPDIR%/*.jpg) do (
:: For whatever reason (this has to be at the beginning of the line!)
  echo Processing frame %FRAMESTEMPDIR%\%%f
:: TODO: There should be some error checking
  call gear360pano.cmd /o %OUTTEMPDIR% %FRAMESTEMPDIR%\%%f %PTOTMPL%
)

echo "Reencoding video..."
"%FFMPEGPATH%/ffmpeg.exe" -y -f image2 -i %OUTTEMPDIR%/%IMAGETMPLENC% -r 30 -s 3840:1920 -vcodec libx264 %OUTTEMPDIR%/%TMPVIDEO%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

echo "Extracting audio..."
"%FFMPEGPATH%/ffmpeg.exe" -y -i %1 -vn -acodec copy %OUTTEMPDIR%/%TMPAUDIO%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

echo "Merging audio..."

:: Check if second argument present, if not, set some default for output filename
:: This is here, because for whatever reason OUTNAME gets overriden by
:: the last iterated filename if this is at the beginning (for loop is buggy?)
if not [%2] == [] goto SETNAMEOK
set OUTNAME="%~n1_pano.mp4"

:SETNAMEOK

"%FFMPEGPATH%/ffmpeg.exe" -y -i %OUTTEMPDIR%/%TMPVIDEO% -i %OUTTEMPDIR%/%TMPAUDIO% -c:v copy -c:a aac -strict experimental %OUTNAME%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Clean-up (f - force, read-only & dirs, q - quiet)
del /f /q %FRAMESTEMPDIR%
del /f /q %OUTTEMPDIR%

echo Video written to %OUTNAME%
goto END

:NOARGS

echo Script to stitch raw video panorama files, raw
echo meaning two fisheye images side by side.
echo.
echo Script originally writen for Samsung Gear 360.
echo.
echo Usage:
echo %0 inputfile [outputfile]
echo.
echo Where inputfile is a panorama file from camera,
echo output parameter is optional
goto END

:NOFFMPEG

echo ffmpeg was not found in %FFMPEGPATH%, download from: https://ffmpeg.zeranoe.com/builds/
echo and unpack to program files directory
goto END

:FFMPEGERROR

echo ffmpeg failed, video not created
goto END

:END

:<<"::IGNORE_THIS_LINE"
@ECHO OFF
GOTO :CMDSCRIPT
::IGNORE_THIS_LINE

# This is a small script to stitch panorama videos produced
# by Samsung Gear360
#
# TODOs:
# - output file name is currently static
# - add check for gear360pano script
# - ffmpeg and jpg or png?
#
# Trick with Win/Linux from here:
# http://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash

################################ Linux part here

# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
DIR=$(dirname `which $0`)

# Clean-up function
clean_up() {
    echo "Removing temporary directories..."
    if [ -d "$FRAMESTEMPDIR" ]; then
        rm -rf "$FRAMESTEMPDIR"
    fi
    if [ -d "$OUTTEMPDIR" ]; then
        rm -rf "$OUTTEMPDIR"
    fi
}

# Function to check if a command fails
# http://stackoverflow.com/questions/5195607/checking-bash-exit-status-of-several-commands-efficiently
run_command() {
    "$@"
    local status=$?
    if [ $status -ne 0 ]; then
        echo "Error while running $1" >&2
        if [ $1 != "notify-send" ]; then
           # Display error in a nice graphical popup if available
           run_command notify-send -a $0 "Error while running $1"
        fi
        clean_up
        exit 1
    fi
    return $status
}

# Do stuff to make this thing run on various POSIX operating systems
# http://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux
os_check() {
    case "$(uname -s)" in

    Darwin)
        ;;

    Linux)
        ;;

    CYGWIN*|MINGW32*|MSYS*)
        # Naive approach, should read Hugin installation
        # path from registry or something...
        export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Hugin/bin":"/cygdrive/c/Program Files/Hugin/bin"
        ;;
    *)
        ;;
    esac
}

# Check argument(s)
if [ -z "$1" ]; then
    echo "Small script to stitch panoramic videos."
    echo -e "Script originally writen for Samsung Gear 360.\n"
    echo -e "Usage:\n$0 inputdir [outputfile]\n"
    echo "Where inputfile is a panoramic video file,"
    echo "output parameter is optional."
    run_command notify-send -a $0 "Please provide an input file."
    sleep 2
    exit 1
fi

# Output name as second argument
if [ -z "$2" ]; then
    # If invoked by nautilus open-with, we need to remember the proper directory in the outname
    OUTNAME=`dirname "$1"`/`basename "${1%.*}"`_pano.mp4
    echo "DEBUG: output filename: $OUTNAME"
fi

# OS check, custom settings for various OSes
os_check

# Check if we have the software to do it
# http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
type ffmpeg >/dev/null 2>&1 || { echo >&2 "ffmpeg required but it's not installed. Aborting."; exit 1; }
# TODO: add check for gear360pano.cmd script

# On some systems not using '-p .' (temp in current dir) might cause problems
FRAMESTEMPDIR=`mktemp -d -p .`
OUTTEMPDIR=`mktemp -d`
IMAGETMPL="image%05d.jpg"
IMAGETMPLENC="image%05d_pano.jpg"
PTOTMPL="gear360video.pto"
TMPAUDIO="tmpaudio.aac"
TMPVIDEO="tmpvideo.mp4"
STARTTS=`date +%s`

# Extract frames from video
run_command notify-send -a $0 "Starting panoramic video stitching..."
echo "Extracting frames from video (this might take a while)..."
run_command ffmpeg -y -i "$1" "$FRAMESTEMPDIR/$IMAGETMPL"

# Stitch frames
echo "Stitching frames..."
for i in $FRAMESTEMPDIR/*.jpg; do
    echo Frame: $i
    run_command "/bin/bash" "$DIR/gear360pano.cmd" "-o" "$OUTTEMPDIR" "$i" "$PTOTMPL"
done

# Put stitched frames together
echo "Recoding the video..."
run_command ffmpeg -y -f image2 -i "$OUTTEMPDIR/$IMAGETMPLENC" -r 30 -s 3840:1920 -vcodec libx264 "$OUTTEMPDIR/$TMPVIDEO"

echo "Extracting audio..."
run_command notify-send -a $0 "Extracting audio..."
run_command ffmpeg -y -i "$1" -vn -acodec copy "$OUTTEMPDIR/$TMPAUDIO"

echo "Merging audio..."
run_command notify-send -a $0 "Merging audio..."
run_command ffmpeg -y -i "$OUTTEMPDIR/$TMPVIDEO" -i "$OUTTEMPDIR/$TMPAUDIO" -c:v copy -c:a aac -strict experimental "$OUTNAME"

# Remove temporary directories
clean_up

# Inform user about the result
ENDTS=`date +%s`
RUNTIME=$((ENDTS-STARTTS))
echo Video written to $OUTNAME, took: $RUNTIME s
run_command notify-send -a $0 "'Conversion complete. Video written to $OUTNAME, took: $RUNTIME s'"
exit 0

################################ Windows part here

:CMDSCRIPT

set FFMPEGPATH=c:/Program Files/ffmpeg/bin
set FRAMESTEMPDIR=frames
set OUTTEMPDIR=frames_stitched
set PTOTMPL=gear360video.pto
:: %% is an escape character (note: this will fail on wine's cmd.exe)
set IMAGETMPL=image%%05d.jpg
set IMAGETMPLENC=image%%05d_pano.jpg
set TMPAUDIO=tmpaudio.aac
set TMPVIDEO=tmpvideo.mp4

:: Check arguments
IF [%1] == [] GOTO NOARGS

:SETNAMEOK

:: Check ffmpeg...
if exist "%FFMPEGPATH%/ffmpeg.exe" goto FFMPEGOK
goto NOFFMPEG

:FFMPEGOK

:: Create temporary directories
mkdir %FRAMESTEMPDIR%
mkdir %OUTTEMPDIR%

:: Execute commands (as simple as it is)
echo Converting video to images...
"%FFMPEGPATH%/ffmpeg.exe" -y -i %1 %FRAMESTEMPDIR%/%IMAGETMPL%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Stitching
echo Stitching frames...
for %%f in (%FRAMESTEMPDIR%/*.jpg) do (
:: For whatever reason (this has to be at the beginning of the line!)
  echo Processing frame %FRAMESTEMPDIR%\%%f
:: TODO: There should be some error checking
  call gear360pano.cmd /o %OUTTEMPDIR% %FRAMESTEMPDIR%\%%f %PTOTMPL%
)

echo "Reencoding video..."
"%FFMPEGPATH%/ffmpeg.exe" -y -f image2 -i %OUTTEMPDIR%/%IMAGETMPLENC% -r 30 -s 3840:1920 -vcodec libx264 %OUTTEMPDIR%/%TMPVIDEO%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

echo "Extracting audio..."
"%FFMPEGPATH%/ffmpeg.exe" -y -i %1 -vn -acodec copy %OUTTEMPDIR%/%TMPAUDIO%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

echo "Merging audio..."

:: Check if second argument present, if not, set some default for output filename
:: This is here, because for whatever reason OUTNAME gets overriden by
:: the last iterated filename if this is at the beginning (for loop is buggy?)
if not [%2] == [] goto SETNAMEOK
set OUTNAME="%~n1_pano.mp4"

:SETNAMEOK

"%FFMPEGPATH%/ffmpeg.exe" -y -i %OUTTEMPDIR%/%TMPVIDEO% -i %OUTTEMPDIR%/%TMPAUDIO% -c:v copy -c:a aac -strict experimental %OUTNAME%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Clean-up (f - force, read-only & dirs, q - quiet)
del /f /q %FRAMESTEMPDIR%
del /f /q %OUTTEMPDIR%

echo Video written to %OUTNAME%
goto END

:NOARGS

echo Script to stitch raw video panorama files, raw
echo meaning two fisheye images side by side.
echo.
echo Script originally writen for Samsung Gear 360.
echo.
echo Usage:
echo %0 inputfile [outputfile]
echo.
echo Where inputfile is a panorama file from camera,
echo output parameter is optional
goto END

:NOFFMPEG

echo ffmpeg was not found in %FFMPEGPATH%, download from: https://ffmpeg.zeranoe.com/builds/
echo and unpack to program files directory
goto END

:FFMPEGERROR

echo ffmpeg failed, video not created
goto END

:END

Fix typo for temporary directory

Fix typo for temporary directory


@ECHO OFF

rem Change the current working directory to the location of this batch script.
pushd "%~dp0"
copy /Y mushclient_prefs.sqlite.sample mushclient_prefs.sqlite > nul
copy /Y MUSHclient.ini.sample MUSHclient.ini > nul
if not exist "worlds\mume\mume.mcl" copy /Y worlds\mume\mume.mcl.sample worlds\mume\mume.mcl > nul
start MUSHclient.exe
cd mapperproxy
for %%x in (python.exe) do (
	if not [%%~$PATH:x]==[] (
		echo "Running mapper with Python."
		python.exe -B start.py --format raw
		goto :finished
	)
)
rem If we're here, Python wasn't found in the path.
echo "Error: Unable to locate Python!"
echo "This script requires that either PyPy or Python be installed and in the path."
pause
:finished
rem Reset the working directory to it's previous value, before this batch script was run.
popd

@ECHO OFF

rem Change the current working directory to the location of this batch script.
pushd "%~dp0"
copy /Y mushclient_prefs.sqlite.sample mushclient_prefs.sqlite > nul
copy /Y MUSHclient.ini.sample MUSHclient.ini > nul
if not exist "worlds\mume\mume.mcl" copy /Y worlds\mume\mume.mcl.sample worlds\mume\mume.mcl > nul
start MUSHclient.exe
cd mapperproxy
for %%x in (python.exe) do (
	if not [%%~$PATH:x]==[] (
		echo "Running mapper with Python."
		python.exe -B start.py --interface hc --format raw
		goto :finished
	)
)
rem If we're here, Python wasn't found in the path.
echo "Error: Unable to locate Python!"
echo "This script requires that either PyPy or Python be installed and in the path."
pause
:finished
rem Reset the working directory to it's previous value, before this batch script was run.
popd

Update mc.bat to once again load the high contrast GUI by default.


rem we test the java layer
rem
rem we need
rem if [ $# -ne 2 ]
rem then
rem    exit 1
rem fi

SET PKG=de.atrsoft.successorofoak.utilities.logging.atrshmlog.tests
SET LIBDIR=./de/atrsoft/successorofoak/utilities/logging/atrshmlog/lib

rem we use this time the package version. so its with the classspath / package
rem the shared lib is also moved to the package lib dir here
rem on mingw we need also the runtime dll of the compiler stuff,
rem and in case its apthread version the libpthread
rem see the doc for more on mingw

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestAttach

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGettime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSgettime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestStatistics

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSleepNanos

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestEnvPrefix

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGetEnv _ID

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestVersion

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestEventLocksMax 10042

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestEvent

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestLogging

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestShmid

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestArea

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestBufferMaxSize

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestBufferSize

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSlaveCount 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestClockId

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSlaveRunOff 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWaitForSlaves

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestBufferSlaveWait

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestAcquireCount

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestPreallocCount

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGetTime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGetRealtime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestStop

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestFlush

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestStrategy

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestCreateSlave

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestDecrementSlaveCount

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestFence

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestInitInAdvance

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestNextSlave 3

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestChecksum

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestAutoflush

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestVerify

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestClicktime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestThreadLocal

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReuseBuffer

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWrite

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteString

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteString2

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteString3

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteBytes

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWrite

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestRead 0

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestCreate 2 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestCleanupLocks

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestInitShmLog 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestDelete 2

rem end of file

rem we test the java layer
rem
rem we need
rem if [ $# -ne 2 ]
rem then
rem    exit 1
rem fi

SET PKG=de.atrsoft.successorofoak.utilities.logging.atrshmlog.tests
SET LIBDIR=./de/atrsoft/successorofoak/utilities/logging/atrshmlog/lib

rem we use this time the package version. so its with the classspath / package
rem the shared lib is also moved to the package lib dir here
rem on mingw we need also the runtime dll of the compiler stuff,
rem and in case its apthread version the libpthread
rem see the doc for more on mingw

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestAttach

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGettime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSgettime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestStatistics

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSleepNanos

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestEnvPrefix

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGetEnv _ID

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestVersion

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestEventLocksMax 10042

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestEvent

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestLogging

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestShmid

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestArea

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestBufferMaxSize

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestBufferSize

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSlaveCount 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestClockId

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestSlaveRunOff 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWaitForSlaves

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestBufferSlaveWait

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestAcquireCount

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestPreallocCount

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGetInitTime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestGetRealtime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestStop

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestFlush

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestStrategy

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestCreateSlave

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestDecrementSlaveCount

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestFence

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestInitInAdvance

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestNextSlave 3

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestChecksum

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestAutoflush

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestVerify

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestClicktime

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestThreadLocal

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReuseBuffer

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWrite

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteString

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteString2

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteString3

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWriteBytes

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestWrite

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestRead 0

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestReadFetch

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestCreate 2 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestCleanupLocks

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestInitShmLog 8

java -Djava.library.path=%LIBDIR% %PKG%.ATRSHMLOGTestDelete 2

rem end of file

fix name problem on mingw

fix name problem on mingw


REM set TMP="%LOCALAPPDATA%\Temp"
REM set TEMP="%LOCALAPPDATA%\Temp"
REM set TMPDIR="%LOCALAPPDATA%\Temp"
if "%ARCH%" == "64" (
set GCC_ARCH=x86_64-w64-mingw32
set EXTRA_FLAGS=-DMS_WIN64
) else (
set GCC_ARCH=i686-w64-mingw32
)
bash -lc "ln -s ${LOCALAPPDATA}/Temp /tmp"
bash -lc "cd src; ./configure --disable-openmp --enable-python --build=$GCC_ARCH --host=$GCC_ARCH --target=$GCC_ARCH"
bash -lc "cd src; make"
bash -lc "cd src; make install"

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

fix fftw error on win64

fix fftw error on win64


echo off
bundle exec ruby ead2html.rb -i %1 -o %2

Add batch file for Windows

Add batch file for Windows


@REM Copyright (c) 2008 - 2010, Apple, Inc.  All rights reserved.
@REM All rights reserved. This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM Example usage of this script. default is a DEBUG build
@REM b
@REM b clean
@REM b release
@REM b release clean
@REM b -v -y build.log

ECHO OFF
@REM Setup Build environment. Sets WORKSPACE and puts build in path
CALL ..\edksetup.bat

@REM Set for tools chain. Currently ARMGCC
SET TARGET_TOOLS=ARMGCC
SET TARGET=DEBUG

@if /I "%1"=="RELEASE" (
  @REM If 1st argument is release set TARGET to RELEASE and shift arguments to remove it
  SET TARGET=RELEASE
  shift /1
)

SET BUILD_ROOT=%WORKSPACE%\Build\BeagleBoard\%TARGET%_%TARGET_TOOLS%

@REM Build the Beagle Board firmware and creat an FD (FLASH Device) Image.
CALL build -p BeagleBoardPkg\BeagleBoardPkg.dsc -a ARM -t %TARGET_TOOLS% -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8
@if ERRORLEVEL 1 goto Exit

@if /I "%1"=="CLEAN" goto Clean

@REM
@REM Ram starts at 0x80000000
@REM OMAP 3530 TRM defines 0x80008208 as the entry point
@REM The reset vector is caught by the mask ROM in the OMAP 3530 so that is why this entry
@REM point looks so strange.
@REM OMAP 3430 TRM section 26.4.8 has Image header information. (missing in OMAP 3530 TRM)
@REM
@cd Tools

ECHO Building tools...
CALL nmake

ECHO Patching image with ConfigurationHeader.dat
CALL GenerateImage -D ..\ConfigurationHeader.dat -E 0x80008208 -I %BUILD_ROOT%\FV\BEAGLEBOARD_EFI.fd -O %BUILD_ROOT%\FV\BeagleBoard_EFI_flashboot.fd

ECHO Patching ..\Debugger_scripts ...
SET DEBUGGER_SCRIPT=..\Debugger_scripts
@for /f %%a IN ('dir /b %DEBUGGER_SCRIPT%\*.inc %DEBUGGER_SCRIPT%\*.cmm') do (
  @CALL replace %DEBUGGER_SCRIPT%\%%a %BUILD_ROOT%\%%a ZZZZZZ %BUILD_ROOT% WWWWWW  %WORKSPACE%
)

cd ..
:Exit
EXIT /B

:Clean
cd Tools
CALL nmake clean
cd ..

Add a build script for code socery gcc.

Add a build script for code socery gcc.

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@10260 6f19259b-4bc3-4df7-8a09-765794883524


REM Get QnA.exe location from registry, and pass parameters as relevance to evaluate
@echo off
Set Relevance=%*

REM https://stackoverflow.com/a/23328830/861745
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\EnterpriseClient" /v EnterpriseClientFolder 2^>^&1^|find "REG_"') do @set sPath=%%b

echo %Relevance% | "%sPath%qna" -t -showtypes

Update EvalRelevance.bat

Update EvalRelevance.bat


@pushd %~dp0

ECHO Remember to build the solution first!
REM pause

"%~dp0\TestHarness\packages\NUnit.Runners.2.6.3\tools\nunit-console.exe" "%~dp0\TestHarness\nunit\bin\Debug\nunitHarness.dll" /result=results-example-nunit.xml /nologo /nodots

pause

@popd

Add ability to generate nunit test results


SETLOCAL

%USERPROFILE%\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin\dnx %~dp0..\src\Omnisharp run %*

SETLOCAL

%USERPROFILE%\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin\dnx %~dp0..\src\OmniSharp run %*

fix case to OmniSharp project

fix case to OmniSharp project


@ECHO OFF

REM ----------------------------------------------------------------------
REM PHP version 5
REM ----------------------------------------------------------------------
REM Copyright (c) 1997-2004 The PHP Group
REM ----------------------------------------------------------------------
REM  This source file is subject to version 3.0 of the PHP license,
REM  that is bundled with this package in the file LICENSE, and is
REM  available at through the world-wide-web at
REM  http://www.php.net/license/3_0.txt.
REM  If you did not receive a copy of the PHP license and are unable to
REM  obtain it through the world-wide-web, please send a note to
REM  license@php.net so we can mail you a copy immediately.
REM ----------------------------------------------------------------------
REM  Authors:     Alexander Merz (alexmerz@php.net)
REM ----------------------------------------------------------------------
REM
REM  Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)

REM change this lines to match the paths of your system
REM -------------------

REM Test to see if this is a raw pear.bat (uninstalled version)
SET TMPTMPTMPTMPT=@includ
SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)

REM Check PEAR global ENV, set them if they do not exist
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
GOTO :INSTALLED

:NOTINSTALLED
ECHO WARNING: This is a raw, uninstalled pear.bat

REM Check to see if we can grab the directory of this file (Windows NT+)
IF %~n0 == pear (
FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
"%PHP_PEAR_PHP_BIN%" -v
GOTO :NEXTTEST
))
GOTO :FAILAUTODETECT
:NEXTTEST
IF "%PHP_PEAR_PHP_BIN%" NEQ "" (

REM We can use this PHP to run a temporary php file to get the dirname of pear

echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php
"%PHP_PEAR_PHP_BIN%" ~~getloc.php
set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
DEL ~a.a
DEL ~~getloc.php
set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"

REM Make sure there is a pearcmd.php at our disposal

IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
)
)
GOTO :INSTALLED
) ELSE (
REM Windows Me/98 cannot succeed, so allow the batch to fail
)
:FAILAUTODETECT
echo WARNING: failed to auto-detect pear information
:INSTALLED

REM Check Folders and files
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
REM launch pearcmd
GOTO RUN
:PEAR_INSTALL_ERROR
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_INSTALL_DIR%
GOTO END
:PEAR_INSTALL_ERROR2
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
ECHO pearcmd.php could not be found there.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_INSTALL_DIR%
GOTO END
:PEAR_BIN_ERROR
ECHO PHP_PEAR_BIN_DIR is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_BIN_DIR%
GOTO END
:PEAR_PHPBIN_ERROR
ECHO PHP_PEAR_PHP_BIN is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_PHP_BIN%
GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
@ECHO ON

@ECHO OFF

REM ----------------------------------------------------------------------
REM PHP version 5
REM ----------------------------------------------------------------------
REM Copyright (c) 1997-2010 The Authors
REM ----------------------------------------------------------------------
REM http://opensource.org/licenses/bsd-license.php New BSD License
REM ----------------------------------------------------------------------
REM  Authors:     Alexander Merz (alexmerz@php.net)
REM ----------------------------------------------------------------------
REM
REM  Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)

REM change this lines to match the paths of your system
REM -------------------

REM Test to see if this is a raw pear.bat (uninstalled version)
SET TMPTMPTMPTMPT=@includ
SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)

REM Check PEAR global ENV, set them if they do not exist
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
GOTO :INSTALLED

:NOTINSTALLED
ECHO WARNING: This is a raw, uninstalled pear.bat

REM Check to see if we can grab the directory of this file (Windows NT+)
IF %~n0 == pear (
FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
"%PHP_PEAR_PHP_BIN%" -v
GOTO :NEXTTEST
))
GOTO :FAILAUTODETECT
:NEXTTEST
IF "%PHP_PEAR_PHP_BIN%" NEQ "" (

REM We can use this PHP to run a temporary php file to get the dirname of pear

echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php
"%PHP_PEAR_PHP_BIN%" ~~getloc.php
set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
DEL ~a.a
DEL ~~getloc.php
set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"

REM Make sure there is a pearcmd.php at our disposal

IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
)
)
GOTO :INSTALLED
) ELSE (
REM Windows Me/98 cannot succeed, so allow the batch to fail
)
:FAILAUTODETECT
echo WARNING: failed to auto-detect pear information
:INSTALLED

REM Check Folders and files
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
REM launch pearcmd
GOTO RUN
:PEAR_INSTALL_ERROR
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_INSTALL_DIR%
GOTO END
:PEAR_INSTALL_ERROR2
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
ECHO pearcmd.php could not be found there.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_INSTALL_DIR%
GOTO END
:PEAR_BIN_ERROR
ECHO PHP_PEAR_BIN_DIR is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_BIN_DIR%
GOTO END
:PEAR_PHPBIN_ERROR
ECHO PHP_PEAR_PHP_BIN is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_PHP_BIN%
GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
@ECHO ON

Replace the PHP license with New BSD like rest of the installer.


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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Build Master:2017-02-28T17:42:58.124Z

Build Master:2017-02-28T17:42:58.124Z


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

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

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

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

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

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install NPM packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  eval $NPM_CMD install --production
  exitWithMessageOnError "npm failed"
  cd - > /dev/null
fi

:: 4. Run Gulp Task
if [ -e "$DEPLOYMENT_TARGET/gulpfile.js" ]; then
  cd "$DEPLOYMENT_TARGET"
  eval ./node_modules/.bin/gulp imagemin
  exitWithMessageOnError "gulp failed"
  cd - > /dev/null
fi

::5. Unzip file
cd "$DEPLOYMENT_TARGET"
eval unzip -o Archive.zip
cd - > /dev/null

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

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

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

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

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

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install NPM packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  eval $NPM_CMD install --production
  exitWithMessageOnError "npm failed"
  cd - > /dev/null
fi

:: 4. Run Gulp Task
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
  pushd "%DEPLOYMENT_TARGET%"
  eval ./node_modules/.bin/gulp imagemin
  exitWithMessageOnError "gulp failed"
  cd - > /dev/null
fi

::5. Unzip file
IF EXIST "%DEPLOYMENT_TARGET%"
eval unzip -o Archive.zip
cd - > /dev/null

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

edit deployment script

edit deployment script


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

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

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

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

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

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

echo 2. Select node version
call :SelectNodeVersion

echo 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 4. Install bower packages
IF EXIST "bower.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd bower install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 5. Gulp build
IF EXIST "gulpfile.js (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd gulp build
  call :ExecuteCmd gulp
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

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

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

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

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

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

echo 2. Select node version
call :SelectNodeVersion

echo 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 4. Install bower packages
IF EXIST "bower.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd bower install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 5. Gulp build
IF EXIST "gulpfile.js (
  pushd "%DEPLOYMENT_TARGET%"
  call .\node_modules\.bin\gulp build
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

fix kudu

fix kudu


@echo off

REM
REM Verify that we can find the 'makepanda' python script
REM and the python interpreter.  If we can find both, then
REM run 'makepanda'.
REM

set thirdparty=thirdparty
if defined MAKEPANDA_THIRDPARTY set thirdparty=%MAKEPANDA_THIRDPARTY%

if not exist makepanda\makepanda.py goto :missing1
if not exist %thirdparty%\win-python\python.exe goto :missing2
%thirdparty%\win-python\python.exe makepanda\makepanda.py %*
if errorlevel 1 if x%1 == x--slavebuild exit 1
goto done

:missing1
  echo You need to change directory to the root of the panda source tree
  echo before invoking makepanda.  For further install instructions, read
  echo the installation instructions in the file doc/INSTALL-MK.
  goto done

:missing2
  echo You seem to be missing the 'thirdparty' directory.  You probably checked
  echo the source code out from sourceforge.  The sourceforge repository is
  echo missing the 'thirdparty' directory.  You will need to supplement the
  echo code by downloading the 'thirdparty' directory from www.panda3d.org
  goto done

:done

@echo off

REM
REM Check the Windows architecture and determine with Python
REM to use; 64-bit or 32-bit. Verify that we can find the
REM 'makepanda' python script and the python interpreter.
REM If we can find both, then run 'makepanda'.
REM

if %PROCESSOR_ARCHITECTURE% == AMD64 (
  set pythondir=win-python-x64
) else (
  set pythondir=win-python
)

set thirdparty=thirdparty
if defined MAKEPANDA_THIRDPARTY set thirdparty=%MAKEPANDA_THIRDPARTY%

if not exist makepanda\makepanda.py goto :missing1
if not exist %thirdparty%\%pythondir%\python.exe goto :missing2
%thirdparty%\%pythondir%\python.exe makepanda\makepanda.py %*
if errorlevel 1 if x%1 == x--slavebuild exit 1
goto done

:missing1
  echo You need to change directory to the root of the panda source tree
  echo before invoking makepanda.  For further install instructions, read
  echo the installation instructions in the file doc/INSTALL-MK.
  goto done

:missing2
  echo %thirdparty%
  echo You seem to be missing the 'thirdparty' directory.  You probably checked
  echo the source code out from sourceforge.  The sourceforge repository is
  echo missing the 'thirdparty' directory.  You will need to supplement the
  echo code by downloading the 'thirdparty' directory from www.panda3d.org
  goto done

:done

Add a check for 32-bit vs 64-bit OS and then use the appropriate python


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

use latest npm on Windows (#246)

chore: use latest npm on Windows (#246)


@echo off

rem Restart clause
:start

rem Unfuckup batch file processing
setlocal enabledelayedexpansion

rem Setup some global variables
set root=%~dp0
set repos=%root%\repos
set git_setup="%root%\setup\git\git.exe"

rem Look up the git command prompt either in the path or in a couple of predefined places
set paths=("C:\Program Files\Git", "C:\Program Files (x86)\Git")
set git_root=undefined

set base_path=("%PATH:;=" "%")
for %%p in %base_path% do (
    if exist %%p\git.exe (
        set base=%%~p
        set git_root="!base:~0,-4!"
    )
)
if %git_root%==undefined (
    for %%p in %paths% do (
        if exist %%p\bin\git.exe set git_root=%%p
    )
)
rem If the git couldn't be found, offer to install it
if %git_root%==undefined (
    echo GitBox couldn't locate a valid git installation.
    echo.
    echo If you do have it installed, please set it in your PATH variable,
    echo otherwise GitBox can install one for you.
    echo.

    set choice=undefined
    set /P choice="Should GitBox install its own git? (y/n): "

    if not '!choice!'=='' set choice=!choice:~0,1!
    if /i not '!choice!'=='Y' (
        echo Aborting.
        goto end
    ) else (
        echo Installing git...
        %git_setup%
        if errorlevel 1 (
            echo GitBox couldn't install git.
            pause
        ) else (
            echo Git successfully installed.
            echo Continuing with initial command.
            echo.

            rem Restart the script to execute the initial command
            goto start
        )
    )
    goto end
)

rem If git was found, execute any requested operation, or simply start the git shell
set PATH=%git_root:"=%\bin;%git_root:"=%\cmd;%PATH%
set PLINK_PROTOCOL=ssh
if "%HOME%"=="" (
    set HOME=%USERPROFILE%
)

if /i '%1'=='' (
    start sh.exe --login -i
    goto end
)
if /i '%1'=='list' (
     rem Get the group name or the default (all) and indentation (internal)
    set group=%~2
    if '%2'=='' set group=.
    set indent=%~3
    if '%3'=='' (
        set "indent= "
        echo List of repositories tracked by GitBox:
    )

    rem Iterate through all the groups in the requested folder and print them
    for /f "Delims=" %%d in ('dir /AD /B "%repos%\!group!"') do (
        set folder=%%d
        if not '!folder:~-4!'=='.git' (
            echo !indent!+ !folder!
            call %0 list "!group!/!folder!" "  !indent!"
        )
    )

    rem Iterate through all the repositories in the requested folder and print them
    for /f "Delims=" %%d in ('dir /AD /B "%repos%\!group!"') do (
        set dir=%%d
        if '!dir:~-4!'=='.git' (
            echo !indent!- !dir:~0,-4!
        )
    )
    if '%3'=='' (
        pause
    )
    goto end
)
if /i '%1'=='create' (
    rem Strip sorrounding quotes
    set repo_name=%2
    set repo_name=!repo_name:"=!

    set repository="%repos%\!repo_name!.git"
    if not exist !repository! (
        rem Create a new empty repository
        echo Creating empty repository...
        md !repository!
        git init --quiet --bare !repository!

        rem Since git doesn't like empty repos, place a README in there are save the user a lof of headaches
        echo Initializing new repository...
        set checkout="%TEMP%\!repo_name!"
        md !checkout!
        git clone --quiet --origin gitbox file://!repository! !checkout! 2>nul

        echo Enjoy your GitBox repository > !checkout!\README
        set pwd="%CD%"
        cd /d !checkout!
        git add README
        git commit --quiet -m "Created the repository" 2>nul
        git push --quiet gitbox master 2>nul
        cd /d !pwd!

        rmdir /s /q !checkout!
        echo Repository successfully created.
    ) else (
        echo A repository named "!repo_name!" is already tracked by GitBox.
        pause
    )
    goto end
)
if /i '%1'=='clone' (
    rem Strip sorrounding quotes
    set repo_name=%2
    set repo_name=!repo_name:"=!

    rem Clone the specified repository with the gitbox repo as the master
    set repository="%repos%\!repo_name!.git"
    if exist !repository! (
        echo Cloning repository...
        echo !repository!
        git clone --quiet --origin gitbox file://!repository!
        if errorlevel 1 (
            echo Failed to clone repository.
        ) else (
            echo Repository successfully cloned.
        )
    ) else (
        echo GitBox couldn't find the repository named: !repo_name!
        pause
    )
    goto end
)
if /i '%1'=='import' (
    rem Make sure there is actually a repository to import
    git rev-parse 2>nul
    if errorlevel 1 (
        echo In order to import a git repository into GitBox,
        echo you need to invoke the command from within the repo.
        pause
    ) else (
        rem Strip sorrounding quotes
        set repo_name=%2
        set repo_name=!repo_name:"=!

        rem Create a new empty repository
        set repository="%repos%\!repo_name!.git"
        if not exist !repository! (
            echo Creating empty repository...
            md !repository!
            git init --quiet --bare !repository!

            rem Add an entry to the list of remote repositories and push to it
            echo Importing data into new repository...
            git remote add gitbox file://!repository!
            git push --quiet gitbox master
            echo Repository successfully imported.
        ) else (
            echo A repository named "!repo_name!" is already tracked by GitBox.
            pause
        )
    )
    goto end
)
echo Unknown GitBox command.
echo.
echo Gitbox command list:
echo   list   [group] Lists all the git repositories tracked by GitBox.  The optional
echo                  group lists only a subgroup of the maintained repos.
echo   create ^<repo^>  Creates a new empty git repository called ^<repo^> inside the
echo                  GitBox repository collection.
echo   clone  ^<repo^>  Clones a git repository called ^<repo^> from the GitBox
echo                  collection into the current folder (remote called gitbox).
echo   import ^<repo^>  Imports an existing git repository into GitBox (remote
echo                  called gitbox).
pause

rem Escape clause
:end

Remove a lost space.

Remove a lost space.


@echo off
setlocal enableDelayedExpansion

for /F %%G in ('dir /B/D ..\src\gamemodes\*.pwn') do (
    "compiler\pawncc.exe" "..\src\gamemodes\%%G" -o"server\gamemodes\%%~nG.amx" -i"..\src\includes" "-;" "-("
)

for /F %%G in ('dir /B/D ..\src\filterscripts\*.pwn') do (
    "compiler\pawncc.exe" "..\src\filterscripts\%%G" -o"server\filterscripts\%%~nG.amx" -i"..\src\includes" "-;" "-("
)

@echo off
setlocal enableDelayedExpansion

Echo Compiling gamemodes...
for /F %%G in ('dir /B/D ..\src\gamemodes\*.pwn') do (
    Echo src\gamemodes\%%~nxG
    "compiler\pawncc.exe" "..\src\gamemodes\%%G" -o"server\gamemodes\%%~nG.amx" -i"..\src\includes" "-;" "-("
)

Echo Compiling filterscripts...
for /F %%G in ('dir /B/D ..\src\filterscripts\*.pwn') do (
    Echo src\filterscripts\%%~nxG
    "compiler\pawncc.exe" "..\src\filterscripts\%%G" -o"server\filterscripts\%%~nG.amx" -i"..\src\includes" "-;" "-("
)

Add ECHO messages

Add ECHO messages


@ECHO OFF

SETLOCAL ENABLEDELAYEDEXPANSION

@REM Determine command to run java
IF DEFINED JAVA_HOME GOTO findJavaFromJavaHome

SET JAVACMD=java.exe
%JAVACMD% -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 JAVACMD=%JAVA_HOME%/bin/java.exe

IF EXIST "%JAVACMD%" 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 Determine java options
IF "%GRAIN_OPTS%" == "" set GRAIN_OPTS=-server -Xmx256M -Xms32M -XX:PermSize=32m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8
SET JAVA_OPTS=%GRAIN_OPTS% %JAVA_OPTS%

@REM Get target Grain version

SET APP_PROPS=application.properties

IF NOT EXIST "%APP_PROPS%" (
    ECHO Error: %APP_PROPS% not found
    GOTO fail
)

FOR /f "tokens=1*delims== " %%a IN (%APP_PROPS%) DO (
    IF /i "%%a"=="grain.version" (
        SET "GRAIN_VERSION=%%b"
    )
)

IF "%GRAIN_VERSION%" == "" (
    ECHO Unable to determine Grain version from %APP_PROPS%
    GOTO fail
)

@REM Check if site deps exists for current Grain version
SET SITE_DEPS=.site-%GRAIN_VERSION%.dep

IF NOT EXIST "%SITE_DEPS%" (
    @REM Site deps don't exist - generate them
    CALL gradlew.bat gendeps
    IF NOT "%ERRORLEVEL%"=="0" GOTO fail
)

CALL :validateAndLaunch %*
if "%ERRORLEVEL%"=="2" (
    @REM Site deps invalid - regenerate them
    CALL gradlew.bat gendeps
    IF NOT "%ERRORLEVEL%"=="0" GOTO fail
    CALL :validateAndLaunch %*
)
EXIT /B %ERRORLEVEL%

:fail
EXIT /B 1

:validateAndLaunch
@REM Get Grain JAR from site deps

FOR /F ^"usebackq^ eol^=^

^ delims^=^" %%a in (%SITE_DEPS%) do (
   SET GRAIN_JAR=%%a
   GOTO _validate1
)
:_validate1

IF NOT EXIST "%GRAIN_JAR%" (
    @REM Grain Jar doesn't exist - regenerate site deps and recompute Grain Jar
    CALL gradlew.bat gendeps
    IF NOT "%ERRORLEVEL%"=="0" GOTO fail
    FOR /f %%a in (%SITE_DEPS%) do (
        SET GRAIN_JAR=%%a
        GOTO _validate2
    )
)
:_validate2

@REM Check if site deps are valid
"%JAVACMD%" %JAVA_OPTS% -cp "%GRAIN_JAR%" com.sysgears.grain.SiteLauncher %GRAIN_VERSION% -- %*
GOTO :EOF

:mainEnd
ENDLOCAL

@ECHO OFF

SETLOCAL ENABLEDELAYEDEXPANSION

@REM Determine command to run java
IF DEFINED JAVA_HOME GOTO findJavaFromJavaHome

SET JAVACMD=java.exe
%JAVACMD% -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 JAVACMD=%JAVA_HOME%/bin/java.exe

IF EXIST "%JAVACMD%" 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 Determine java options
IF "%GRAIN_OPTS%" == "" set GRAIN_OPTS=-server -Xmx256M -Xms32M -XX:PermSize=32m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8
SET JAVA_OPTS=%GRAIN_OPTS% %JAVA_OPTS%

@REM Get target Grain version

SET APP_PROPS=application.properties

IF NOT EXIST "%APP_PROPS%" (
    ECHO Error: %APP_PROPS% not found
    GOTO fail
)

FOR /f "tokens=1*delims== " %%a IN (%APP_PROPS%) DO (
    IF /i "%%a"=="grain.version" (
        SET "GRAIN_VERSION=%%b"
    )
)

IF "%GRAIN_VERSION%" == "" (
    ECHO Unable to determine Grain version from %APP_PROPS%
    GOTO fail
)

@REM Check if site deps exists for current Grain version
SET SITE_DEPS=.site-%GRAIN_VERSION%.dep

IF NOT EXIST "%SITE_DEPS%" (
    @REM Site deps don't exist - generate them
    CALL gradlew.bat gendeps
    IF NOT "%ERRORLEVEL%"=="0" GOTO fail
)

CALL :validateAndLaunch %*
if "%ERRORLEVEL%"=="2" (
    @REM Site deps invalid - regenerate them
    CALL gradlew.bat gendeps
    CALL :validateAndLaunch %*
)
EXIT /B %ERRORLEVEL%

:fail
EXIT /B 1

:validateAndLaunch
@REM Get Grain JAR from site deps

FOR /F ^"usebackq^ eol^=^

^ delims^=^" %%a in (%SITE_DEPS%) do (
   SET GRAIN_JAR=%%a
   GOTO _validate1
)
:_validate1

IF NOT EXIST "%GRAIN_JAR%" (
    @REM Grain Jar doesn't exist - regenerate site deps and recompute Grain Jar
    CALL gradlew.bat gendeps
    IF NOT "%ERRORLEVEL%"=="0" GOTO fail
    FOR /f %%a in (%SITE_DEPS%) do (
        SET GRAIN_JAR=%%a
        GOTO _validate2
    )
)
:_validate2

@REM Check if site deps are valid
"%JAVACMD%" %JAVA_OPTS% -cp "%GRAIN_JAR%" com.sysgears.grain.SiteLauncher %GRAIN_VERSION% -- %*
GOTO :EOF

:mainEnd
ENDLOCAL

Fix grain not launching under Windows the first time after snapshot update Signed-off-by: Dmitriy Pavlenko <dmitriy.pavlenko@sysgears.com>

Fix grain not launching under Windows the first time after snapshot update
Signed-off-by: Dmitriy Pavlenko <ea58eea250c59e0289388b3f7eba86b0955b6ce8@sysgears.com>


copy /y testapp\Resources\* win32\test\Resources
copy /y testapp\* win32\test\
win32\test\test.exe

add file to execute test app

add file to execute test app