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

:: ----------------------
:: KUDU Deployment Script
:: ----------------------

:: 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=node "%appdata%\npm\node_modules\kuduSync\bin\kuduSync"
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

%DEPLOYMENT_SOURCE%\.nuget\NuGet.exe restore %DEPLOYMENT_SOURCE%\JabbR.sln -configFile %DEPLOYMENT_SOURCE%\.nuget\NuGet.config

:: 1. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  %MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\JabbR\JabbR.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  %MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\JabbR\JabbR.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

:: 2. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call %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"
  IF !ERRORLEVEL! NEQ 0 goto error
)

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

goto end

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
echo Finished successfully.

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

:: ----------------------
:: KUDU Deployment Script
:: ----------------------

:: 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=node "%appdata%\npm\node_modules\kuduSync\bin\kuduSync"
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

%DEPLOYMENT_SOURCE%\.nuget\NuGet.exe restore %DEPLOYMENT_SOURCE%\JabbR.sln -configFile %DEPLOYMENT_SOURCE%\.nuget\NuGet.config

:: 1. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\JabbR\JabbR.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\JabbR\JabbR.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

:: 2. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call %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"
  IF !ERRORLEVEL! NEQ 0 goto error
)

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

goto end

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
echo Finished successfully.

put quote around MSBUILD_PATH to avoid space issue


echo off
REM
REM This batch file builds both 32-bit and 64-bit versions of the loader.
REM It is assumed that the developer has run the update_external_sources.bat
REM file prior to running this.
REM

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%

REM Cleanup the file we used to collect the VS version output since it's no longer needed.
del /Q /F vsversion.tmp

rmdir /Q /S build
rmdir /Q /S build32

REM *******************************************
REM 64-bit LoaderAndTools build
REM *******************************************
mkdir build
pushd build

echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION% Win64" ..

echo Building 64-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Debug build failed!
   set errorCode=1
)

echo Building 64-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Release build failed!
   set errorCode=1
)

popd

REM *******************************************
REM 32-bit LoaderAndTools build
REM *******************************************
mkdir build32
pushd build32

echo Generating 32-bit LoaderAndTools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION%" ..

echo Building 32-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Debug build failed!
   set errorCode=1
)

echo Building 32-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Release build failed!
   set errorCode=1
)

popd

misc: Create a script to allow building 32-bit and 64-bit Windows.

Create a script to allow people to build both versions of Windows
targets from a command-line.


call lein uberjar

\halite.exe -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot"

call lein uberjar

halite.exe -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot"

remove backslash from in front of halite.exe so that windows will look for it in the current folder


MKDIR build\windows
CD build\windows

cmake ^
    -G "NMake Makefiles"                   ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%  ^
    -DCMAKE_INSTALL_BINDIR=%LIBRARY_BIN%     ^
    -DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB%     ^
    -DCMAKE_INSTALL_INCLUDEDIR=%LIBRARY_INC% ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%     ^
    -DCMAKE_BUILD_TYPE=Release               ^
    ..\..

cmake --build . --config Release

copy libmetis\Release\metis.lib %LIBRARY_BIN%
copy programs\Release\cmpfillin.exe %LIBRARY_LIB%
copy programs\Release\gpmetis.exe %LIBRARY_LIB%
copy programs\Release\graphchk.exe %LIBRARY_LIB%
copy programs\Release\m2gmetis.exe %LIBRARY_LIB%
copy programs\Release\ndmetis.exe %LIBRARY_LIB%
copy programs\Release\mpmetis.exe %LIBRARY_LIB%

MKDIR build\windows
CD build\windows

cmake ^
    -G "NMake Makefiles"                     ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%  ^
    -DCMAKE_INSTALL_BINDIR=%LIBRARY_BIN%     ^
    -DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB%     ^
    -DCMAKE_INSTALL_INCLUDEDIR=%LIBRARY_INC% ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%     ^
    -DCMAKE_BUILD_TYPE=Release               ^
    ..\..

cmake --build . --config Release

dir
dir libmetis
dir programs
dir include
dir Release
dir libmetis\Release
dir programs\Release
dir include\Release

copy libmetis\Release\metis.lib %LIBRARY_BIN%
copy programs\Release\cmpfillin.exe %LIBRARY_LIB%
copy programs\Release\gpmetis.exe %LIBRARY_LIB%
copy programs\Release\graphchk.exe %LIBRARY_LIB%
copy programs\Release\m2gmetis.exe %LIBRARY_LIB%
copy programs\Release\ndmetis.exe %LIBRARY_LIB%
copy programs\Release\mpmetis.exe %LIBRARY_LIB%

Update bld.bat

Update bld.bat


@echo off
set rebarscript=%0
escript.exe %rebarscript:.bat=% %*

@echo off
setlocal
set rebarscript=%0
escript.exe %rebarscript:.bat=% %*

Set local scope for env vars in rebar.bat


@echo off

set DIST_DIR=dist
set CERTIFICATE_PATH="%USERPROFILE%\certificates\nuxeo.com.pfx"
set MSI_PROGRAM_NAME="Nuxeo Drive"
set TIMESTAMP_URL=http://timestamp.verisign.com/scripts/timstamp.dll

set SIGN_CMD=signtool sign /v /f %CERTIFICATE_PATH% /d %MSI_PROGRAM_NAME% /t %TIMESTAMP_URL%
set VERIFY_CMD=signtool verify /v /pa

FOR %%F IN (%DIST_DIR%\*.msi) DO (
	echo ---------------------------------------------
	echo Signing %%F
    echo ---------------------------------------------
	echo %SIGN_CMD% %%F
	%SIGN_CMD% %%F
	echo ---------------------------------------------
    echo Verifying %%F
	echo ---------------------------------------------
    echo %VERIFY_CMD% %%F
	%VERIFY_CMD% %%F
)

@echo off

set DIST_DIR=dist
set CERTIFICATE_PATH="%USERPROFILE%\certificates\nuxeo.com.pfx"
set PFX_PASSWORD=""
set MSI_PROGRAM_NAME="Nuxeo Drive"
set TIMESTAMP_URL=http://timestamp.verisign.com/scripts/timstamp.dll

set SIGN_CMD=signtool sign /v /f %CERTIFICATE_PATH% /p %PFX_PASSWORD% /d %MSI_PROGRAM_NAME% /t %TIMESTAMP_URL%
set VERIFY_CMD=signtool verify /v /pa

FOR %%F IN (%DIST_DIR%\*.msi) DO (
	echo ---------------------------------------------
	echo Signing %%F
    echo ---------------------------------------------
	echo %SIGN_CMD% %%F
	%SIGN_CMD% %%F
	echo ---------------------------------------------
    echo Verifying %%F
	echo ---------------------------------------------
    echo %VERIFY_CMD% %%F
	%VERIFY_CMD% %%F
)

NXP-12981: Add PFX certificate password option when signing msi


echo on
setlocal EnableDelayedExpansion

SET POWERSHELL_PATH=
FOR /F "delims=" %%F IN ('where powershell.exe') DO (SET POWERSHELL_PATH=!POWERSHELL_PATH!%%~dpF.;)

set OLD_PATH=%PATH%

SET CL_PATH=
SET MSBUILD_PATH=

if not "%VCVARSALL_DIR%" == "" (
  CALL "%VCVARSALL_DIR%\vcvarsall.bat" amd64
  echo on
  FOR /F "delims=" %%F IN ('where cl.exe') DO (SET CL_PATH=!CL_PATH!%%~dpF.;)
  FOR /F "delims=" %%F IN ('where msbuild.exe') DO (SET MSBUILD_PATH=!MSBUILD_PATH!%%~dpF.;)
)

set PATH=%OLD_PATH%%CL_PATH%%MSBUILD_PATH%%POWERSHELL_PATH%

if not "%MINGW_PATH%" == "" SET PATH=%PATH%%MINGW_PATH%;

setx PATH "%PATH%"

mkdir build-%CONFIGURATION%
cd build-%CONFIGURATION%

cmake.exe -G "%CMAKE_GENERATOR%" .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% %ADDITIONAL_CMAKE_ARGS%

echo "Content of CMakeFiles\CMakeError.log:"
if exist "CMakeFiles\CMakeError.log" (
  type "CMakeFiles\CMakeError.log"
)

IF "%CMAKE_GENERATOR%"=="MinGW Makefiles" (
  mingw32-make -j12 || exit /b 1
) ELSE (
  type ALL_BUILD.vcxproj
  msbuild ALL_BUILD.vcxproj || exit /b 1
)

pip3 install absl-py
pip3 install pytest
pip3 install pytest-xdist

cd tests
py.test -r a -n 1 || exit /b 1

echo on
setlocal EnableDelayedExpansion

SET POWERSHELL_PATH=
FOR /F "delims=" %%F IN ('where powershell.exe') DO (SET POWERSHELL_PATH=!POWERSHELL_PATH!%%~dpF.;)

set OLD_PATH=%PATH%

SET CL_PATH=
SET MSBUILD_PATH=

if not "%VCVARSALL_DIR%" == "" (
  CALL "%VCVARSALL_DIR%\vcvarsall.bat" amd64
  echo on
  FOR /F "delims=" %%F IN ('where cl.exe') DO (SET CL_PATH=!CL_PATH!%%~dpF.;)
  FOR /F "delims=" %%F IN ('where msbuild.exe') DO (SET MSBUILD_PATH=!MSBUILD_PATH!%%~dpF.;)
)

set PATH=%OLD_PATH%%CL_PATH%%MSBUILD_PATH%%POWERSHELL_PATH%

if not "%MINGW_PATH%" == "" SET PATH=%PATH%%MINGW_PATH%;

setx PATH "%PATH%"

mkdir build-%CONFIGURATION%
cd build-%CONFIGURATION%

cmake.exe -G "%CMAKE_GENERATOR%" .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% %ADDITIONAL_CMAKE_ARGS%

echo "Content of CMakeFiles\CMakeError.log:"
if exist "CMakeFiles\CMakeError.log" (
  type "CMakeFiles\CMakeError.log"
)

IF "%CMAKE_GENERATOR%"=="MinGW Makefiles" (
  mingw32-make -j12 || exit /b 1
) ELSE (
  type ALL_BUILD.vcxproj
  msbuild ALL_BUILD.vcxproj || exit /b 1
)

pip3 install absl-py
pip3 install pytest
pip3 install pytest-xdist

cd tests
python3 -m pytest -r a -n 1 || exit /b 1

Use 'python3 -m pytest' on Windows CI tests too.


@echo off
echo called copy_post_pack.bat

@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\cursors "%kam_folder%"\data\cursors\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
@REM Copy *.rxx files only from the /data/Sprites folder, since we will copy *.rxa from the KMR private repo
xcopy ..\data\Sprites\*.rxx "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Docs\Readme "%kam_folder%"\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\lib "%kam_folder%"\lib\ /y /r /s
xcopy ..\"Modding graphics" "%kam_folder%"\"Modding graphics"\ /y /r /s

REM ============================================================
REM Copy *.rxa resource files from KMR private repo
REM ============================================================
xcopy %KMRPrivateRepoDir%\data\Sprites\*.rxa "%kam_folder%"\data\Sprites\ /y /r /s

call pull_maps.bat

REM ============================================================
REM Copy Maps, Campaigns and Tutorials
REM ============================================================
xcopy %KMRMapsRepoDir%\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy %KMRMapsRepoDir%\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy %KMRMapsRepoDir%\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy %KMRMapsRepoDir%\Tutorials "%kam_folder%"\Tutorials\ /y /r /s

REM ============================================================
REM Copy video files
REM ============================================================
xcopy "%KMRVideosDir%" "%kam_folder%" /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
REM xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\bass.dll "%kam_folder%"\bass.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
xcopy ..\Installer\uninst_clean.bat "%kam_folder%"\uninst_clean.bat* /y /r /i
xcopy ..\Installer\oalinst.exe "%kam_folder%"\oalinst.exe* /y /r /i

mkdir "%kam_folder%"\Utils

@REM copy ScriptingEditor
if %IncludeScriptingEditor%==True (
  xcopy "%ScriptingEditorDir%"\bin\ScriptingEditor.exe* "%kam_folder%"\Utils\ScriptingEditor /y /r /i
  xcopy "%ScriptingEditorDir%"\bin\SE_Data_KMR "%kam_folder%"\Utils\ScriptingEditor\SE_Data\ /y /r /s
  xcopy "%ScriptingEditorDir%"\bin\SE_Data\Examples "%kam_folder%"\Utils\ScriptingEditor\SE_Data\Examples\ /y /r /s
  xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\Utils\ScriptingEditor\SE_Data\ScriptValidator.exe* /y /r /i
  REM erase "%kam_folder%"\Utils\ScriptingEditor\SE_Data\ScriptValidator.exe
  @REM no need for OLD and Logs folders there
  rmdir /S /Q "%kam_folder%"\Utils\ScriptingEditor\SE_Data\OLD
  rmdir /S /Q "%kam_folder%"\Utils\ScriptingEditor\SE_Data\Logs
)

@REM copy utility applications exe files
xcopy ..\KM_TextIDs.inc "%kam_folder%"\Utils\KM_TextIDs.inc* /y /r /i
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\Utils\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\Utils\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\Utils\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\Utils\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\Utils\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\Utils\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\Utils\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\Utils\KaM_Remake_Server_linux_x86_64* /y /r /i

@echo off
echo called copy_post_pack.bat

@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\cursors "%kam_folder%"\data\cursors\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
@REM Copy *.rxx files only from the /data/Sprites folder, since we will copy *.rxa from the KMR private repo
xcopy ..\data\Sprites\*.rxx "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\Sprites\*.rxa "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Docs\Readme "%kam_folder%"\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\lib "%kam_folder%"\lib\ /y /r /s
xcopy ..\"Modding graphics" "%kam_folder%"\"Modding graphics"\ /y /r /s

REM ============================================================
REM Copy *.rxa resource files from KMR private repo
REM ============================================================
xcopy %KMRPrivateRepoDir%\data\Sprites\*.rxa "%kam_folder%"\data\Sprites\ /y /r /s

call pull_maps.bat

REM ============================================================
REM Copy Maps, Campaigns and Tutorials
REM ============================================================
xcopy %KMRMapsRepoDir%\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy %KMRMapsRepoDir%\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy %KMRMapsRepoDir%\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy %KMRMapsRepoDir%\Tutorials "%kam_folder%"\Tutorials\ /y /r /s

REM ============================================================
REM Copy video files
REM ============================================================
xcopy "%KMRVideosDir%" "%kam_folder%" /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
REM xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\bass.dll "%kam_folder%"\bass.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
xcopy ..\Installer\uninst_clean.bat "%kam_folder%"\uninst_clean.bat* /y /r /i
xcopy ..\Installer\oalinst.exe "%kam_folder%"\oalinst.exe* /y /r /i

mkdir "%kam_folder%"\Utils

@REM copy ScriptingEditor
if %IncludeScriptingEditor%==True (
  xcopy "%ScriptingEditorDir%"\bin\ScriptingEditor.exe* "%kam_folder%"\Utils\ScriptingEditor /y /r /i
  xcopy "%ScriptingEditorDir%"\bin\SE_Data_KMR "%kam_folder%"\Utils\ScriptingEditor\SE_Data\ /y /r /s
  xcopy "%ScriptingEditorDir%"\bin\SE_Data\Examples "%kam_folder%"\Utils\ScriptingEditor\SE_Data\Examples\ /y /r /s
  xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\Utils\ScriptingEditor\SE_Data\ScriptValidator.exe* /y /r /i
  REM erase "%kam_folder%"\Utils\ScriptingEditor\SE_Data\ScriptValidator.exe
  @REM no need for OLD and Logs folders there
  rmdir /S /Q "%kam_folder%"\Utils\ScriptingEditor\SE_Data\OLD
  rmdir /S /Q "%kam_folder%"\Utils\ScriptingEditor\SE_Data\Logs
)

@REM copy utility applications exe files
xcopy ..\KM_TextIDs.inc "%kam_folder%"\Utils\KM_TextIDs.inc* /y /r /i
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\Utils\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\Utils\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\Utils\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\Utils\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\Utils\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\Utils\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\Utils\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\Utils\KaM_Remake_Server_linux_x86_64* /y /r /i

update bat script

update bat script


@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
xcopy ..\data\Sprites "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy ..\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy ..\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy ..\Tutorials "%kam_folder%"\Tutorials\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\Readme "%kam_folder%"\ /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
xcopy ..\KM_TextIDs.inc "%kam_folder%"\KM_TextIDs.inc* /y /r /i
xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i

@REM copy ScriptingEditor
if %IncludeScriptingEditor%==True (
xcopy "%ScriptingEditorDir%"\bin\ScriptingEditor.exe* "%kam_folder%"\ScriptingEditor /y /r /i
xcopy "%ScriptingEditorDir%"\bin\SE_Data "%kam_folder%"\ScriptingEditor\SE_Data\ /y /r /s
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptingEditor\SE_Data\KMR\ScriptValidator.exe* /y /r /i
@REM no need for KP folder
rmdir /S /Q "%ScriptingEditorDir%"\bin\SE_Data\KP
)

@REM copy utility applications exe files
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\KaM_Remake_Server_linux_x86_64* /y /r /i

@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
xcopy ..\data\Sprites "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy ..\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy ..\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy ..\Tutorials "%kam_folder%"\Tutorials\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\Readme "%kam_folder%"\ /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
xcopy ..\KM_TextIDs.inc "%kam_folder%"\KM_TextIDs.inc* /y /r /i
xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
xcopy "%KMRPrevVersionDir%"\oalinst.exe "%kam_folder%"\oalinst.exe* /y /r /i

@REM copy ScriptingEditor
if %IncludeScriptingEditor%==True (
xcopy "%ScriptingEditorDir%"\bin\ScriptingEditor.exe* "%kam_folder%"\ScriptingEditor /y /r /i
xcopy "%ScriptingEditorDir%"\bin\SE_Data "%kam_folder%"\ScriptingEditor\SE_Data\ /y /r /s
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptingEditor\SE_Data\KMR\ScriptValidator.exe* /y /r /i
@REM no need for KP folder
rmdir /S /Q "%ScriptingEditorDir%"\bin\SE_Data\KP
)

@REM copy utility applications exe files
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\KaM_Remake_Server_linux_x86_64* /y /r /i

copy oalinst.exe to distributive

copy oalinst.exe to distributive


:: create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin

:: Fetch cygwin
set URL=http://cygwin.com/setup-x86_64.exe
cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal %URL% %SystemDrive%\cygwin\cygwin-setup-x86_64.exe

:: goto a temp directory and install
cd /D %SystemDrive%\windows\temp

:: packages -- comma separated
set PACKAGES=cygrunsrv,openssh

%SystemDrive%\cygwin\cygwin-setup-x86_64.exe -a x86_64 -q -R %SystemDrive%\cygwin -P %PACKAGES% -s http://cygwin.mirrors.pair.com

:: Firewall Rules
cmd /c netsh advfirewall firewall add rule name="sshd" dir=in action=allow program="%SystemDrive%\cygwin\usr\sbin\sshd.exe" enable=yes
cmd /c netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22

:: Stop the service
%SystemDrive%\cygwin\bin\bash -l -c 'cygrunsrv -E sshd'

:: Configure ssh
%SystemDrive%\cygwin\bin\bash -l -c '/bin/ssh-host-config -y --cygwin "ntsecbinmode mintty" --pwd "acb&&123!!"'

:: /bin/ash is the right shell for this command
:: Is this needed?
:: cmd /c %SystemDrive%\cygwin\bin\ash -l -c /bin/rebaseall

:: Rebuild group and passwd
cmd /c %SystemDrive%\cygwin\bin\bash -l -c 'mkgroup -l'>%SystemDrive%\cygwin\etc\group
cmd /c %SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd

%SystemDrive%\cygwin\bin\bash -l -c 'ln -s "$(dirname $(cygpath -D))" /home/$USERNAME'

:: Put local users home directories in the Windows Profiles directory
%SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l -p "$(cygpath -H)"'>%SystemDrive%\cygwin\etc\passwd

:: Start at last -- server is powered off by packer when ssh is avail.
net start sshd

:: create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin

:: Fetch cygwin
set URL=http://cygwin.com/setup-x86_64.exe
cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal %URL% %SystemDrive%\cygwin\cygwin-setup-x86_64.exe

:: goto a temp directory and install
cd /D %SystemDrive%\windows\temp

:: packages -- comma separated
set PACKAGES=cygrunsrv,openssh,rsync

%SystemDrive%\cygwin\cygwin-setup-x86_64.exe -a x86_64 -q -R %SystemDrive%\cygwin -P %PACKAGES% -s http://cygwin.mirrors.pair.com

:: Firewall Rules
cmd /c netsh advfirewall firewall add rule name="sshd" dir=in action=allow program="%SystemDrive%\cygwin\usr\sbin\sshd.exe" enable=yes
cmd /c netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22

:: Stop the service
%SystemDrive%\cygwin\bin\bash -l -c 'cygrunsrv -E sshd'

:: Configure ssh
%SystemDrive%\cygwin\bin\bash -l -c '/bin/ssh-host-config -y --cygwin "ntsecbinmode mintty" --pwd "acb&&123!!"'

:: /bin/ash is the right shell for this command
:: Is this needed?
:: cmd /c %SystemDrive%\cygwin\bin\ash -l -c /bin/rebaseall

:: Rebuild group and passwd
cmd /c %SystemDrive%\cygwin\bin\bash -l -c 'mkgroup -l'>%SystemDrive%\cygwin\etc\group
cmd /c %SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd

%SystemDrive%\cygwin\bin\bash -l -c 'ln -s "$(dirname $(cygpath -D))" /home/$USERNAME'

:: Put local users home directories in the Windows Profiles directory
%SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l -p "$(cygpath -H)"'>%SystemDrive%\cygwin\etc\passwd

:: Start at last -- server is powered off by packer when ssh is avail.
net start sshd

Add rsync to Cygwin for Vagrant rsync synced folders support


@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\uuid\bin\uuid" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\..\uuid\bin\uuid" %*
)

Add uuid.cmd

Add uuid.cmd


@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

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

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

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

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

set JAVA_OPTS=%JAVA_OPTS% -Xms%ES_MIN_MEM% -Xmx%ES_MAX_MEM%
set JAVA_OPTS=%JAVA_OPTS% -Xss128k

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

REM Enable reference compression, reducing memory overhead on 64bit JVMs
REM    - Disabled by default as it is not stable for Sun JVM before 6u19
REM set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCompressedOops

set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+CMSParallelRemarkEnabled
set JAVA_OPTS=%JAVA_OPTS% -XX:SurvivorRatio=8
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxTenuringThreshold=1
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/elasticsearch/gc.log

REM Causes the JVM to dump its heap on OutOfMemory.
set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError
REM The path to the heap dump location, note directory must exists and have enough
REM space for a full heap dump.
REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof

set ES_CLASSPATH=%CLASSPATH%;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%"

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.ElasticSearch"
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 ES_HOME=%%~dpfI

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

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

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

set JAVA_OPTS=%JAVA_OPTS% -Xms%ES_MIN_MEM% -Xmx%ES_MAX_MEM%
set JAVA_OPTS=%JAVA_OPTS% -Xss128k

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:+CMSParallelRemarkEnabled
set JAVA_OPTS=%JAVA_OPTS% -XX:SurvivorRatio=8
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxTenuringThreshold=1
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/elasticsearch/gc.log

REM Causes the JVM to dump its heap on OutOfMemory.
set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError
REM The path to the heap dump location, note directory must exists and have enough
REM space for a full heap dump.
REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof

set ES_CLASSPATH=%CLASSPATH%;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%"

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.ElasticSearch"
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

remove the compressed oops option, as its enabled by default on latest jdks


echo Extend drive C to maximum
echo select volume 0 >%TEMP%\extendC.txt
echo extend >>%TEMP%\extendC.txt
diskpart.exe /s %TEMP%\extendC.txt
set WORKDRIVE=C:

if exist %WinDir%\microsoft.net\framework\v4.0.30319 goto :have_net4
echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
:have_net4
if "%ChocolateyInstall%x"=="x" set ChocolateyInstall=%SystemDrive%\Chocolatey
if exist %ChocolateyInstall% goto :have_chocolatey
echo Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
:have_chocolatey

where cinst
if ERRORLEVEL 1 goto set_chocolatey
goto inst
:set_chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:inst

call cinst wget

call cinst msysgit
where git
if ERRORLEVEL 1 call :addGitToUserPath
goto GIT_DONE
:addGitToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\Program Files (x86)\Git\cmd" /f
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd
exit /b
:GIT_DONE

call c:\vagrant\scripts\install-packer-from-source.bat
goto packer_firewall

call cinst packer
where packer
if ERRORLEVEL 1 call :addPackerToUserPath
goto PACKER_DONE
:addPackerToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\hashicorp\packer" /f
set PATH=%PATH%;C:\hashicorp\packer
exit /b
:PACKER_DONE
call cinst packer-post-processor-vagrant-vmware-ovf

:packer_firewall
netsh advfirewall firewall add rule name="packer-builder-vmware-iso" dir=in program="c:\HashiCorp\packer\packer-builder-vmware-iso.exe" action=allow
netsh advfirewall firewall add rule name="packer-builder-virtualbox-iso" dir=in program="c:\HashiCorp\packer\packer-builder-virtualbox-iso.exe" action=allow
netsh advfirewall firewall add rule name="packer-builder-vmware-iso" dir=in program="c:\Users\vagrant\go\bin\packer-builder-vmware-iso.exe" action=allow
netsh advfirewall firewall add rule name="packer-builder-virtualbox-iso" dir=in program="c:\Users\vagrant\go\bin\packer-builder-virtualbox-iso.exe" action=allow

if exist c:\hashicorp\vagrant goto :have_vagrant
echo Installing Vagrant ...
call cinst vagrant
set PATH=%PATH%;C:\hashicorp\vagrant\bin
:have_vagrant
echo Installing vagrant-vcloud plugin ...
vagrant plugin install vagrant-vcloud
if exist c:\Users\vagrant\.vagrant.d\Vagrantfile goto :have_vagrantfile
if exist c:\vagrant\resources\Vagrantfile-global (
  copy c:\vagrant\resources\Vagrantfile-global c:\Users\vagrant\.vagrant.d\Vagrantfile
)
:have_vagrantfile

rem Install VMware Workstation
if not exist "c:\Program Files (x86)\VMware\VMware Workstation" (
  if not exist "%TEMP%\VMware-workstation.exe" (
    echo Downloading VMware Workstation...
    call wget --no-verbose --no-check-certificate -O "%TEMP%\VMware-workstation.exe" http://www.vmware.com/go/tryworkstation-win
  )
  echo Install VMware Workstation...
  rem "%TEMP%\VMware-workstation.exe" /s /nsr /v EULAS_AGREED=1 SERIALNUMBER="xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  "%TEMP%\VMware-workstation.exe" /s /nsr /v EULAS_AGREED=1
  del "%TEMP%\VMware-workstation.exe"
)

echo Extend drive C to maximum
echo select volume 0 >%TEMP%\extendC.txt
echo extend >>%TEMP%\extendC.txt
diskpart.exe /s %TEMP%\extendC.txt
set WORKDRIVE=C:

if exist %WinDir%\microsoft.net\framework\v4.0.30319 goto :have_net4
echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
:have_net4
if "%ChocolateyInstall%x"=="x" set ChocolateyInstall=%SystemDrive%\Chocolatey
if exist %ChocolateyInstall% goto :have_chocolatey
echo Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
:have_chocolatey

where cinst
if ERRORLEVEL 1 goto set_chocolatey
goto inst
:set_chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:inst

call cinst wget

call cinst msysgit
where git
if ERRORLEVEL 1 call :addGitToUserPath
goto GIT_DONE
:addGitToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\Program Files (x86)\Git\cmd" /f
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd
exit /b
:GIT_DONE

call C:\vagrant\scripts\install-packer-from-source.bat
goto packer_firewall

call cinst packer
where packer
if ERRORLEVEL 1 call :addPackerToUserPath
goto PACKER_DONE
:addPackerToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\hashicorp\packer" /f
set PATH=%PATH%;C:\hashicorp\packer
exit /b
:PACKER_DONE
call cinst packer-post-processor-vagrant-vmware-ovf

:packer_firewall
netsh advfirewall firewall add rule name="packer-builder-vmware-iso" dir=in program="c:\HashiCorp\packer\packer-builder-vmware-iso.exe" action=allow
netsh advfirewall firewall add rule name="packer-builder-virtualbox-iso" dir=in program="c:\HashiCorp\packer\packer-builder-virtualbox-iso.exe" action=allow
netsh advfirewall firewall add rule name="packer-builder-vmware-iso" dir=in program="c:\Users\vagrant\go\bin\packer-builder-vmware-iso.exe" action=allow
netsh advfirewall firewall add rule name="packer-builder-virtualbox-iso" dir=in program="c:\Users\vagrant\go\bin\packer-builder-virtualbox-iso.exe" action=allow

if exist c:\hashicorp\vagrant goto :have_vagrant
echo Installing Vagrant ...
call cinst vagrant
set PATH=%PATH%;C:\hashicorp\vagrant\bin
:have_vagrant
echo Installing vagrant-vcloud plugin ...
vagrant plugin install vagrant-vcloud
if exist C:\Users\vagrant\.vagrant.d\Vagrantfile goto :have_vagrantfile
if exist C:\vagrant\resources\Vagrantfile-global (
  copy C:\vagrant\resources\Vagrantfile-global C:\Users\vagrant\.vagrant.d\Vagrantfile
)
:have_vagrantfile
if exist C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\plugins\hosts\windows\cap\rdp.rb (
  echo Patching Vagrant 1.6.3
  copy /Y C:\vagrant\scripts\rdp.rb C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\plugins\hosts\windows\cap\rdp.rb
)

rem Install VMware Workstation
if not exist "c:\Program Files (x86)\VMware\VMware Workstation" (
  if not exist "%TEMP%\VMware-workstation.exe" (
    echo Downloading VMware Workstation...
    call wget --no-verbose --no-check-certificate -O "%TEMP%\VMware-workstation.exe" http://www.vmware.com/go/tryworkstation-win
  )
  echo Install VMware Workstation...
  rem "%TEMP%\VMware-workstation.exe" /s /nsr /v EULAS_AGREED=1 SERIALNUMBER="xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  "%TEMP%\VMware-workstation.exe" /s /nsr /v EULAS_AGREED=1
  del "%TEMP%\VMware-workstation.exe"
)

patch vagrant 1.6.3 rdp.rb

patch vagrant 1.6.3 rdp.rb


set NODE_ENV=production
cd c:\eim
# forever -c node server.js
C:\Users\EmotionInMotionV2\AppData\Roaming\npm\grunt default

REM Start Max patch
start "" "C:\Program Files\Cycling '74\Max Runtime 6.1\maxRT.exe" C:\eim\EiMpatch\EmotionInMotion.maxproj

REM Set Node.js environment to production
set NODE_ENV=production

REM Switch to EiM directory
cd c:\eim

REM Start Node.js server
C:\Users\EmotionInMotionV2\AppData\Roaming\npm\grunt default

Update startup script

Update startup script


type tsan_go.cc ..\rtl\tsan_clock.cc ..\rtl\tsan_flags.cc ..\rtl\tsan_md5.cc ..\rtl\tsan_mutex.cc ..\rtl\tsan_report.cc ..\rtl\tsan_rtl.cc ..\rtl\tsan_rtl_mutex.cc ..\rtl\tsan_rtl_report.cc ..\rtl\tsan_rtl_thread.cc ..\rtl\tsan_stat.cc ..\rtl\tsan_suppressions.cc ..\rtl\tsan_sync.cc ..\..\sanitizer_common\sanitizer_allocator.cc ..\..\sanitizer_common\sanitizer_common.cc ..\..\sanitizer_common\sanitizer_flags.cc ..\..\sanitizer_common\sanitizer_stacktrace.cc ..\..\sanitizer_common\sanitizer_libc.cc ..\..\sanitizer_common\sanitizer_printf.cc ..\..\sanitizer_common\sanitizer_suppressions.cc ..\..\sanitizer_common\sanitizer_thread_registry.cc ..\rtl\tsan_platform_windows.cc ..\..\sanitizer_common\sanitizer_win.cc > gotsan.cc

gcc -c -o race_windows_amd64.syso gotsan.cc -I..\rtl -I..\.. -I..\..\sanitizer_common -I..\..\..\include -m64 -Wall -fno-exceptions -fno-rtti -DTSAN_GO -DSANITIZER_GO -DTSAN_SHADOW_COUNT=4 -Wno-error=attributes -Wno-attributes -Wno-format -DTSAN_DEBUG=0 -O3 -fomit-frame-pointer

add windows native build script

tsan: add windows native build script

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@200780 91177308-0d34-0410-b5e6-96231b3b80d8


Google.HashCode.ConsoleApplication\bin\Debug\Google.HashCode.ConsoleApplication.exe busy_day.in < busy_day.in
Google.HashCode.ConsoleApplication\bin\Debug\Google.HashCode.ConsoleApplication.exe redundancy.in < redundancy.in
Google.HashCode.ConsoleApplication\bin\Debug\Google.HashCode.ConsoleApplication.exe mother_of_all_warehouses.in < mother_of_all_warehouses.in

Add bat file which run the app on input files


dotnet run -c Release -p playground\ImTools.Benchmarks

dotnet run -c Release --project playground\ImTools.Benchmarks

fix bm option

fix bm option


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

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

setlocal EnableDelayedExpansion

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

:: add registry key for init.bat
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f

if exist "%HOME%" (
	set homeDir=%HOME%
) else (
	if exist "%HOMEDRIVE%%HOMEPATH%" (
		set homeDir=%HOMEDRIVE%%HOMEPATH%
	) else (
		set homeDir=%USERPROFILE%\
	)
)

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

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

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

goto:EOF

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

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

goto:EOF

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

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

setlocal EnableDelayedExpansion

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

:: add registry key for init.bat
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f

if exist "%HOME%" (
	set homeDir=%HOME%
) else (
	if exist "%HOMEDRIVE%%HOMEPATH%" (
		set homeDir=%HOMEDRIVE%%HOMEPATH%
	) else (
		set homeDir=%USERPROFILE%\
	)
)

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

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

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

goto:EOF

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

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

goto:EOF

Check with NUL does not work with escaped paths


:: ***** Set varilables *****
:: Environment Variables for x86/x64
IF %PROCESSOR_ARCHITECTURE%==AMD64 SET HKPATH=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
IF %PROCESSOR_ARCHITECTURE%==x86 SET HKPATH=HKEY_LOCAL_MACHINE\SOFTWARE
ECHO %HKPATH%

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

:: ***** Check if Chrome installation exists *****

REG QUERY "%HKPATH%\Google\Update\ClientState\{8A69D345-D564-463C-AFF1-A69D9E530F96}"
REM ***** If registry exist continue to uninstall script. If registry key does not exist goto :INSTALL *****
IF %ERRORLEVEL%==1 goto INSTALL

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

:: ***** Setup.exe uninstall script *****
:: ****** Query for setup.exe path *****
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "%HKPATH%\Google\Update\ClientState\{8A69D345-D564-463C-AFF1-A69D9E530F96}" /v UninstallString`) DO (
    set appdir=%%A %%B
    )
ECHO %appdir%
:: ***** Setup.exe uninstall *****
"%appdir%" --uninstall --multi-install --chrome --system-level --force-uninstall

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

REM ***** taskkill GoogleUpdate.exe *****
taskkill.exe /F /IM GoogleUpdate.exe /T

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

:INSTALL

:: ***** Install *****

msiexec.exe ALLUSERS=2 /m MSIHUPGC /i "%~dp0googlechromestandaloneenterprise64.msi" /qn

xcopy "%~dp0master_preferences" "C:\Program Files (x86)\Google\Chrome\Application\master_preferences*" /I /Y
del "C:\Users\Public\Desktop\Google Chrome.lnk"

Create install.cmd

Create install.cmd


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

ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif

all: $(TARG)

include $(QUOTED_GOROOT)/src/Make.common

PREREQ+=$(patsubst %,%.make,$(DEPS))

$(TARG): _go_.$O
	$(LD) -o $@ _go_.$O

_go_.$O: $(GOFILES) $(PREREQ)
	$(GC) -o $@ $(GOFILES)

install: $(QUOTED_GOBIN)/$(TARG)

$(QUOTED_GOBIN)/$(TARG): $(TARG)
	cp -f $(TARG) $(QUOTED_GOBIN)

CLEANFILES+=$(TARG) _test _testmain.go

nuke: clean
	rm -f $(QUOTED_GOBIN)/$(TARG)

# for gotest
testpackage: _test/main.a

testpackage-clean:
	rm -f _test/main.a _gotest_.$O

testpackage: _test/main.a

_test/main.a: _gotest_.$O
	@mkdir -p _test
	rm -f $@
	gopack grc $@ _gotest_.$O

_gotest_.$O: $(GOFILES) $(GOTESTFILES)
	$(GC) -o $@ $(GOFILES) $(GOTESTFILES)

importpath:
	echo main

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

ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif

all: $(TARG)

include $(QUOTED_GOROOT)/src/Make.common

PREREQ+=$(patsubst %,%.make,$(DEPS))

$(TARG): _go_.$O
	$(LD) -o $@ _go_.$O

_go_.$O: $(GOFILES) $(PREREQ)
	$(GC) -o $@ $(GOFILES)

install: $(QUOTED_GOBIN)/$(TARG)

$(QUOTED_GOBIN)/$(TARG): $(TARG)
	cp -f $(TARG) $(QUOTED_GOBIN)

CLEANFILES+=$(TARG) _test _testmain.go

nuke: clean
	rm -f $(QUOTED_GOBIN)/$(TARG)

# for gotest
testpackage: _test/main.a

testpackage-clean:
	rm -f _test/main.a _gotest_.$O

_test/main.a: _gotest_.$O
	@mkdir -p _test
	rm -f $@
	gopack grc $@ _gotest_.$O

_gotest_.$O: $(GOFILES) $(GOTESTFILES)
	$(GC) -o $@ $(GOFILES) $(GOTESTFILES)

importpath:
	echo main

remove duplicate dependency in Make.cmd

build: remove duplicate dependency in Make.cmd

R=golang-dev, dfc, rsc1, rsc
CC=golang-dev
http://codereview.appspot.com/4274048

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>


@echo off

set "JBOSS_HOME=%CD%\server\jboss-as-${version.jboss.as}"

echo "starting camunda BPM platform ${project.version} on JBoss Application Server ${version.jboss.as}"

cd server\jboss-as-${version.jboss.as}\bin\
start standalone.bat

ping -n 5 localhost > NULL
start http://localhost:8080/camunda-welcome/index.html

@echo off

set "JBOSS_HOME=%CD%\server\jboss-as-${version.jboss.as}"

setlocal

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    set JAVAVER=%%g
)
set JAVAVER=%JAVAVER:"=%
@echo Output: %JAVAVER%

for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
    if %%w GEQ 8 (
        @echo Your java version is greater than JDK 1.7. Cannot start JBoss AS ${version.jboss.as}
        Exit /B 5
    )
)

endlocal

echo "starting camunda BPM platform ${project.version} on JBoss Application Server ${version.jboss.as}"

cd server\jboss-as-${version.jboss.as}\bin\
start standalone.bat

ping -n 5 localhost > NULL
start http://localhost:8080/camunda-welcome/index.html

feat(engine): add check in batch for jboss java version

related to #CAM-6410

feat(engine): clean up .bat startup for jboss

related to #CAM-6410


robocopy C:\Users\user\Documents F:\Backup\Documents /MIR /DCOPY:T /xj /np /tee /log:backup_log.txt
robocopy C:\Users\user\Pictures  F:\Backup\Pictures  /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt
robocopy C:\Users\user\Music     F:\Backup\Music     /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt
robocopy C:\Users\user\Downloads F:\Backup\Downloads /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt
pause

robocopy "C:\Users\user\Documents" "F:\Backup\Documents" /MIR /DCOPY:T /xj /np /tee /log:backup_log.txt
robocopy "C:\Users\user\Pictures"  "F:\Backup\Pictures"  /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt
robocopy "C:\Users\user\Music"     "F:\Backup\Music"     /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt
robocopy "C:\Users\user\Downloads" "F:\Backup\Downloads" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt
pause

Add quotation around dir path.

Add quotation around dir path.


@echo off
setlocal
title Build slave
if not exist %~dp0..\..\depot_tools\. (
  echo You must put a copy of depot_tools in %~dp0..\depot_tools
  goto :EOF
)
set PATH=%~dp0..\..\depot_tools;%PATH%
cd /d %~dp0
:: Running it once will make sure svn and python were downloaded.
call gclient.bat > nul
:: run_slave.py will overwrite the PATH and PYTHONPATH environment variables.
python %~dp0\run_slave.py --no_save -y buildbot.tac %*

@echo off
setlocal
title Build slave
if not exist %~dp0..\..\depot_tools\. (
  echo You must put a copy of depot_tools in %~dp0..\depot_tools
  goto :EOF
)
set PATH=%~dp0..\..\depot_tools;%PATH%
cd /d %~dp0
:: Running it once will make sure svn and python were downloaded.
call gclient.bat > nul
:: run_slave.py will overwrite the PATH and PYTHONPATH environment variables.
python %~dp0\run_slave.py --no_save -y buildbot.tac --logfile=twistd.log %*

Write twistd.log files on Windows

Write twistd.log files on Windows

That will simplify debugging Buildbot slave process on Windows, plus
will also enable sending those logs to the Cloud.

BUG=492404
R=dsansome@chromium.org, iannucci@chromium.org

Review URL: https://codereview.chromium.org/1415523007 .

git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@297361 0039d316-1c4b-4281-b951-d872f2087c98


@SETLOCAL

@SET NUGET_EXE=NuGet
@SET CACHED_NUGET="%USERPROFILE%\.nuget\NuGet.exe"

@IF ["%APPVEYOR%"] == [""] (
    SET NUGET_EXE=%CACHED_NUGET%

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

::@echo %NUGET_EXE%

@echo %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"
@call %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"

@SET config=%1
@IF ["%config%"] == [""] (
   SET config=Debug
)

@FOR /r %%F IN (*OpenCover.Console.exe) DO @SET cover_exe=%%F
@IF NOT EXIST "%cover_exe%" (
   echo Unable to find OpenCover console.
   EXIT /B 2
)
::@echo %cover_exe%

@FOR /r %%F IN (*ReportGenerator.exe) DO @SET report_exe=%%F
@IF NOT EXIST "%report_exe%" (
   echo Unable to find ReportGenerator.
   EXIT /B 2
)
::@echo %report_exe%

@SET results_path=%~dp0test\TestResults
@SET xunit_results=%results_path%\Xunit.Tests.html
@SET coverage_filter=+[Castle.Core.AsyncInterceptor*]* -[*.Tests]*
@SET coverage_results=%results_path%\Test.Coverage.xml

@IF NOT EXIST "%results_path%" MD "%results_path%"

@echo dotnet restore "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@dotnet restore "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"

cd "%~dp0test\Castle.Core.AsyncInterceptor.Tests"

::@echo dotnet.exe xunit -configuration %config% -noshadow -html %xunit_results%
::@dotnet.exe xunit -configuration %config% -noshadow -html %xunit_results%

@echo "%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -configuration %config% -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -configuration %config% -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@IF ERRORLEVEL 1 (
   echo Error executing the xunit tests
   EXIT /B 2
)

cd "%~dp0"

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%" -reporttypes:XmlSummary
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%" -reporttypes:XmlSummary

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html

@SETLOCAL

@SET NUGET_EXE=NuGet
@SET CACHED_NUGET="%USERPROFILE%\.nuget\NuGet.exe"

@IF ["%APPVEYOR%"] == [""] (
    SET NUGET_EXE=%CACHED_NUGET%

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

::@echo %NUGET_EXE%

@echo %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"
@call %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"

@SET config=%1
@IF ["%config%"] == [""] (
   SET config=Debug
)

@FOR /r %%F IN (*OpenCover.Console.exe) DO @SET cover_exe=%%F
@IF NOT EXIST "%cover_exe%" (
   echo Unable to find OpenCover console.
   EXIT /B 2
)
::@echo %cover_exe%

@FOR /r %%F IN (*ReportGenerator.exe) DO @SET report_exe=%%F
@IF NOT EXIST "%report_exe%" (
   echo Unable to find ReportGenerator.
   EXIT /B 2
)
::@echo %report_exe%

@SET results_path=%~dp0test\TestResults
@SET xunit_results=%results_path%\Xunit.Tests.html
@SET coverage_filter=+[Castle.Core.AsyncInterceptor*]* -[*.Tests]*
@SET coverage_results=%results_path%\Test.Coverage.xml

@IF NOT EXIST "%results_path%" MD "%results_path%"

@echo dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@IF ERRORLEVEL 1 (
   echo Error building the test project
   EXIT /B 2
)

cd "%~dp0test\Castle.Core.AsyncInterceptor.Tests"

::@echo dotnet.exe xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%
::@dotnet.exe xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%

@echo "%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@IF ERRORLEVEL 1 (
   echo Error executing the xunit tests
   EXIT /B 2
)

cd "%~dp0"

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html

:chart_with_upwards_trend: Test only .NET 4.7 to ensure test failures fail the build


@ECHO off
@SET LIT_VERSION=1.2.13

IF NOT "x%1" == "x" GOTO :%1

:rackspace-monitoring-agent
ECHO "Building agent"
IF NOT EXIST lit.exe CALL Make.bat lit
CALL cmake -H. -Bbuild
CALL cmake --build build
CALL cmake --build build --target SignExe
GOTO :end

:lit
ECHO "Building lit"
PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/%LIT_VERSION%/get-lit.ps1'))"
GOTO :end

:test
CALL Make.bat rackspace-monitoring-agent
CALL lit.exe install
IF EXIST tests\tmpdir RMDIR /S /Q tests\tmpdir
CALL mkdir tests\tmpdir
CALL luvi.exe . -m tests\run.lua
exit /b %errorlevel%
GOTO :end

:package
IF NOT EXIST rackspace-monitoring-agent.exe CALL Make.bat rackspace-monitoring-agent
CALL cmake --build build --target package
CALL cmake --build build --target SignPackage
GOTO :end

:clean
IF EXIST rackspace-monitoring-agent.exe DEL /F /Q rackspace-monitoring-agent.exe
IF EXIST lit.exe DEL /F /Q lit.exe
IF EXIST lit RMDIR /S /Q lit
IF EXIST luvi.exe DEL /F /Q luvi.exe
IF EXIST luvi-binaries RMDIR /S /Q luvi-binaries

:end

@ECHO off
@SET LIT_VERSION=1.2.13

IF NOT "x%1" == "x" GOTO :%1

:rackspace-monitoring-agent
ECHO "Building agent"
IF NOT EXIST lit.exe CALL Make.bat lit
CALL cmake -H. -Bbuild
CALL cmake --build build
CALL cmake --build build --target SignExe
GOTO :end

:lit
ECHO "Building lit"
PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/%LIT_VERSION%/get-lit.ps1'))"
GOTO :end

:test
CALL Make.bat rackspace-monitoring-agent
CALL lit.exe install
IF EXIST tests\tmpdir RMDIR /S /Q tests\tmpdir
CALL mkdir tests\tmpdir
CALL luvi.exe . -m tests\run.lua
exit /b %errorlevel%
GOTO :end

:package
IF NOT EXIST rackspace-monitoring-agent.exe CALL Make.bat rackspace-monitoring-agent
CALL cmake --build build --target package
CALL cmake --build build --target SignPackage
GOTO :end

:packagerepo
call cmake --build build --target packagerepo
GOTO :end

:packagerepoupload
call cmake --build build --target packagerepoupload
GOTO :end

:clean
IF EXIST rackspace-monitoring-agent.exe DEL /F /Q rackspace-monitoring-agent.exe
IF EXIST lit.exe DEL /F /Q lit.exe
IF EXIST lit RMDIR /S /Q lit
IF EXIST luvi.exe DEL /F /Q luvi.exe
IF EXIST luvi-binaries RMDIR /S /Q luvi-binaries

:end

add additional packaging steps to make.bat


@ECHO off
:: This script closes the self-hosted WCF service, refreshes the certificates, then restarts the service
::
:: This script should be set as a scheduled task to run
:: - Every 80 days
::
:: Note that for first run, recommend:
:: 1. Run %_GITREPO%\src\System.Private.ServiceModel\tools\scripts\StartWCFSelfHostedSvc.cmd
:: 2. Close the self hosted service non gracefully (so that the certificates are saved)
:: 3. Run this script
::
:: This file is not designed to live inside a repo, hence why the deep file paths into the repo
:: By convention, we place this file into C:\wcftest
::

setlocal

SET _GITREPO=C:\git\wcf
SET _SCRIPTSDIR=%_GITREPO%\src\System.Private.ServiceModel\tools\scripts
SET _LOGFILE=%~dp0\RefreshServerCertificates_ScriptLog.txt
SET _RESTARTSCRIPT=%~dp0\ScheduledRestartWcfSelfHostedService.cmd

echo [%~n0] %DATE% %TIME% Running script to regenerate certificates... >> %_LOGFILE%

if not exist %_RESTARTSCRIPT% (
    echo [%~n0] Cannot find ScheduledRestartWcfSelfHostedService.cmd in %~dp0           >> %_LOGFILE%
    echo        We require that script to start the WCF Self Hosted Service after       >> %_LOGFILE%
    echo        certificates are regenerated                                            >> %_LOGFILE%

    set _EXITCODE=1
    goto end
)

:: Kill WCF self-hosted service
TASKKILL /F /IM SelfHostedWCFService.exe                                                >> %_LOGFILE%

:: Regenerate certificates
echo call %_SCRIPTSDIR%\BuildCertUtil.cmd                                               >> %_LOGFILE%
call %_SCRIPTSDIR%\BuildCertUtil.cmd                                                    >> %_LOGFILE%

echo [%~n0] cmd /c %_GITREPO%\bin\Wcf\tools\CertificateGenerator\CertificateGenerator.exe       >> %_LOGFILE%
cmd /c %_GITREPO%\bin\Wcf\tools\CertificateGenerator\CertificateGenerator.exe                   >> %_LOGFILE%

:: Configure HTTPS ports to use new certificate
echo [%~n0] powershell -NoProfile -ExecutionPolicy unrestricted %_SCRIPTSDIR%\ConfigHttpsPort.ps1   >> %_LOGFILE%
powershell -NoProfile -ExecutionPolicy unrestricted %_SCRIPTSDIR%\ConfigHttpsPort.ps1               >> %_LOGFILE% 2>&1

if NOT "%ERRORLEVEL%"=="0" (
    echo Warning: An error occurred while configuring the https port.                               >> %_LOGFILE%
    set _EXITCODE=1
    goto end
)

echo [%~n0] cmd /c iisreset >> %_LOGFILE%
cmd /c iisreset             >> %_LOGFILE% 2>&1

if NOT "%ERRORLEVEL%"=="0" (
    echo Warning: An error occurred while running iisreset.                               >> %_LOGFILE%
    set _EXITCODE=1
    goto end
)

:: Start self-hosted service
echo [%~n0] %DATE% %TIME% Calling  %_RESTARTSCRIPT%...  >> %_LOGFILE%
call %_RESTARTSCRIPT%

if NOT "%ERRORLEVEL%"=="0" (
    echo Warning: An error occurred while restarting the sevice                           >> %_LOGFILE%
    set _EXITCODE=1
    goto end
)

:end

echo [%~n0] %DATE% %TIME% Ending script for regenerating certificates...  >> %_LOGFILE%
echo. >> %_LOGFILE%
echo. >> %_LOGFILE%

exit /b %_EXITCODE%
endlocal

Add script for refreshing server certificates

This was another magic script that lived somewhere in a file share, so rewriting and
committing this for the ages so we have the ability to easily find and use this script


@echo off
setlocal
if not "%~1"=="" set GIT_HOME=%~f1
if "%GIT_HOME%"=="" call :FindGitHome "git.cmd"

if exist "%GIT_HOME%" goto :GitHomeOK

echo MsysGit installation directory not found.>&2
echo Try to give the directory name on the command line:>&2
echo   %0 "%ProgramFiles%\Git"
endlocal
exit /B 1

:GitHomeOK
set ERR=0

echo Installing gitflow into "%GIT_HOME%"...

call :ChkGetopt getopt.exe || set ERR=1
if %ERR%==1 goto :End
echo getopt.exe... Found

if not exist "%GIT_HOME%\bin\git-flow" goto :Install
echo GitFlow is already installed.>&2
choice /C YN /M "Do you want to replace it"
if errorlevel 255 goto :Abort
if errorlevel 2 goto :Abort
if not errorlevel 1 goto :Abort

echo Deleting old files...
for /F %%i in ("%GIT_HOME%\git-flow*" "%GIT_HOME%\gitflow-*") do if exist "%%~fi" del /F /Q "%%~fi"

:Install
echo Copying files...
::goto :EOF
xcopy "%~dp0\..\git-flow"            "%GIT_HOME%\bin"                 /Y /R /F
if errorlevel 4 if not errorlevel 5 goto :AccessDenied
if errorlevel 1 set ERR=1
xcopy "%~dp0\..\git-flow*"           "%GIT_HOME%\bin"                 /Y /R /F || set ERR=1
xcopy "%~dp0\..\gitflow-*"           "%GIT_HOME%\bin"                 /Y /R /F || set ERR=1
xcopy "%~dp0\..\shFlags\src\shflags" "%GIT_HOME%\bin\gitflow-shFlags" /Y /R /F || set ERR=1

if %ERR%==1 choice /T 30 /C Y /D Y /M "Some unexpected errors happened. Sorry, you'll have to fix them by yourself."

:End
endlocal & exit /B %ERR%
goto :EOF

:AccessDenied
set ERR=1
echo.
echo You should run this script with "Full Administrator" rights:>&2
echo - Right-click with Shift on the script from the Explorer>&2
echo - Select "Run as administrator">&2
choice /T 30 /C YN /D Y /N >nul
goto :End

:Abort
echo Installation canceled.>&2
set ERR=1
goto :End

:ChkGetopt
:: %1 is getopt.exe
if exist "%GIT_HOME%\bin\%1" goto :EOF
if exist "%~f$PATH:1" goto :EOF
echo %GIT_HOME%\bin\%1 not found.>&2
echo You have to install this file manually. See the GitFlow README.
exit /B 1

:FindGitHome
setlocal
set GIT_CMD_DIR=%~dp$PATH:1
if "%GIT_CMD_DIR%"=="" endlocal & goto :EOF
endlocal & set GIT_HOME=%GIT_CMD_DIR:~0,-5%
goto :EOF

Add an installer for the msysgit environment

This installer:
- detects the Git installation path
- checks prereqs (git, getopt.exe)
- delete old gitflow install
- install gitflow files

"Access denied" errors are detected and the user is given advice in that case (
use full administrator rights).


REM 1) copy data from one production node to another
robocopy F:\data_from_production \\tsclient\F\data_from_production /mir

Create copy_new_to_new.bat

Create copy_new_to_new.bat


Create install.bat

Create install.bat


@echo off
rem golobal path define
set IDEV_HOME=c:\devtools

rem param parse and configuration
rem default arch is amd64
set ARCH=amd64
set PY_VER=3.4.2
if /i "%1" == "x86"       set ARCH=x86
if /i "%2" == "2.7.8"     set PY_VER=%2

rem qt related configuration
rem set QT_ARCH=_64
rem if /i %ARCH% == x86     set QT_ARCH=
rem set QT_VER=5.3.2
rem set QT_MAJOR_VER=5.3
rem set QT_HOME=%IDEV_HOME%\Qt\%ARCH%\Qt%QT_VER%\%QT_MAJOR_VER%\msvc2013%QT_ARCH%
rem set PATH=%QT_HOME%\bin;%PATH%
rem set INCLUDE=%QT_HOME%\include;%QT_HOME%\include\QtPrintSupport;%INCLUDE%
rem set LIB=%QT_HOME%\lib;%LIB%
rem set LIBPATH=%QT_HOME%\lib;%LIBPATH%

rem add python to path
set PYTHON_HOME=%IDEV_HOME%\Python\%ARCH%\%PY_VER%
set PATH=%PYTHON_HOME%;%PATH%
set INCLUDE=%PYTHON_HOME%\include;%INCLUDE%
set LIB=%PYTHON_HOME%\libs;%LIB%
set LIBPATH=%PYTHON_HOME%\libs;%LIBPATH%
set PYTHONHOME=%PYTHON_HOME%\Lib;
set PYTHONPATH=%PYTHONHOME%

rem add 3rdparty to path
set TRDPTY_HOME=%IDEV_HOME%\3rdparty
set PATH=%TRDPTY_HOME%\%ARCH%\bin;%PATH%
set INCLUDE=%TRDPTY_HOME%\%ARCH%\include;%INCLUDE%
set LIB=%TRDPTY_HOME%\%ARCH%\lib;%LIB%
set LIBPATH=%TRDPTY_HOME%\%ARCH%\lib;%LIBPATH%

rem perl configuration, ripped from portbalperl.bat
set PERL_HOME=%IDEV_HOME%\perl\%ARCH%
set PATH=%PERL_HOME%\perl\site\bin;%PERL_HOME%\perl\bin;%PATH%
rem perl env variables
set TERM=
set HOME=%PERL_HOME%\data
set PLPLOT_LIB=%PERL_HOME%\c\share\plplot
set PLPLOT_DRV_DIR=%PERL_HOME%\c\share\plplot
rem avoid collisions with other perl stuff on your system
set PERL_JSON_BACKEND=
set PERL_YAML_BACKEND=
set PERL5LIB=
set PERL5OPT=
set PERL_MM_OPT=
set PERL_MB_OPT=
perl -MConfig -MPDL -e "printf("""Perl executable: %%s\nPerl version   : %%vd / $Config{archname}\nPDL version    : %%s\n""", $^X, $^V, $PDL::VERSION)" 2>nul
if ERRORLEVEL==1 echo.&echo FATAL ERROR: 'perl' does not work; check if your strawberry pack is complete!

rem mingw configuration
set MINGW_HOME=%IDEV_HOME%\MinGW\%ARCH%
set PATH=%MINGW_HOME%\bin;%PATH%

rem add hg to $PATH
set HG_HOME=%IDEV_HOME%\mercurial
set PATH=%HG_HOME%;%PATH%

rem add svn to $PATH
set SVN_HOME=%IDEV_HOME%\TortoiseSVN
set PATH=%SVN_HOME%\bin;%PATH%

rem add nasm to path
set NASM_HOME=%IDEV_HOME%\nasm
set NASM_VER=2.11.05
set PATH=%NASM_HOME%\%NASM_VER%;%NASM_HOME%\%NASM_VER%\rdoff;%PATH%

rem add tcc to path
set TCC_HOME=%IDEV_HOME%\tcc
set PATH=%TCC_HOME%\%ARCH%;%PATH%

rem add pdftk to path
set PDFTK_HOME=%IDEV_HOME%\PDFtk
set PATH=%PDFTK_HOME%\bin;%PATH%

rem add ImageMagick to path
set IMG_MAGIK_VER=6.8.9-Q16
set IMG_MAGIK_HOME=%IDEV_HOME%\ImageMagick\%IMG_MAGIK_VER%
set PATH=%IMG_MAGIK_HOME%;%PATH%

rem add potrace to ptath
set PATH=%IDEV_HOME%\potrace;%PATH%
set PATH=%IDEV_HOME%\autotrace;%PATH%

add devsetup

add devsetup

A batch script auto config development environment for windows,
includes:
QT, python,perl, VC, mingw, nasm, tcc, pdftkm, imagemagick, potrace etc.


@echo off

%PHP_SDK_PHP_CMD% %~dp0depman.php %*

add depman wrapper

add depman wrapper


@ECHO OFF
SETLOCAL
SET /A ARGS_COUNT=0
FOR %%A in (%*) DO SET /A "ARGS_COUNT+=1"
IF %ARGS_COUNT% NEQ 2 (
	@ECHO Invalid arguments.
	@ECHO Usage: runAs.cmd credentials_file command
	@EXIT -1
)
ENDLOCAL

REM Define OS bitness
SET "RUN_AS_PATH_TO_BIN=%~dp0"
SET "RUN_AS_PATH_TO_TOOL=JetBrains.runAs.exe"
%RUN_AS_PATH_TO_BIN%JetBrains.getOSBitness.exe -s
SET "OS_BITNESS=%errorlevel%"

IF %OS_BITNESS% EQU 64 SET "RUN_AS_PATH_TO_TOOL=%RUN_AS_PATH_TO_BIN%x64\%RUN_AS_PATH_TO_TOOL%"
IF %OS_BITNESS% EQU 32 SET "RUN_AS_PATH_TO_TOOL=%RUN_AS_PATH_TO_BIN%x86\%RUN_AS_PATH_TO_TOOL%"

REM Override environment variables
SET RUN_AS_GET_VARS=%RUN_AS_PATH_TO_TOOL% -c:%1 -i:false -l:off cmd.exe /C %RUN_AS_PATH_TO_BIN%getEnvVars.cmd
FOR /F %%G IN ('%RUN_AS_GET_VARS%') do SET "%%G"

REM Run command line
%RUN_AS_PATH_TO_TOOL% -c:%1 -i:true -l:errors -b:-10000 cmd.exe /C %2
SET "EXIT_CODE=%ERRORLEVEL%"

ECHO.
IF %EXIT_CODE% EQU -10000 ECHO ##teamcity[message text='Unknown error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10001 ECHO ##teamcity[message text='Invalid usage of the tool.' status='ERROR']
IF %EXIT_CODE% EQU -10002 ECHO ##teamcity[message text='Security error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10003 ECHO ##teamcity[message text='WIN32 API error occurred.' status='ERROR']

EXIT /B %EXIT_CODE%

@ECHO OFF
SETLOCAL
SET /A ARGS_COUNT=0
FOR %%A in (%*) DO SET /A "ARGS_COUNT+=1"
IF %ARGS_COUNT% NEQ 2 (
	@ECHO Invalid arguments.
	@ECHO Usage: runAs.cmd credentials_file command
	@EXIT -1
)
ENDLOCAL

REM Define OS bitness
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN=%~dp0"
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=JetBrains.runAs.exe"
%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%JetBrains.getOSBitness.exe -s
SET "OS_BITNESS=%errorlevel%"

IF %OS_BITNESS% EQU 64 SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x64\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL%"
IF %OS_BITNESS% EQU 32 SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x86\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL%"

REM Override environment variables
SET RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_GET_VARS=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL% -c:%1 -i:false -l:off cmd.exe /C %RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%getEnvVars.cmd
FOR /F "delims=" %%G IN ('%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_GET_VARS%') DO SET "%%G"

SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_GET_VARS="
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN="

REM Run command line
%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL% -c:%1 -i:true -l:errors -b:-10000 cmd.exe /C %2
SET "EXIT_CODE=%ERRORLEVEL%"

ECHO.
IF %EXIT_CODE% EQU -10000 ECHO ##teamcity[message text='Unknown error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10001 ECHO ##teamcity[message text='Invalid usage of the tool.' status='ERROR']
IF %EXIT_CODE% EQU -10002 ECHO ##teamcity[message text='Security error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10003 ECHO ##teamcity[message text='WIN32 API error occurred.' status='ERROR']

EXIT /B %EXIT_CODE%

Fix runAs.cmd

Fix runAs.cmd