:: Asset API
::
:: This file is called whenever a user enters an asset, such as Cat or Shot01.
::
:: Arguments:
:: 	 %1: Name of asset, e.g. Fiona
:: 	 %2: Absolute path to asset parent directory, e.g. m:\f01_projects\p999_Demo\assets
::
:: Example:
::   $ p999_Meindbender_Sync
::   $ Fiona

@echo off

set ASSET=%1
set ROOT=%2%ASSET%

If Not Exist %ROOT% (
	mkdir %ROOT%
)

echo+
echo %ASSET% -----------
echo+
echo   Type application and task.
echo+
echo   For example:
echo+
echo   $ maya modeling
echo   $ maya rigging
echo   $ nuke comp
echo+
echo --------------------------------------

pushd %ROOT%

:: Asset API
::
:: This file is called whenever a user enters an asset, such as Cat or Shot01.
::
:: Arguments:
:: 	 %1: Name of asset, e.g. Fiona
:: 	 %2: Absolute path to asset parent directory, e.g. m:\f01_projects\p999_Demo\assets
::
:: Example:
::   $ Fiona
::   $ sh01

@echo off

set ASSET=%1
set ROOT=%2%ASSET%

If not exist %ROOT% (
	mkdir %ROOT%
)

echo+
echo %ASSET% -----------
echo+
echo   Type application and task.
echo+
echo   For example:
echo+
echo   $ maya modeling
echo   $ maya rigging
echo   $ nuke comp
echo+
echo --------------------------------------

pushd %ROOT%

Improve readability

Improve readability


call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\bin\ipsxe-comp-vars.bat" intel64 vs2015

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL
del /Q bin\*.exe 2> NUL
del /Q *.optrpt 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_gd ^
/fpp /DPCREO_GRAD_DESC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_mkl ^
/fpp /DPCREO_USE_MKL ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_mkl_par ^
/fpp /DPCREO_USE_MKL ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_single_mkl ^
/fpp /DPCREO_USE_MKL /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_single_mkl_par ^
/fpp /DPCREO_USE_MKL /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_single ^
/fpp /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_single_par ^
/fpp /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs ^
/fpp ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_par ^
/fpp ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_quad ^
/fpp /DPCREO_QUAD_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_quad_par ^
/fpp /DPCREO_QUAD_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\bin\ipsxe-comp-vars.bat" intel64 vs2015

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL
del /Q bin\*.exe 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_mkl ^
/fpp /DPCREO_USE_MKL ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_mkl_par ^
/fpp /DPCREO_USE_MKL ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_single_mkl ^
/fpp /DPCREO_USE_MKL /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort /Qmkl /I"%MKLROOT%"\include ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_single_mkl_par ^
/fpp /DPCREO_USE_MKL /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_single ^
/fpp /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_single_par ^
/fpp /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs ^
/fpp ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_par ^
/fpp ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_bfgs_quad ^
/fpp /DPCREO_QUAD_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_bfgs_quad_par ^
/fpp /DPCREO_QUAD_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_gd_single ^
/fpp /DPCREO_GRAD_DESC /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_gd_single_par ^
/fpp /DPCREO_GRAD_DESC /DPCREO_SINGLE_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_gd ^
/fpp /DPCREO_GRAD_DESC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_gd_par ^
/fpp /DPCREO_GRAD_DESC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast ^
/o bin\pcreo_sphere_gd_quad ^
/fpp /DPCREO_GRAD_DESC /DPCREO_QUAD_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

ifort ^
/warn:all /wrap-margin- /fast /Qparallel ^
/o bin\pcreo_sphere_gd_quad_par ^
/fpp /DPCREO_GRAD_DESC /DPCREO_QUAD_PREC ^
src\pcreo_sphere.f90

del /Q *.mod 2> NUL
del /Q src\*.mod 2> NUL
del /Q *.obj 2> NUL

Add permutations to compile.bat

Add permutations to compile.bat


@echo off
SET PYTHONPATH=
"%~dp0python27/win32/pythonw.exe" "%~dp0launcher/start.py"

SET PYTHONPATH=
"%~dp0python27/win32/python.exe" "%~dp0launcher/start.py"

Fix the start.bat issue.

Fix the start.bat issue.


REM X86
Executing X86 AllTheThings Test
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U AllTheThingsx86.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regsvcs.exe AllTheThingsx86.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /U AllTheThingsx86.dll
regsvr32.exe /s /u AllTheThingsx86.dll
regsvr32.exe /s AllTheThingsx86.dll
rundll32 AllTheThingsx86.dll,EntryPoint
odbcconf.exe  /s /a { REGSVR AllTheThingsx86.dll }
regsvr32.exe /s /n /i:"Some String To Do Things ;-)" AllTheThingsx86.dll

REM AMD64

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U AllTheThingsx64.dll
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regsvcs.exe AllTheThingsx64.dll
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /U AllTheThingsx64.dll
regsvr32.exe /s /u AllTheThingsx64.dll
regsvr32.exe /s AllTheThingsx64.dll
rundll32 AllTheThingsx64.dll,EntryPoint
odbcconf.exe  /s /a { REGSVR AllTheThingsx64.dll }
regsvr32.exe /s /n /i:"Some String To Do Things ;-)" AllTheThingsx64.dll

REM Download DLLs
if not exist "C:\Temp\" mkdir C:\Temp
cd C:\Temp
bitsadmin.exe /transfer "ATT" https://github.com/redcanaryco/atomic-red-team/raw/master/Windows/Payloads/AllTheThings/AllTheThingsx64.dll C:\Temp\AllTheThingsx64.dll
timeout /t 1 /nobreak > NUL
bitsadmin.exe /transfer "ATT" https://github.com/redcanaryco/atomic-red-team/raw/master/Windows/Payloads/AllTheThings/AllTheThingsx86.dll C:\Temp\AllTheThingsx86.dll
timeout /t 1 /nobreak > NUL
REM X86
Executing X86 AllTheThings Test
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U AllTheThingsx86.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regsvcs.exe AllTheThingsx86.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /U AllTheThingsx86.dll
regsvr32.exe /s /u AllTheThingsx86.dll
regsvr32.exe /s AllTheThingsx86.dll
rundll32 AllTheThingsx86.dll,EntryPoint
REM AMD64
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U AllTheThingsx64.dll
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regsvcs.exe AllTheThingsx64.dll
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /U AllTheThingsx64.dll
regsvr32.exe /s /u AllTheThingsx64.dll
regsvr32.exe /s AllTheThingsx64.dll
rundll32 AllTheThingsx64.dll,EntryPoint
REM Cleanup
del C:\Temp\AllTheThings*

Update All The Things

Update All The Things


@echo off

echo Building authenticator-helper for Windows...
cd helper
poetry install
rmdir /s /q ..\build\windows\helper
poetry run pyinstaller authenticator-helper.spec --distpath ..\build\windows

echo Generating license files...
rmdir /s /q ..\build\windows\helper-license-venv
poetry build
poetry run python -m venv ..\build\windows\helper-license-venv
..\build\windows\helper-license-venv\Scripts\pip install --upgrade pip wheel
..\build\windows\helper-license-venv\Scripts\pip install dist\authenticator_helper-0.1.0-py3-none-any.whl pip-licenses
..\build\windows\helper-license-venv\Scripts\pip-licenses --format=json --no-license-path --with-license-file --ignore-packages authenticator-helper --output-file ..\assets\licenses\helper.json

cd ..

echo All done, output in build/windows/

@echo off

echo Building authenticator-helper for Windows...
cd helper
poetry install
rmdir /s /q ..\build\windows\helper
poetry run pyinstaller authenticator-helper.spec --distpath ..\build\windows

echo Generating license files...
rmdir /s /q ..\build\windows\helper-license-venv
poetry build
poetry run python -m venv ..\build\windows\helper-license-venv
..\build\windows\helper-license-venv\Scripts\python -m pip install --upgrade pip wheel
..\build\windows\helper-license-venv\Scripts\python -m pip install dist\authenticator_helper-0.1.0-py3-none-any.whl pip-licenses
..\build\windows\helper-license-venv\Scripts\pip-licenses --format=json --no-license-path --with-license-file --ignore-packages authenticator-helper --output-file ..\assets\licenses\helper.json

cd ..

echo All done, output in build/windows/

Fix Windows license generation.

Fix Windows license generation.


call npm install
IF "%ERRORLEVEL%" NEQ "0" goto error

call npm run build
IF "%ERRORLEVEL%" NEQ "0" goto error

del /q %DEPLOYMENT_TARGET%\*
for /d %%I in (%DEPLOYMENT_TARGET%\*) do (
    @rd /s /q "%%~I"
)
IF "%ERRORLEVEL%" NEQ "0" goto error

xcopy %DEPLOYMENT_SOURCE%\dist\* %DEPLOYMENT_TARGET%\dist /s /i
xcopy %DEPLOYMENT_SOURCE%\index.html %DEPLOYMENT_TARGET%\index.html*
xcopy %DEPLOYMENT_SOURCE%\web.config %DEPLOYMENT_TARGET%\web.config*
xcopy %DEPLOYMENT_SOURCE%\server.js %DEPLOYMENT_TARGET%\server.js*
xcopy %DEPLOYMENT_SOURCE%\node_modules\express\* %DEPLOYMENT_TARGET%\node_modules\express /s /i
xcopy %DEPLOYMENT_SOURCE%\node_modules\serve-favicon\* %DEPLOYMENT_TARGET%\node_modules\serve-favicon /s /i
xcopy %DEPLOYMENT_SOURCE%\node_modules\serialize-javascript\* %DEPLOYMENT_TARGET%\node_modules\serialize-javascript /s /i
xcopy %DEPLOYMENT_SOURCE%\node_modules\vue-server-renderer\* %DEPLOYMENT_TARGET%\node_modules\vue-server-renderer /s /i
xcopy %DEPLOYMENT_SOURCE%\node_modules\merge-descriptors\* %DEPLOYMENT_TARGET%\node_modules\merge-descriptors /s /i

:: %DEPLOYMENT_SOURCE%\build\7za.exe a -t7z %DEPLOYMENT_SOURCE%\deploy.7z %DEPLOYMENT_SOURCE%\node_modules
:: IF "%ERRORLEVEL%" NEQ "0" goto error

:: %DEPLOYMENT_SOURCE%\build\7za.exe -y x %DEPLOYMENT_SOURCE%\deploy.7z -o%DEPLOYMENT_TARGET%
:: IF "%ERRORLEVEL%" NEQ "0" goto error

:: del /q %DEPLOYMENT_SOURCE%\deploy.7z
:: IF "%ERRORLEVEL%" NEQ "0" goto error

:: call npm install --prefix %DEPLOYMENT_TARGET%/node_modules
:: IF "%ERRORLEVEL%" NEQ "0" goto error

goto end

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

call npm install
IF "%ERRORLEVEL%" NEQ "0" goto error

call npm run build
IF "%ERRORLEVEL%" NEQ "0" goto error

del /q %DEPLOYMENT_TARGET%\*
for /d %%I in (%DEPLOYMENT_TARGET%\*) do (
    @rd /s /q "%%~I"
)
IF "%ERRORLEVEL%" NEQ "0" goto error

xcopy %DEPLOYMENT_SOURCE%\dist\* %DEPLOYMENT_TARGET%\dist /s /i
xcopy %DEPLOYMENT_SOURCE%\index.html %DEPLOYMENT_TARGET%\index.html*
xcopy %DEPLOYMENT_SOURCE%\web.config %DEPLOYMENT_TARGET%\web.config*
xcopy %DEPLOYMENT_SOURCE%\server.js %DEPLOYMENT_TARGET%\server.js*
xcopy %DEPLOYMENT_SOURCE%\node_modules\* %DEPLOYMENT_TARGET%\node_modules /s /i

:: %DEPLOYMENT_SOURCE%\build\7za.exe a -t7z %DEPLOYMENT_SOURCE%\deploy.7z %DEPLOYMENT_SOURCE%\node_modules
:: IF "%ERRORLEVEL%" NEQ "0" goto error

:: %DEPLOYMENT_SOURCE%\build\7za.exe -y x %DEPLOYMENT_SOURCE%\deploy.7z -o%DEPLOYMENT_TARGET%
:: IF "%ERRORLEVEL%" NEQ "0" goto error

:: del /q %DEPLOYMENT_SOURCE%\deploy.7z
:: IF "%ERRORLEVEL%" NEQ "0" goto error

:: call npm install --prefix %DEPLOYMENT_TARGET%/node_modules
:: IF "%ERRORLEVEL%" NEQ "0" goto error

goto end

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

Include all node modules

Include all node modules


call settings.bat

git clone https://github.com/osmcode/libosmium.git libosmium
cd libosmium/build-cmake
set CMAKE_PREFIX_PATH=C:\PROJ
set TESTS=ON
set ALLHPPS=OFF
cmake .. -G "Visual Studio 12 Win64" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%PREFIX% -DBOOST_ROOT=%BOOST_ROOT% -DBoost_USE_STATIC_LIBS=ON -DBUILD_TESTING=%TESTS% -DBUILD_TRY_HPPS=%ALLHPPS$ -T CTP_Nov2013
msbuild /clp:Verbosity=minimal /nologo libosmium.sln /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly

set PATH=%PATH%;%PREFIX%/bin
if "%TESTS%"=="ON" ctest -VV >build_tests.log

msbuild /clp:Verbosity=minimal /nologo INSTALL.vcxproj

cd ..\..

call settings.bat

git clone https://github.com/osmcode/libosmium.git libosmium

cd libosmium/build-cmake
set CMAKE_PREFIX_PATH=C:\PROJ
set TESTS=ON
set ALLHPPS=OFF
cmake .. -G "Visual Studio 12 Win64" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%PREFIX% -DBOOST_ROOT=%BOOST_ROOT% -DBoost_USE_STATIC_LIBS=ON -DBUILD_TESTING=%TESTS% -DBUILD_TRY_HPPS=%ALLHPPS$ -T CTP_Nov2013
msbuild /p:Configuration=%Variant% /clp:Verbosity=minimal /nologo libosmium.sln /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly

set PATH=%PATH%;%PREFIX%/bin
if "%TESTS%"=="ON" ctest -VV >build_tests.log

msbuild /p:Configuration=%Variant% /clp:Verbosity=minimal /nologo INSTALL.vcxproj

cd ..\..

fix osmium release builds

fix osmium release builds


@ECHO OFF
ECHO.
ECHO Making Command Prompt suck slightly less...

REM So that we can safely run via AutoRun without infinite recursion
REM Key Path: HKEY_CURRENT_USER\Software\Microsoft\Command Processor
REM Use something like: IF NOT DEFINED SetupEnv Path\To\SetupEnv.Cmd
SET SetupEnv=Yes

REM Uncomment to enable verbose mode
REM SET SetupEnvVerbose=Yes

REM Bail out before doing anything if we were invoked via Cygwin Setup!!
REM Cygwin does some weird things to the environment while performing an
REM autorebase that at a minimum causes DOSKEY to crash (yes, seriously).
IF DEFINED CYGWINROOT EXIT /B

REM Inject Clink for a more pleasant experience
SET ClinkPath=C:\Program Files (x86)\Nexiom\Software\Independent\clink\0.4.1\clink_x64.exe
IF NOT EXIST "%ClinkPath%" (
    IF DEFINED SetupEnvVerbose ECHO * Unable to find Clink at path specified by ClinkPath.
) ELSE (
    IF DEFINED SetupEnvVerbose ECHO * Injecting Clink into Command Processor...
    "%ClinkPath%" inject -q --profile "~\clink"
)
SET ClinkPath=

REM Inject ANSICON if we're not running inside ConEmu
SET AnsiConPath=C:\Program Files (x86)\Nexiom\Software\Independent\ANSICON\ansicon.exe
IF DEFINED ConEmuANSI (
    IF DEFINED SetupEnvVerbose ECHO * Detected we're running in ConEmu so not injecting ANSICON.
) ELSE (
    IF NOT EXIST "%AnsiConPath%" (
        IF DEFINED SetupEnvVerbose ECHO * Unable to find ANSICON at path specified by AnsiConPath.
    ) ELSE (
        IF DEFINED SetupEnvVerbose ECHO * Injecting ANSICON into Command Processor...
        IF !ANSICON_VER!==^!ANSICON_VER^! "%AnsiConPath%" -p
    )
)
SET AnsiConPath=

REM Because I'm tired of forgetting Cmd is not a *nix shell
IF DEFINED SetupEnvVerbose ECHO * Setting DOSKEY macros...
DOSKEY clear=cls
DOSKEY ls=dir $*
DOSKEY man=help $*
DOSKEY which=where $*

REM Add alias for Sublime Text
SET SublRegPath=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Sublime Text 2_is1
SET SublBinName=sublime_text.exe
REG QUERY "%SublRegPath%" /v InstallLocation > NUL 2>&1
IF ERRORLEVEL 1 (
    IF DEFINED SetupEnvVerbose ECHO * Couldn't locate Sublime Text installation so not adding 'subl' alias.
) ELSE (
    IF DEFINED SetupEnvVerbose ECHO * Setting Sublime Text 'subl' alias...
    FOR /F "tokens=2*" %%a IN ('REG QUERY "%SublRegPath%" /v InstallLocation ^| FINDSTR /R "[a-z]:\\.*\\$"') DO @SET SublDirPath=%%b
)
IF DEFINED SublDirPath DOSKEY subl="%SublDirPath%%SublBinName%" $*
FOR /F "delims==" %%i IN ('SET Subl') DO @SET %%i=

REM Remove the Verbose variable if it was ever set
SET SetupEnvVerbose=

@ECHO OFF
ECHO.
ECHO Making Command Prompt suck slightly less...

REM So that we can safely run via AutoRun without infinite recursion
REM Key Path: HKEY_CURRENT_USER\Software\Microsoft\Command Processor
REM Use something like: IF NOT DEFINED SetupEnv Path\To\SetupEnv.Cmd
SET SetupEnv=Yes

REM Uncomment to enable verbose mode
REM SET SetupEnvVerbose=Yes

REM Bail out before doing anything if we were invoked via Cygwin Setup!!
REM Cygwin does some weird things to the environment while performing an
REM autorebase that at a minimum causes DOSKEY to crash (yes, seriously).
IF DEFINED CYGWINROOT EXIT /B

REM Inject Clink for a more pleasant experience
SET ClinkPath=C:\Program Files (x86)\Nexiom\Software\Independent\clink\0.4.1\clink_x64.exe
IF NOT EXIST "%ClinkPath%" (
    IF DEFINED SetupEnvVerbose ECHO * Unable to find Clink at path specified by ClinkPath.
) ELSE (
    IF DEFINED SetupEnvVerbose ECHO * Injecting Clink into Command Processor...
    "%ClinkPath%" inject -q --profile "~\clink"
)
SET ClinkPath=

REM Inject ANSICON if we're not running inside ConEmu
SET AnsiConPath=C:\Program Files (x86)\Nexiom\Software\Independent\ANSICON\ansicon.exe
IF DEFINED ConEmuANSI (
    IF DEFINED SetupEnvVerbose ECHO * Detected we're running in ConEmu so not injecting ANSICON.
) ELSE (
    IF NOT EXIST "%AnsiConPath%" (
        IF DEFINED SetupEnvVerbose ECHO * Unable to find ANSICON at path specified by AnsiConPath.
    ) ELSE (
        IF DEFINED SetupEnvVerbose ECHO * Injecting ANSICON into Command Processor...
        IF !ANSICON_VER!==^!ANSICON_VER^! "%AnsiConPath%" -p
    )
)
SET AnsiConPath=

REM Because I'm tired of forgetting Cmd is not a *nix shell
IF DEFINED SetupEnvVerbose ECHO * Setting DOSKEY macros...
DOSKEY clear=cls
DOSKEY ls=dir $*
DOSKEY man=help $*
DOSKEY which=where $*

REM Some other useful aliases to avoid having to append to our PATH
DOSKEY depends32="C:\Program Files (x86)\Nexiom\Software\Independent\Dependency Walker\depends.exe" $*
DOSKEY depends64="C:\Program Files\Nexiom\Software\Independent\Dependency Walker\depends.exe" $*

REM Add alias for Sublime Text
SET SublRegPath=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Sublime Text 2_is1
SET SublBinName=sublime_text.exe
REG QUERY "%SublRegPath%" /v InstallLocation > NUL 2>&1
IF ERRORLEVEL 1 (
    IF DEFINED SetupEnvVerbose ECHO * Couldn't locate Sublime Text installation so not adding 'subl' alias.
) ELSE (
    IF DEFINED SetupEnvVerbose ECHO * Setting Sublime Text 'subl' alias...
    FOR /F "tokens=2*" %%a IN ('REG QUERY "%SublRegPath%" /v InstallLocation ^| FINDSTR /R "[a-z]:\\.*\\$"') DO @SET SublDirPath=%%b
)
IF DEFINED SublDirPath DOSKEY subl="%SublDirPath%%SublBinName%" $*
FOR /F "delims==" %%i IN ('SET Subl') DO @SET %%i=

REM Remove the Verbose variable if it was ever set
SET SetupEnvVerbose=

Add some other useful aliases via DOSKEY to avoid fiddling with PATH


@set MINGWPATH=C:\MinGW
@set PATH=%MINGWPATH%\msys\1.0\bin;%MINGWPATH%\bin

@set LANG=en_US.UTF8
@set LC_ALL=en_US.UTF8

@set OPENSSL=openssl-1.0.1g
@set BERKELEYDB=db-4.8.30.NC
@set BOOST=boost_1_54_0
@set BOOSTVERSION=1.54.0
@rem If you wonder why there is no -s- see: https://github.com/bitcoin/bitcoin/pull/2835#issuecomment-21231694
@set BOOSTSUFFIX=-mgw46-mt-1_54
@set MINIUPNPC=miniupnpc-1.8

@set EWBLIBS=libs

@set EWBPATH=contrib/easywinbuilder
@set ROOTPATH=..\..
@set ROOTPATHSH=%ROOTPATH:\=/%

@rem bootstrap coin name
@for /F %%a in ('dir /b %ROOTPATH%\*.pro') do @set COINNAME=%%a
@set COINNAME=%COINNAME:-qt.pro=%

@set QTPATH=C:\Qt\4.8.5\bin
@set QTDOWNLOADPATH=http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-mingw.exe
@rem Qt5 will need changes in gather_dlls.bat

@set MSYS=%MINGWPATH:\=/%/msys/1.0/bin
@set PERL=%MSYS%/perl.exe

@rem the following will be set as additional CXXFLAGS and CFLAGS for everything - no ' or ", space is ok
@set ADDITIONALCCFLAGS=-fno-guess-branch-probability -frandom-seed=1984 -Wno-unused-variable -Wno-unused-value -Wno-sign-compare -Wno-strict-aliasing

@rem Note: Variables set here can NOT be overwritten in makefiles

@set MINGWPATH=C:\MinGW
@set PATH=%MINGWPATH%\msys\1.0\bin;%MINGWPATH%\bin

@set LANG=en_US.UTF8
@set LC_ALL=en_US.UTF8

@set OPENSSL=openssl-1.0.1g
@set BERKELEYDB=db-4.8.30.NC
@set BOOST=boost_1_54_0
@set BOOSTVERSION=1.54.0
@rem If you wonder why there is no -s- see: https://github.com/bitcoin/bitcoin/pull/2835#issuecomment-21231694
@set BOOSTSUFFIX=-mgw46-mt-1_54
@set MINIUPNPC=miniupnpc-1.8

@set EWBLIBS=libs

@set EWBPATH=contrib/easywinbuilder
@set ROOTPATH=..\..
@set ROOTPATHSH=%ROOTPATH:\=/%

@rem bootstrap coin name
@for /F %%a in ('dir /b %ROOTPATH%\*.pro') do @set COINNAME=%%a
@set COINNAME=%COINNAME:-qt.pro=%

@set QTPATH=C:\Qt\4.8.5\bin
@set QTDOWNLOADPATH=http://download.qt-project.org/archive/qt/4.8/4.8.5/qt-win-opensource-4.8.5-mingw.exe
@rem Qt5 will need changes in gather_dlls.bat

@set MSYS=%MINGWPATH:\=/%/msys/1.0/bin
@set PERL=%MSYS%/perl.exe

@rem the following will be set as additional CXXFLAGS and CFLAGS for everything - no ' or ", space is ok
@set ADDITIONALCCFLAGS=-fno-guess-branch-probability -frandom-seed=1984 -Wno-unused-variable -Wno-unused-value -Wno-sign-compare -Wno-strict-aliasing

@rem Note: Variables set here can NOT be overwritten in makefiles

Update set_vars.bat

Update set_vars.bat

Updated path to qt opensource.


@rem Copyright 2015 Google Inc. 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.

@rem Modify the UIforETW project to be statically linked and build that version
@rem so that it will run without any extra install requirements.

@setlocal

call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"

sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
rmdir Release /s/q
devenv /rebuild "release|Win32" UIforETWStatic.sln
del UIforETWStatic.vcxproj
del UIforETWStatic.sln

Add build_static.bat to build a statically linked UIforETW.

Normally UIforETW requires the MFC and CRT DLLs. This can be
annoying. Running build_static.bat generates a version that only
requires OS DLLs. The downside is that it is much larger.


@echo off
rd build >nul 2>&1
rd dist >nul 2>&1
set PATH=%PATH%;c:\Python27\Lib\site-packages\PySide
del /f /q icon_rc.py
pyside-rcc -py2 -o icon_rc.py icon.qrc
py setup.py build bdist_wininst
cd %~dp0\build\exe.win-amd64-2.7
copy zmq.libzmq.pyd libzmq.pyd >nul 2>&1
del zmq.libzmq.pyd
pause

@echo off

rd build >nul 2>&1
rd dist >nul 2>&1

rem generate icon_rc.py
set PATH=%PATH%;c:\Python27\Lib\site-packages\PySide
del /f /q icon_rc.py
pyside-rcc -py2 -o icon_rc.py icon.qrc

rem run cx_freeze and create py installer
py setup.py build bdist_wininst

rem workaround pyzmq cx_freeze, see README.md
cd %~dp0\build\exe.win-amd64-2.7
copy zmq.libzmq.pyd libzmq.pyd >nul 2>&1
del zmq.libzmq.pyd

pause

Document setup.bat

Document setup.bat


set DOWNLOAD_DIR=c:\temp

set SASAKAMA_JAR=%DOWNLOAD_DIR%\Sasakama-master\Sasakama-master\jar\Sasakama.jar

set GYUTAN_HOME=%DOWNLOAD_DIR%\Gyutan-master\Gyutan-master
set GYUTAN_JAR=%GYUTAN_HOME%\jar\Gyutan.jar

set SEN_HOME=%GYUTAN_HOME%\sen
set SEN_LIB=%SEN_HOME%\lib
set SEN_JAR=%SEN_LIB%\sen.jar;%SEN_LIB%\commons-logging.jar;%SEN_LIB%\junit.jar

set SIMPLE_GUI_JAR=%DOWNLOAD_DIR%\SimpleGUI-master\SimpleGUI-master\jar\SimpleGUI.jar

set CLASSPATH=%SEN_JAR%;%SASAKAMA_JAR%;%GYUTAN_JAR%;%SIMPLE_GUI_JAR%

java -Dorg.apache.commons.logging.simplelog.log.net.java=info -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -classpath %CLASSPATH% SimpleGUI

change Line Feed code (unix(LF) to Windows('CR LF'))


REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

@ECHO OFF
cls

@echo Building from script Common.Logging.build...
@echo .
@echo .
@echo .

tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.0 -D:nuget.version.suffix=RC1 -D:project.releasetype=release > buildlog.txt
rem tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.0 -D:project.releasetype=release > buildlog.txt

@echo ...complete!
@echo .
@echo .
@echo .

@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

@ECHO OFF
cls

@echo Building from script Common.Logging.build...
@echo .
@echo .
@echo .

rem tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.0 -D:nuget.version.suffix=RC1 -D:project.releasetype=release > buildlog.txt
tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.0 -D:project.releasetype=release > buildlog.txt

@echo ...complete!
@echo .
@echo .
@echo .

@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

update batch file to build 2.3.0-GA

update batch file to build 2.3.0-GA


@echo off

setup.py register
setup.py bdist_wheel upload
setup.py sdist upload

add quick setup script

add quick setup script


@echo off
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\msbuild.exe" src/Skybrud.ImagePicker /t:rebuild /t:pack /p:Configuration=Release /p:BuildTools=1 /p:PackageOutputPath=../../releases/nuget

@echo off
dotnet build src/Skybrud.ImagePicker --configuration Release /t:rebuild /t:pack -p:BuildTools=1 -p:PackageOutputPath=../../releases/nuget

Build stuff

Build stuff


call config.bat
rackup -s 80 -s webrick config.ru

call config.bat
rackup -p 80 -s webrick config.ru

fix startup script

fix startup script


@java -jar "%~dp0\app\ringojs\run.jar" "%~dp0\app\main.js"

add windows start.cmd

add windows start.cmd


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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"

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

set ERROR_CODE=0

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
set ERROR_CODE=1
goto end

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

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

:chkMHome
if not "%M2_HOME%"=="" goto valMHome

if "%OS%"=="Windows_NT" SET M2_HOME=%~dps0\..
if not "%M2_HOME%"=="" goto valMHome

echo.
echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
set ERROR_CODE=1
goto end

:valMHome
if exist "%M2_HOME%\bin\m2.bat" goto init

echo.
echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME%
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
set ERROR_CODE=1
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set MAVEN_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set MAVEN_CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of agruments (up to the command line limit, anyway).
set MAVEN_CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

@REM Start MAVEN2
for %%i in ("%M2_HOME%"\core\boot\classworlds-*) do set CLASSWORLDS_JAR="%%i"
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
goto end

:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=1

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set MAVEN_JAVA_EXE=
set MAVEN_CMD_LINE_ARGS=
goto postExec

:endNT
@endlocal

:postExec
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

Add mvn script for maven 2.0

Add mvn script for maven 2.0

git-svn-id: 1d22bf2b43db35b985fe5d7437c243537c14eeaa@355031 13f79535-47bb-0310-9956-ffa450edef68


@echo off
rem -------------------------------------------------------------------------
rem JBoss Bootstrap Script for Windows
rem -------------------------------------------------------------------------

rem Use --debug to activate debug mode with an optional argument to specify the port
rem Usage : standalone.bat --debug
rem         standalone.bat --debug 9797

rem By default debug mode is disable.
set DEBUG_MODE=false
set DEBUG_PORT=8787
rem Set to all parameters by default
set SERVER_OPTS=%*

rem Get the program name before using shift as the command modify the variable ~nx0
if "%OS%" == "Windows_NT" (
  set "PROGNAME=%~nx0%"
) else (
  set "PROGNAME=standalone.bat"
)

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal

if "%OS%" == "Windows_NT" (
  set "DIRNAME=%~dp0%"
) else (
  set DIRNAME=.\
)

rem Read command-line args.
:READ-ARGS
if "%1" == "" (
   goto MAIN
) else if "%1" == "--debug" (
   goto READ-DEBUG-PORT
) else (
   rem This doesn't work as Windows splits on = and spaces by default
   rem set SERVER_OPTS=%SERVER_OPTS% %1
   shift
   goto READ-ARGS
)

:READ-DEBUG-PORT
set "DEBUG_MODE=true"
set DEBUG_ARG="%2"
if not "x%DEBUG_ARG" == "x" (
   if x%DEBUG_ARG:-=%==x%DEBUG_ARG% (
      shift
      set DEBUG_PORT=%DEBUG_ARG%
   )
   shift
   goto READ-ARGS
)

:MAIN
rem $Id$
)

pushd %DIRNAME%..
set "RESOLVED_JBOSS_HOME=%CD%"
popd

if "x%JBOSS_HOME%" == "x" (
  set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
)

pushd "%JBOSS_HOME%"
set "SANITIZED_JBOSS_HOME=%CD%"
popd

if /i "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
   echo.
   echo   WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
   echo.
   echo             JBOSS_HOME: %JBOSS_HOME%
   echo.
   rem 2 seconds pause
   ping 127.0.0.1 -n 3 > nul
)

rem Read an optional configuration file.
if "x%STANDALONE_CONF%" == "x" (
   set "STANDALONE_CONF=%DIRNAME%standalone.conf.bat"
)
if exist "%STANDALONE_CONF%" (
   echo Calling "%STANDALONE_CONF%"
   call "%STANDALONE_CONF%" %*
) else (
   echo Config file not found "%STANDALONE_CONF%"
)

rem Set debug settings if not already set
if "%DEBUG_MODE%" == "true" (
   echo "%JAVA_OPTS%" | findstr /I "\-agentlib:jdwp" > nul
  if errorlevel == 1 (
     echo Debug already enabled in JAVA_OPTS, ignoring --debug argument
  ) else (
     set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n"
  )
)

set DIRNAME=

rem Setup JBoss specific properties
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%

if "x%JAVA_HOME%" == "x" (
  set  JAVA=java
  echo JAVA_HOME is not set. Unexpected results may occur.
  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
  set "JAVA=%JAVA_HOME%\bin\java"
)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
  rem Add -client to the JVM options, if supported (32 bit VM), and not overriden
  echo "%JAVA_OPTS%" | findstr /I \-server > nul
  if errorlevel == 1 (
    "%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul
    if not errorlevel == 1 (
      set "JAVA_OPTS=-client %JAVA_OPTS%"
    )
  )
)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
  rem Add compressed oops, if supported (64 bit VM), and not overriden
  echo "%JAVA_OPTS%" | findstr /I "\-XX:\-UseCompressedOops \-client" > nul
  if errorlevel == 1 (
    "%JAVA%" -XX:+UseCompressedOops -version > nul 2>&1
    if not errorlevel == 1 (
      set "JAVA_OPTS=-XX:+UseCompressedOops %JAVA_OPTS%"
    )
  )
)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
  rem Add tiered compilation, if supported (64 bit VM), and not overriden
  echo "%JAVA_OPTS%" | findstr /I "\-XX:\-TieredCompilation \-client" > nul
  if errorlevel == 1 (
    "%JAVA%" -XX:+TieredCompilation -version > nul 2>&1
    if not errorlevel == 1 (
      set "JAVA_OPTS=-XX:+TieredCompilation %JAVA_OPTS%"
    )
  )
)

rem Find jboss-modules.jar, or we can't continue
if exist "%JBOSS_HOME%\jboss-modules.jar" (
    set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
) else (
  echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  echo Please check that you are in the bin directory when running this script.
  goto END
)

rem Setup JBoss specific properties

rem Setup directories, note directories with spaces do not work
set "CONSOLIDATED_OPTS=%JAVA_OPTS% %SERVER_OPTS%"
:DIRLOOP
echo(%CONSOLIDATED_OPTS% | findstr /r /c:"^-Djboss.server.base.dir" > nul && (
  for /f "tokens=1,2* delims==" %%a IN ("%CONSOLIDATED_OPTS%") DO (
    for /f %%i IN ("%%b") DO set "JBOSS_BASE_DIR=%%~fi"
  )
)
echo(%CONSOLIDATED_OPTS% | findstr /r /c:"^-Djboss.server.config.dir" > nul && (
  for /f "tokens=1,2* delims==" %%a IN ("%CONSOLIDATED_OPTS%") DO (
    for /f %%i IN ("%%b") DO set "JBOSS_CONFIG_DIR=%%~fi"
  )
)
echo(%CONSOLIDATED_OPTS% | findstr /r /c:"^-Djboss.server.log.dir" > nul && (
  for /f "tokens=1,2* delims==" %%a IN ("%CONSOLIDATED_OPTS%") DO (
    for /f %%i IN ("%%b") DO set "JBOSS_LOG_DIR=%%~fi"
  )
)

for /f "tokens=1* delims= " %%i IN ("%CONSOLIDATED_OPTS%") DO (
  if %%i == "" (
    goto ENDDIRLOOP
  ) else (
    set CONSOLIDATED_OPTS=%%j
    GOTO DIRLOOP
  )
)

:ENDDIRLOOP

rem Set default module root paths
if "x%JBOSS_MODULEPATH%" == "x" (
  set  "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
)

rem Set the standalone base dir
if "x%JBOSS_BASE_DIR%" == "x" (
  set  "JBOSS_BASE_DIR=%JBOSS_HOME%\standalone"
)
rem Set the standalone log dir
if "x%JBOSS_LOG_DIR%" == "x" (
  set  "JBOSS_LOG_DIR=%JBOSS_BASE_DIR%\log"
)
rem Set the standalone configuration dir
if "x%JBOSS_CONFIG_DIR%" == "x" (
  set  "JBOSS_CONFIG_DIR=%JBOSS_BASE_DIR%/configuration"
)

echo ===============================================================================
echo.
echo   JBoss Bootstrap Environment
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   JAVA_OPTS: %JAVA_OPTS%
echo.
echo ===============================================================================
echo.

:RESTART
"%JAVA%" %JAVA_OPTS% ^
 "-Dorg.jboss.boot.log.file=%JBOSS_LOG_DIR%\server.log" ^
 "-Dlogging.configuration=file:%JBOSS_CONFIG_DIR%/logging.properties" ^
    -jar "%JBOSS_HOME%\jboss-modules.jar" ^
    -mp "%JBOSS_MODULEPATH%" ^
     org.jboss.as.standalone ^
    -Djboss.home.dir="%JBOSS_HOME%" ^
     %SERVER_OPTS%

if ERRORLEVEL 10 goto RESTART

:END
if "x%NOPAUSE%" == "x" pause

:END_NO_PAUSE

@echo off
rem -------------------------------------------------------------------------
rem JBoss Bootstrap Script for Windows
rem -------------------------------------------------------------------------

rem Use --debug to activate debug mode with an optional argument to specify the port
rem Usage : standalone.bat --debug
rem         standalone.bat --debug 9797

rem By default debug mode is disable.
set DEBUG_MODE=false
set DEBUG_PORT=8787
rem Set to all parameters by default
set SERVER_OPTS=%*

rem Get the program name before using shift as the command modify the variable ~nx0
if "%OS%" == "Windows_NT" (
  set "PROGNAME=%~nx0%"
) else (
  set "PROGNAME=standalone.bat"
)

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal

if "%OS%" == "Windows_NT" (
  set "DIRNAME=%~dp0%"
) else (
  set DIRNAME=.\
)

rem Read command-line args.
:READ-ARGS
if "%1" == "" (
   goto MAIN
) else if "%1" == "--debug" (
   goto READ-DEBUG-PORT
) else (
   rem This doesn't work as Windows splits on = and spaces by default
   rem set SERVER_OPTS=%SERVER_OPTS% %1
   shift
   goto READ-ARGS
)

:READ-DEBUG-PORT
set "DEBUG_MODE=true"
set DEBUG_ARG="%2"
if not "x%DEBUG_ARG" == "x" (
   if x%DEBUG_ARG:-=%==x%DEBUG_ARG% (
      shift
      set DEBUG_PORT=%DEBUG_ARG%
   )
   shift
   goto READ-ARGS
)

:MAIN
rem $Id$
)

pushd %DIRNAME%..
set "RESOLVED_JBOSS_HOME=%CD%"
popd

if "x%JBOSS_HOME%" == "x" (
  set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
)

pushd "%JBOSS_HOME%"
set "SANITIZED_JBOSS_HOME=%CD%"
popd

if /i "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
   echo.
   echo   WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
   echo.
   echo             JBOSS_HOME: %JBOSS_HOME%
   echo.
   rem 2 seconds pause
   ping 127.0.0.1 -n 3 > nul
)

rem Read an optional configuration file.
if "x%STANDALONE_CONF%" == "x" (
   set "STANDALONE_CONF=%DIRNAME%standalone.conf.bat"
)
if exist "%STANDALONE_CONF%" (
   echo Calling "%STANDALONE_CONF%"
   call "%STANDALONE_CONF%" %*
) else (
   echo Config file not found "%STANDALONE_CONF%"
)

rem Set debug settings if not already set
if "%DEBUG_MODE%" == "true" (
   echo "%JAVA_OPTS%" | findstr /I "\-agentlib:jdwp" > nul
  if errorlevel == 1 (
     set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n"
  ) else (
     echo Debug already enabled in JAVA_OPTS, ignoring --debug argument
  )
)

set DIRNAME=

rem Setup JBoss specific properties
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%

if "x%JAVA_HOME%" == "x" (
  set  JAVA=java
  echo JAVA_HOME is not set. Unexpected results may occur.
  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
  set "JAVA=%JAVA_HOME%\bin\java"
)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
  rem Add -client to the JVM options, if supported (32 bit VM), and not overriden
  echo "%JAVA_OPTS%" | findstr /I \-server > nul
  if errorlevel == 1 (
    "%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul
    if not errorlevel == 1 (
      set "JAVA_OPTS=-client %JAVA_OPTS%"
    )
  )
)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
  rem Add compressed oops, if supported (64 bit VM), and not overriden
  echo "%JAVA_OPTS%" | findstr /I "\-XX:\-UseCompressedOops \-client" > nul
  if errorlevel == 1 (
    "%JAVA%" -XX:+UseCompressedOops -version > nul 2>&1
    if not errorlevel == 1 (
      set "JAVA_OPTS=-XX:+UseCompressedOops %JAVA_OPTS%"
    )
  )
)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
  rem Add tiered compilation, if supported (64 bit VM), and not overriden
  echo "%JAVA_OPTS%" | findstr /I "\-XX:\-TieredCompilation \-client" > nul
  if errorlevel == 1 (
    "%JAVA%" -XX:+TieredCompilation -version > nul 2>&1
    if not errorlevel == 1 (
      set "JAVA_OPTS=-XX:+TieredCompilation %JAVA_OPTS%"
    )
  )
)

rem Find jboss-modules.jar, or we can't continue
if exist "%JBOSS_HOME%\jboss-modules.jar" (
    set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
) else (
  echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  echo Please check that you are in the bin directory when running this script.
  goto END
)

rem Setup JBoss specific properties

rem Setup directories, note directories with spaces do not work
set "CONSOLIDATED_OPTS=%JAVA_OPTS% %SERVER_OPTS%"
:DIRLOOP
echo(%CONSOLIDATED_OPTS% | findstr /r /c:"^-Djboss.server.base.dir" > nul && (
  for /f "tokens=1,2* delims==" %%a IN ("%CONSOLIDATED_OPTS%") DO (
    for /f %%i IN ("%%b") DO set "JBOSS_BASE_DIR=%%~fi"
  )
)
echo(%CONSOLIDATED_OPTS% | findstr /r /c:"^-Djboss.server.config.dir" > nul && (
  for /f "tokens=1,2* delims==" %%a IN ("%CONSOLIDATED_OPTS%") DO (
    for /f %%i IN ("%%b") DO set "JBOSS_CONFIG_DIR=%%~fi"
  )
)
echo(%CONSOLIDATED_OPTS% | findstr /r /c:"^-Djboss.server.log.dir" > nul && (
  for /f "tokens=1,2* delims==" %%a IN ("%CONSOLIDATED_OPTS%") DO (
    for /f %%i IN ("%%b") DO set "JBOSS_LOG_DIR=%%~fi"
  )
)

for /f "tokens=1* delims= " %%i IN ("%CONSOLIDATED_OPTS%") DO (
  if %%i == "" (
    goto ENDDIRLOOP
  ) else (
    set CONSOLIDATED_OPTS=%%j
    GOTO DIRLOOP
  )
)

:ENDDIRLOOP

rem Set default module root paths
if "x%JBOSS_MODULEPATH%" == "x" (
  set  "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
)

rem Set the standalone base dir
if "x%JBOSS_BASE_DIR%" == "x" (
  set  "JBOSS_BASE_DIR=%JBOSS_HOME%\standalone"
)
rem Set the standalone log dir
if "x%JBOSS_LOG_DIR%" == "x" (
  set  "JBOSS_LOG_DIR=%JBOSS_BASE_DIR%\log"
)
rem Set the standalone configuration dir
if "x%JBOSS_CONFIG_DIR%" == "x" (
  set  "JBOSS_CONFIG_DIR=%JBOSS_BASE_DIR%/configuration"
)

echo ===============================================================================
echo.
echo   JBoss Bootstrap Environment
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   JAVA_OPTS: %JAVA_OPTS%
echo.
echo ===============================================================================
echo.

:RESTART
"%JAVA%" %JAVA_OPTS% ^
 "-Dorg.jboss.boot.log.file=%JBOSS_LOG_DIR%\server.log" ^
 "-Dlogging.configuration=file:%JBOSS_CONFIG_DIR%/logging.properties" ^
    -jar "%JBOSS_HOME%\jboss-modules.jar" ^
    -mp "%JBOSS_MODULEPATH%" ^
     org.jboss.as.standalone ^
    -Djboss.home.dir="%JBOSS_HOME%" ^
     %SERVER_OPTS%

if ERRORLEVEL 10 goto RESTART

:END
if "x%NOPAUSE%" == "x" pause

:END_NO_PAUSE

[AS7-6822] Swap the result of the check for the debug option in the JAVA_OPT in the bat file.


:: Use 'git describe' output as the version.
for /F %%G IN ('git describe') DO SET mumblebuildversion=%%G

call c:\dev\prep.bat
if errorlevel 1 exit /b errorlevel

:: Copy winpaths_custom from the build env root.
copy c:\dev\winpaths_custom.pri .\

echo Build mumble
if "%MUMBLE_BUILD_TYPE%" == "Release" (
	make CONFIG-=sse2 CONFIG+=packaged DEFINES+="MUMBLE_VERSION=%mumblebuildversion%" -recursive
) else (
	qmake CONFIG-=sse2 CONFIG+=packaged DEFINES+="MUMBLE_VERSION=%mumblebuildversion% SNAPSHOT_BUILD=1" -recursive
)
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel

echo Build SSE2 versions of opus
cd opus-build
qmake -recursive
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..

echo Build SSE2 versions of celt 0.11.0
cd celt-0.11.0-build
qmake -recursive
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..

echo Build SSE2 versions of celt 0.7.0
cd celt-0.7.0-build
qmake -recursive
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..

echo Build installer
SET MumbleNoMergeModuleDir=1
SET MumbleDebugToolsDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
SET MumbleSourceDir=%cd%
cd scripts
call mkini-win32.bat
if errorlevel 1 exit /b errorlevel
cd ..\installer
c:\cygwin\bin\sed -ri "s,</Include>,<?define RedistDirVC10 = \"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 10.0\\\\VC\\\\redist\\\\x86\\\\Microsoft.VC100.CRT\" ?></Include>,g" Settings.wxi
if errorlevel 1 exit /b errorlevel
msbuild  /p:Configuration=Release MumbleInstall.sln /t:Clean,Build
if errorlevel 1 exit /b errorlevel
perl build_installer.pl
if errorlevel 1 exit /b errorlevel
cd bin\Release
rename Mumble.msi "mumble-%mumblebuildversion%.msi"
if errorlevel 1 exit /b errorlevel
signtool sign /sm /a "mumble-%mumblebuildversion%.msi"
if errorlevel 1 exit /b errorlevel
cd ..\..\..

"C:\dev\mumble-releng\tools\collect_symbols.py" collect --version "%mumblebuildversion%" --buildtype "%MUMBLE_BUILD_TYPE%" --product "Mumble" release\ symbols.7z
if errorlevel 1 exit /b errorlevel

buildscripts: add mumble-win32-dll.bat, a script that does an official Mumble 1.2.x build.


@if "%DEBUG%" == "" @echo off
setlocal EnableDelayedExpansion

set "DIR=%~dp0"

call "%DIR%\vs-helper.cmd"
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

%*

[Batch] Add generic run that loads the Visual Studio environment setup. (#1301)


@echo off

rem get the admin permissions
>nul 2>&1 "%systemroot%\system32\cacls.exe" "%systemroot%\system32\config\system"
if '%errorlevel%' neq '0' (
    echo requesting administrative privileges...
    goto uac_prompt
) else ( goto got_admin )

:uac_prompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit -B

:got_admin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%cd%"
    cd /D "%~dp0"

rem create the xmake install directory
if %PROCESSOR_ARCHITECTURE%==x86_64 (
    set xmake_dir_install_default=C:\Program Files (x86^)\xmake
) else (
    set xmake_dir_install_default=C:\Program Files\xmake
)
echo please input the install directory
set /p xmake_dir_install=(default: %xmake_dir_install_default%):
if "%xmake_dir_install%"=="" set xmake_dir_install=%xmake_dir_install_default%
if exist "%xmake_dir_install%" rmdir /s /q "%xmake_dir_install%"
if not exist "%xmake_dir_install%" mkdir "%xmake_dir_install%"

rem compile xmake-core
echo compiling xmake-core...
cd core
cmd /K build.bat
cd ..

rem install the xmake core file
echo installing xmake-core...
set xmake_core=core\bin\demo.pkg\bin\msvc\x86\demo.exe
set xmake_core_install=%xmake_dir_install%\xmake_core.exe
copy /Y "%xmake_core%" "%xmake_core_install%" > install.log

rem install the xmake directory
xcopy /S /Q /Y "xmake" "%xmake_dir_install%" >> install.log

rem make the xmake loader
echo installing xmake-loader...
set xmake_loader=%temp%\xmake_loader
echo @echo off > %xmake_loader%
echo set XMAKE_PROGRAM_DIR=%xmake_dir_install%>> %xmake_loader%
echo "%xmake_core_install%" %%* >> %xmake_loader%

rem install the xmake loader
set xmake_loader_install=%xmake_dir_install%\xmake.bat
copy /Y "%xmake_loader%" "%xmake_loader_install%" >> install.log

rem set global PATH=%xmake_dir_install%
echo register xmake...
echo %path% | findstr /i /C:"%xmake_dir_install%" >> nul && (goto set_path_ok)
tools\dtreg.exe -MachineEnvSet path="%path%;%xmake_dir_install%" >> install.log
:set_path_ok

rem ok
echo ok!
pause

@echo off

rem get the admin permissions
>nul 2>&1 "%systemroot%\system32\cacls.exe" "%systemroot%\system32\config\system"
if '%errorlevel%' neq '0' (
    echo requesting administrative privileges...
    goto uac_prompt
) else ( goto got_admin )

:uac_prompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit -B

:got_admin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%cd%"
    cd /D "%~dp0"

rem create the xmake install directory
if %PROCESSOR_ARCHITECTURE%==x86_64 (
    set xmake_dir_install_default=C:\Program Files (x86^)\xmake
) else if %PROCESSOR_ARCHITECTURE%==AMD64 (
    set xmake_dir_install_default=C:\Program Files (x86^)\xmake
) else (
    set xmake_dir_install_default=C:\Program Files\xmake
)
echo please input the install directory
set /p xmake_dir_install=(default: %xmake_dir_install_default%):
if "%xmake_dir_install%"=="" set xmake_dir_install=%xmake_dir_install_default%
if exist "%xmake_dir_install%" rmdir /s /q "%xmake_dir_install%"
if not exist "%xmake_dir_install%" mkdir "%xmake_dir_install%"

rem compile xmake-core
echo compiling xmake-core...
cd core
cmd /K build.bat
cd ..

rem install the xmake core file
echo installing xmake-core...
set xmake_core=core\bin\demo.pkg\bin\msvc\x86\demo.exe
set xmake_core_install=%xmake_dir_install%\xmake_core.exe
copy /Y "%xmake_core%" "%xmake_core_install%" > install.log

rem install the xmake directory
xcopy /S /Q /Y "xmake" "%xmake_dir_install%" >> install.log

rem make the xmake loader
echo installing xmake-loader...
set xmake_loader=%temp%\xmake_loader
echo @echo off > %xmake_loader%
echo set XMAKE_PROGRAM_DIR=%xmake_dir_install%>> %xmake_loader%
echo "%xmake_core_install%" %%* >> %xmake_loader%

rem install the xmake loader
set xmake_loader_install=%xmake_dir_install%\xmake.bat
copy /Y "%xmake_loader%" "%xmake_loader_install%" >> install.log

rem set global PATH=%xmake_dir_install%
echo register xmake...
echo %path% | findstr /i /C:"%xmake_dir_install%" >> nul && (goto set_path_ok)
tools\dtreg.exe -MachineEnvSet path="%path%;%xmake_dir_install%" >> install.log
:set_path_ok

rem ok
echo ok!
pause

modify install.bat for amd64

modify install.bat for amd64


@echo off

echo Welcome to the installer for Drathybot!
timeout 3 > NUL
echo Before we begin, we need the path of MongoDB's executables.
timeout 2 > NUL
echo For example, the default install is C:/Program Files/MongoDB/Server/3.0/bin
timeout 2 > NUL
echo You can press [Enter] if that is your path.
timeout 2 > NUL

mkdir database
cd database

setlocal
:askMongoFolder
set /p loc="Please enter the path of MongoDB's executable containing folder: "
if "%loc%"=="" set loc=C:/Program Files/MongoDB/Server/3.0/bin
if NOT "%loc:~-1%" == "/" set loc=%loc%/
if NOT exist "%loc%mongo.exe" goto askMongoFolder
if NOT exist "%loc%mongod.exe" goto askMongoFolder
echo %loc% > "database/mongo.loc"
endlocal

echo Installing modules...
call npm install

echo Finished installing modules.
echo Creating more batch files...

echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
echo   shift >> s.bat
echo ) else ( >> s.bat
echo   call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
echo   goto :EOF >> s.bat
echo ) >> s.bat
echo cd database >> s.bat
echo i.vbs "start /WAIT restart.bat" >> s.bat
echo cd .. >> s.bat
echo start "Drathybot" node %~dp0 >> s.bat

echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs

echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs

echo del db.log > start.bat
echo setlocal >> start.bat
echo (set /p loc=) ^< mongo.loc >> start.bat
echo "%%loc%%/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
echo endlocal >> start.bat

echo setlocal > stop.bat
echo (set /p loc=) ^< mongo.loc >> stop.bat
echo "%%loc%%/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" >> stop.bat
echo endlocal >> stop.bat

echo call stop.bat > restart.bat
echo timeout 1 >> restart.bat
echo wscript.exe i.vbs "start.bat" >> restart.bat
echo exit >> restart.bat

echo Drathybot is finished installing!

cd ..
timeout 5

@echo off

echo Welcome to the installer for Drathybot!
timeout 3 > NUL
echo Before we begin, we need the path of MongoDB's executables.
timeout 2 > NUL
echo For example, the default install is C:/Program Files/MongoDB/Server/3.0/bin
timeout 2 > NUL
echo You can press [Enter] if that is your path.
timeout 2 > NUL

mkdir database

setlocal
:askMongoFolder
set /p loc="Please enter the path of MongoDB's executable containing folder: "
if "%loc%"=="" set loc=C:/Program Files/MongoDB/Server/3.0/bin
if NOT "%loc:~-1%" == "/" set loc=%loc%/
if NOT exist "%loc%mongo.exe" goto askMongoFolder
if NOT exist "%loc%mongod.exe" goto askMongoFolder
echo %loc% > "database/mongo.loc"
endlocal

echo Installing modules...
call npm install

echo Finished installing modules.
echo Creating more batch files...

echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
echo   shift >> s.bat
echo ) else ( >> s.bat
echo   call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
echo   goto :EOF >> s.bat
echo ) >> s.bat
echo cd database >> s.bat
echo i.vbs "start /WAIT restart.bat" >> s.bat
echo cd .. >> s.bat
echo start "Drathybot" node %~dp0 >> s.bat

echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs

cd database

echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs

echo del db.log > start.bat
echo setlocal >> start.bat
echo (set /p loc=) ^< mongo.loc >> start.bat
echo "%%loc%%/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
echo endlocal >> start.bat

echo setlocal > stop.bat
echo (set /p loc=) ^< mongo.loc >> stop.bat
echo "%%loc%%/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" >> stop.bat
echo endlocal >> stop.bat

echo call stop.bat > restart.bat
echo timeout 1 >> restart.bat
echo wscript.exe i.vbs "start.bat" >> restart.bat
echo exit >> restart.bat

echo Drathybot is finished installing!

cd ..
timeout 5

Fix cd location

Fix cd location


mkdir %DEPLOYMENT%
mkdir %DEPLOYMENT%\src\
mkdir src\WhiteLibrary\bin\

copy %NUGET%\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.0.13.3\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.Reporting.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.ScreenObjects.dll src\WhiteLibrary\bin\

python -m robot.libdoc src\WhiteLibrary docs\keywords.html

xcopy docs %DEPLOYMENT%\docs\ /s /a
xcopy src %DEPLOYMENT%\src\ /s /a
copy setup.py %DEPLOYMENT%\
copy build.info %DEPLOYMENT%\

mkdir %DEPLOYMENT%
mkdir %DEPLOYMENT%\src\
mkdir src\WhiteLibrary\bin\

copy %NUGET%\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.0.13.3\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.Reporting.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.ScreenObjects.dll src\WhiteLibrary\bin\

rmdir docs /s /q

[~,cmdout] = system(python src/WhiteLibrary/version.py)

IF "%cmdout%" == "True" (
    python -m robot.libdoc src\WhiteLibrary docs\keywords.html
    xcopy docs %DEPLOYMENT%\docs\ /s /a
)

xcopy src %DEPLOYMENT%\src\ /s /a
copy setup.py %DEPLOYMENT%\
copy build.info %DEPLOYMENT%\

create documentation only stable release


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

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'))"
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

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

call cinst vagrant
set PATH=%PATH%;%SystemDrive%\hashicorp\vagrant\bin
cd /D %USERPROFILE%\Documents

call cinst wget
call cinst 7zip
set PATH=%PATH%;C:\Program Files\7-Zip
call cinst vim
where gvim.exe
if ERRORLEVEL 1 call :addVimToUserPath
goto VIM_DONE
:addVimToUserPath
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 Fiels (x86)\vim\vim74" /f
set PATH=%PATH%;C:\Program Files (x86)\vim\vim74
exit /b
:VIM_DONE

call cinst msysgit
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd

rem install firefox and all plugins needed to access vCloud via browser
call cinst firefox
call cinst flashplayerplugin
if not exist "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" (
call wget -O "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" http://roecloudsrv001/vmware/clientintegrationplugin/VMware-ClientIntegrationPlugin-5.5.0.exe
)
"%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" /s /v/qn
del "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe"

rem Install packer 0.5.1
if not exist %WORKDRIVE%\Packer\cache mkdir %WORKDRIVE%\Packer\cache
setx PACKER_CACHE_DIR %WORKDRIVE%\Packer\cache
set PACKER_CACHE_DIR=%WORKDRIVE%\Packer\cache
if not exist %WORKDRIVE%\Packer\temp mkdir %WORKDRIVE%\Packer\temp
setx PACKER_TEMP_DIR %WORKDRIVE%\Packer\temp
set PACKER_TEMP_DIR=%WORKDRIVE%\Packer\temp

rem call cinst packer
if exist C:\hashicorp\packer\packer.exe goto PACKER_INSTALLED
call wget --no-check-certificate https://dl.bintray.com/mitchellh/packer/0.5.1_windows_amd64.zip -O %TEMP%\0.5.1_windows_amd64.zip
mkdir C:\hashicorp\packer
cd /D C:\hashicorp\packer
7z x %TEMP%\0.5.1_windows_amd64.zip
cd /D %USERPROFILE%
rem :PACKER_INSTALLED
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

rem Install VirtualBox 4.3.6
if not exist "%USERPROFILE%\.VirtualBox\VirtualBox.xml" (
  mkdir "%USERPROFILE%\.VirtualBox"
  call wget --no-check-certificate https://github.com/StefanScherer/basebox-slave/raw/master/VirtualBox.xml -O "%USERPROFILE%\.VirtualBox\VirtualBox.xml"
)
call cinst virtualbox
if not exist %WORKDRIVE%\VirtualBox mkdir %WORKDRIVE%\VirtualBox
rem if exist "C:\program files\oracle\virtualbox\vboxmanage.exe" goto VIRTUALBOX_INSTALLED
rem wget http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-Win.exe -O %TEMP%\VirtualBox-4.3.6-91406-Win.exe
rem %TEMP%\VirtualBox-4.3.6-91406-Win.exe -s
:VIRTUALBOX_INSTALLED
where vboxmanage
if ERRORLEVEL 1 call :addVirtualBoxToUserPath
goto VIRTUALBOX_DONE
:addVirtualBoxToUserPath
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\oracle\virtualbox" /f
set PATH=%PATH%;C:\program files\oracle\virtualbox
exit /b
:VIRTUALBOX_DONE

rem Install Jenkins
rem wget http://mirrors.jenkins-ci.org/windows/latest -O %TEMP%\jenkins.zip
rem cd /D %TEMP%
rem unzip jenkins.zip
rem setup.exe -s

if not exist %WORKDRIVE%\GitHub mkdir %WORKDRIVE%\GitHub
cd /D %WORKDRIVE%\GitHub
if not exist basebox-packer (
  git clone https://github.com/StefanScherer/basebox-packer.git
) else (
  cd basebox-packer
  git pull
  cd ..
)

if not exist packer-windows (
  git clone -b san https://github.com/StefanScherer/packer-windows.git
) else (
  cd packer-windows
  git pull
  cd ..
)

if not exist basebox-slave (
  git clone https://github.com/StefanScherer/basebox-slave.git
) else (
  cd basebox-slave
  git pull
  cd ..
)

echo Install VMware PowerCLI...
if not exist "c:\Program Files (x86)\VMware\VMware VIX" (
  if not exist "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" (
    call wget -O "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" http://roecloudsrv001/vmware/powercli/VMware-PowerCLI-5.5.0-1295336.exe
  )
  powershell -Command "Import-Module ServerManager; Add-WindowsFeature NET-Framework-Features"
  "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" /s /v/qn /vADDLOCAL=ALL
  del "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe"
)

echo Install VMware Workstation...
rem Install VMware Workstation
if not exist "c:\Program Files (x86)\VMware\VMware Workstation" (
  if not exist "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" (
    call wget -O "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" http://roecloudsrv001/vmware/workstation10/VMware-workstation-full-10.0.0-1295980.exe
  )
  rem "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1 SERIALNUMBER="xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1
  del "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe"
)

rem put ovftool into path
where ovftool
if ERRORLEVEL 1 call :addOvftoolToUserPath
goto OVFTOOL_DONE
:addOvftoolToUserPath
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)\VMware\VMware Workstation\ovftool" /f
set PATH=%PATH%;c:\Program Files (x86)\VMware\VMware Workstation\ovftool
exit /b
:OVFTOOL_DONE

rem install addtime to measure time
call cinst strawberryperl
set PATH=%PATH%;c:\strawberry\perl\bin
wget --no-check-certificate -O c:\chocolatey\bin\addtime.bat https://github.com/StefanScherer/dotfiles-windows/raw/master/bin/addtime.bat

call cinst javaruntime
if not exist %WORKDRIVE%\jenkins mkdir %WORKDRIVE%\jenkins
if not exist %WORKDRIVE%\swarmclient mkdir %WORKDRIVE%\swarmclient
cd /D %WORKDRIVE%\swarmclient
call wget -O swarm-client.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.8/swarm-client-1.8-jar-with-dependencies.jar

set jenkinshost=10.115.4.8
net user swarmclient K8934jASD,x9  /ADD
net localgroup Administrators swarmclient /add
rem Due to problems with UDP broadcast, use the -master switch at the moment
rem Schedule start of swarm client at start of the machine (after next reboot)
schtasks /CREATE /SC ONSTART /RU swarmclient /RP K8934jASD,x9 /TN JenkinsSwarmClient /TR "java.exe -jar %WORKDRIVE%\swarmclient\swarm-client.jar -master http://%jenkinshost% -labels packer -fsroot %WORKDRIVE%\jenkins"

cd %WORKDRIVE%\GitHub\packer-windows
vagrant --version
packer --version
vboxmanage --version
ovftool -version

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

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'))"
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

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

call cinst vagrant
set PATH=%PATH%;%SystemDrive%\hashicorp\vagrant\bin
cd /D %USERPROFILE%\Documents

call cinst wget
call cinst 7zip
set PATH=%PATH%;C:\Program Files\7-Zip
call cinst vim
where gvim.exe
if ERRORLEVEL 1 call :addVimToUserPath
goto VIM_DONE
:addVimToUserPath
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 Fiels (x86)\vim\vim74" /f
set PATH=%PATH%;C:\Program Files (x86)\vim\vim74
exit /b
:VIM_DONE

call cinst msysgit
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd

rem install firefox and all plugins needed to access vCloud via browser
call cinst firefox
call cinst flashplayerplugin
if not exist "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" (
call wget -O "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" http://roecloudsrv001/vmware/clientintegrationplugin/VMware-ClientIntegrationPlugin-5.5.0.exe
)
"%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" /s /v/qn
del "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe"

rem Install packer 0.5.2
if not exist %WORKDRIVE%\Packer\cache mkdir %WORKDRIVE%\Packer\cache
setx PACKER_CACHE_DIR %WORKDRIVE%\Packer\cache
set PACKER_CACHE_DIR=%WORKDRIVE%\Packer\cache
if not exist %WORKDRIVE%\Packer\temp mkdir %WORKDRIVE%\Packer\temp
setx PACKER_TEMP_DIR %WORKDRIVE%\Packer\temp
set PACKER_TEMP_DIR=%WORKDRIVE%\Packer\temp

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

rem Install VirtualBox 4.3.6
if not exist "%USERPROFILE%\.VirtualBox\VirtualBox.xml" (
  mkdir "%USERPROFILE%\.VirtualBox"
  call wget --no-check-certificate https://github.com/StefanScherer/basebox-slave/raw/master/VirtualBox.xml -O "%USERPROFILE%\.VirtualBox\VirtualBox.xml"
)
call cinst virtualbox
if not exist %WORKDRIVE%\VirtualBox mkdir %WORKDRIVE%\VirtualBox
rem if exist "C:\program files\oracle\virtualbox\vboxmanage.exe" goto VIRTUALBOX_INSTALLED
rem wget http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-Win.exe -O %TEMP%\VirtualBox-4.3.6-91406-Win.exe
rem %TEMP%\VirtualBox-4.3.6-91406-Win.exe -s
:VIRTUALBOX_INSTALLED
where vboxmanage
if ERRORLEVEL 1 call :addVirtualBoxToUserPath
goto VIRTUALBOX_DONE
:addVirtualBoxToUserPath
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\oracle\virtualbox" /f
set PATH=%PATH%;C:\program files\oracle\virtualbox
exit /b
:VIRTUALBOX_DONE

rem Install Jenkins
rem wget http://mirrors.jenkins-ci.org/windows/latest -O %TEMP%\jenkins.zip
rem cd /D %TEMP%
rem unzip jenkins.zip
rem setup.exe -s

if not exist %WORKDRIVE%\GitHub mkdir %WORKDRIVE%\GitHub
cd /D %WORKDRIVE%\GitHub
if not exist basebox-packer (
  git clone https://github.com/StefanScherer/basebox-packer.git
) else (
  cd basebox-packer
  git pull
  cd ..
)

if not exist packer-windows (
  git clone -b san https://github.com/StefanScherer/packer-windows.git
) else (
  cd packer-windows
  git pull
  cd ..
)

if not exist basebox-slave (
  git clone https://github.com/StefanScherer/basebox-slave.git
) else (
  cd basebox-slave
  git pull
  cd ..
)

echo Install VMware PowerCLI...
if not exist "c:\Program Files (x86)\VMware\VMware VIX" (
  if not exist "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" (
    call wget -O "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" http://roecloudsrv001/vmware/powercli/VMware-PowerCLI-5.5.0-1295336.exe
  )
  powershell -Command "Import-Module ServerManager; Add-WindowsFeature NET-Framework-Features"
  "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" /s /v/qn /vADDLOCAL=ALL
  del "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe"
)

echo Install VMware Workstation...
rem Install VMware Workstation
if not exist "c:\Program Files (x86)\VMware\VMware Workstation" (
  if not exist "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" (
    call wget -O "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" http://roecloudsrv001/vmware/workstation10/VMware-workstation-full-10.0.0-1295980.exe
  )
  rem "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1 SERIALNUMBER="xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1
  del "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe"
)

rem put ovftool into path
where ovftool
if ERRORLEVEL 1 call :addOvftoolToUserPath
goto OVFTOOL_DONE
:addOvftoolToUserPath
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)\VMware\VMware Workstation\ovftool" /f
set PATH=%PATH%;c:\Program Files (x86)\VMware\VMware Workstation\ovftool
exit /b
:OVFTOOL_DONE

rem install addtime to measure time
call cinst strawberryperl
set PATH=%PATH%;c:\strawberry\perl\bin
wget --no-check-certificate -O c:\chocolatey\bin\addtime.bat https://github.com/StefanScherer/dotfiles-windows/raw/master/bin/addtime.bat

call cinst javaruntime
if not exist %WORKDRIVE%\jenkins mkdir %WORKDRIVE%\jenkins
if not exist %WORKDRIVE%\swarmclient mkdir %WORKDRIVE%\swarmclient
cd /D %WORKDRIVE%\swarmclient
call wget -O swarm-client.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.8/swarm-client-1.8-jar-with-dependencies.jar

set jenkinshost=10.115.4.8
net user swarmclient K8934jASD,x9  /ADD
net localgroup Administrators swarmclient /add
rem Due to problems with UDP broadcast, use the -master switch at the moment
rem Schedule start of swarm client at start of the machine (after next reboot)
schtasks /CREATE /SC ONSTART /RU swarmclient /RP K8934jASD,x9 /TN JenkinsSwarmClient /TR "java.exe -jar %WORKDRIVE%\swarmclient\swarm-client.jar -master http://%jenkinshost% -labels packer -fsroot %WORKDRIVE%\jenkins"

cd %WORKDRIVE%\GitHub\packer-windows
vagrant --version
packer --version
vboxmanage --version
ovftool -version

install packer 0.5.2

install packer 0.5.2


@echo off
setlocal
if not defined CacheDrive set CacheDrive=%~d0

reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /d "%~dp0Profile.cmd" /f

rem Search index: location is stored here
rem HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Databases\Windows
rem However, changing it directly & restarting service does not work

call :set_env_path NugetMachineInstallRoot %CacheDrive%\CoreXTCache
call :set_env_path ChocolateyInstall %CacheDrive%\Choco
call :set_env_path TMP %CacheDir%\OS_FILES\OS_TMP /M
call :set_env_path TMP %CacheDir%\OS_FILES\%USERNAME%_TMP
call :set_env_path TEMP %CacheDir%\OS_FILES\%USERNAME%_TMP

call :ensure_exists %CacheDrive%\symbols
setx _NT_SYMBOL_PATH cache*%CacheDrive%\symbols;SRV*http://msdl.microsoft.com/download/symbols;SRV*http://symweb

call "%~dp0CreateShortcuts.cmd"
call "%~dp0ConsoleSetup.cmd"

goto :eof

:ensure_exists
	if not exist %1 mkdir %1
	goto :eof

:set_env_path
	call :ensure_exists %2 || exit /b 1
	echo Creating env var %1=%2
	setx %1 %2 %3
	goto :eof

@echo off
setlocal
if not defined CacheDrive set CacheDrive=%~d0

reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /d "%~dp0Profile.cmd" /f

rem Search index: location is stored here
rem HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Databases\Windows
rem However, changing it directly & restarting service does not work

call :set_env_path NugetMachineInstallRoot %CacheDrive%\CoreXTCache
call :set_env_path ChocolateyInstall %CacheDrive%\Choco
call :set_env_path TMP %CacheDrive%\OS_FILES\OS_TMP /M
call :set_env_path TEMP %CacheDrive%\OS_FILES\OS_TMP /M

call :set_env_path TMP %CacheDrive%\OS_FILES\%USERNAME%_TMP
call :set_env_path TEMP %CacheDrive%\OS_FILES\%USERNAME%_TMP

call :ensure_exists %CacheDrive%\symbols
setx _NT_SYMBOL_PATH cache*%CacheDrive%\symbols;SRV*http://msdl.microsoft.com/download/symbols;SRV*http://symweb

call "%~dp0CreateShortcuts.cmd"
call "%~dp0ConsoleSetup.cmd"

goto :eof

:ensure_exists
	if not exist %1 mkdir %1
	goto :eof

:set_env_path
	call :ensure_exists %2 || exit /b 1
	echo Creating env var %1=%2
	setx %1 %2 %3
	goto :eof

fix typo

fix typo


python ../src/python/runner.py 5555 WINDOWS firefox 43.0
python ../src/python/runner.py 5555 WINDOWS chrome 48.0
python ../src/python/runner.py 5555 WINDOWS MicrosoftEdge 11
python ../src/python/runner.py 5555 LINUX chrome 47
python ../src/python/runner.py 5555 LINUX firefox 42

python ../src/python/grid_test.py 5555 WINDOWS firefox 43.0
python ../src/python/grid_test.py 5555 WINDOWS chrome 48.0
python ../src/python/grid_test.py 5555 WINDOWS MicrosoftEdge 11

update run_test bat

update run_test bat


add escape code color

add escape code color


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

if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware

rem default is vmware
rem rem goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.1/4542065/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.26/VBoxGuestAdditions_5.0.26.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

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

if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware

rem default is vmware
rem rem goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.1/4542065/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.1.8/VBoxGuestAdditions_5.1.8.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

Update VirtualBox guest additions 5.1.8

Update VirtualBox guest additions 5.1.8


@echo off
if not "%~1"=="" call :Elevate %* 2>"%Temp%\%~n0.log" && exit /b || ( call :Error & exit /b )
call :IsAdmin && ( call :Futile & exit /b )
call :ElevateMe 2>"%Temp%\%~n0.log" || ( call :Error & exit /b )
exit /b
:Elevate <Executable> [Arguments]
setlocal DisableDelayedExpansion
PowerShell -NoProfile -ExecutionPolicy RemoteSigned -Command "$0 = '%1'; $cl = '%*'; $ar = $cl.Substring($0.Length); if (![bool]$ar) {$ar = ' '}; start $0.Trim([char]0x22) -Verb runas -ArgumentList $ar -WorkingDirectory (cvpa .); exit(!$?);"
endlocal
exit /b
:ElevateMe
:: ElevateMe does not work from inside cmd.exe due to batch files running in the same process, causing the grand parent to be elevated.  Can work for cmd and powershell, or for everything bug cmd. if ( $parent.ExecutablePath -like '*cmd.exe' ) { $gparent = $parent } else { ... }
setlocal DisableDelayedExpansion
PowerShell -NoProfile -ExecutionPolicy RemoteSigned -Command "gwmi -Class Win32_Process -Filter ('ProcessId = ' + $pid) | foreach { $parent = gwmi -Class Win32_Process -Filter ('ProcessId = ' + $_.ParentProcessId)}; $gparent = gwmi -Class Win32_Process -Filter ('ProcessId = ' + $parent.ParentProcessId); if ( $gparent.CommandLine.Length -gt $gparent.ExecutablePath.Length ) { $args = ($gparent.CommandLine.Trim().Trim([char]0x22)).Substring($gparent.ExecutablePath.Length) }; if ( $var -eq $null ) { $args = ' ' }; start $gparent.ExecutablePath -Verb runas -ArgumentList $args -WorkingDirectory (cvpa .); exit(!$?);"
:: TODO if failed, Attempt elevate with execution path
endlocal
exit /b
:Error
echo.Failed to elevate with Administrator privileges
echo.See "%Temp%\%~n0.log" for details.
echo.If attempting to elevate cmd.exe, use: 'elevate cmd'
exit /b
:Futile
echo.Session already has Administrator privileges
exit /b
:IsAdmin
setlocal DisableDelayedExpansion
PowerShell -NoProfile -ExecutionPolicy RemoteSigned -Command "exit(!(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator));"
endlocal
exit /b

@echo off
if not "%~1"=="" call :Elevate %* 2>"%Temp%\%~n0.log" && exit /b || ( call :Error & exit /b )
call :IsAdmin && ( call :Futile & exit /b )
call :ElevateMe 2>"%Temp%\%~n0.log" || ( call :Error & exit /b )
exit /b
:Elevate <Executable> [Arguments]
setlocal DisableDelayedExpansion
PowerShell -NoProfile -ExecutionPolicy RemoteSigned -Command "$0 = '%1'; $cl = '%*'; $ar = $cl.Substring($0.Length); if (![bool]$ar) {$ar = ' '}; start $0.Trim([char]0x22) -Verb runas -ArgumentList $ar -WorkingDirectory (cvpa .); exit(!$?);"
endlocal
exit /b
:ElevateMe
:: ElevateMe does not work from inside cmd.exe due to batch files running in the same process, causing the grand parent to be elevated.  Can work for cmd and powershell using: if ( $parent.ExecutablePath -like '*cmd.exe' ) { $gparent = $parent } else { ... }.  However, default is to support everything but cmd.
setlocal DisableDelayedExpansion
PowerShell -NoProfile -ExecutionPolicy RemoteSigned -Command "gwmi -Class Win32_Process -Filter ('ProcessId = ' + $pid) | foreach { $parent = gwmi -Class Win32_Process -Filter ('ProcessId = ' + $_.ParentProcessId)}; $gparent = gwmi -Class Win32_Process -Filter ('ProcessId = ' + $parent.ParentProcessId); if ( $gparent.CommandLine.Length -gt $gparent.ExecutablePath.Length ) { $args = ($gparent.CommandLine.Trim().Trim([char]0x22)).Substring($gparent.ExecutablePath.Length) }; if ( $var -eq $null ) { $args = ' ' }; start $gparent.ExecutablePath -Verb runas -ArgumentList $args -WorkingDirectory (cvpa .); exit(!$?);"
:: TODO if failed, Attempt elevate with execution path
endlocal
exit /b
:Error
echo.Failed to elevate with Administrator privileges
echo.See "%Temp%\%~n0.log" for details.
echo.If attempting to elevate cmd.exe, use: 'elevate cmd'
exit /b
:Futile
echo.Session already has Administrator privileges
exit /b
:IsAdmin
setlocal DisableDelayedExpansion
PowerShell -NoProfile -ExecutionPolicy RemoteSigned -Command "exit(!(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator));"
endlocal
exit /b

improve comment

improve comment


pushd "%~dp0"
go run importconst.go -p dos ^
	FILE_ATTRIBUTE_NORMAL ^
	FILE_ATTRIBUTE_REPARSE_POINT ^
	FILE_ATTRIBUTE_HIDDEN ^
	FILE_ATTRIBUTE_READONLY ^
	FILE_ATTRIBUTE_SYSTEM ^
	FILE_ATTRIBUTE_ARCHIVE ^
	CP_THREAD_ACP ^
	MOVEFILE_REPLACE_EXISTING ^
	MOVEFILE_COPY_ALLOWED ^
	MOVEFILE_WRITE_THROUGH ^
	SW_HIDE ^
	SW_MAXIMIZE ^
	SW_MINIMIZE ^
	SW_RESTORE ^
	SW_SHOW ^
	SW_SHOWDEFAULT ^
	SW_SHOWMAXIMIZED ^
	SW_SHOWMINIMIZED ^
	SW_SHOWMINNOACTIVE ^
	SW_SHOWNA ^
	SW_SHOWNOACTIVATE ^
	SW_SHOWNORMAL ^
	COINIT_APARTMENTTHREADED ^
	COINIT_MULTITHREADED ^
	COINIT_DISABLE_OLE1DDE ^
	COINIT_SPEED_OVER_MEMORY ^
	DRIVE_UNKNOWN ^
	DRIVE_NO_ROOT_DIR ^
	DRIVE_REMOVABLE ^
	DRIVE_FIXED ^
	DRIVE_REMOTE ^
	DRIVE_CDROM ^
	DRIVE_RAMDISK ^
	RESOURCE_CONNECTED ^
	RESOURCE_CONTEXT ^
	RESOURCE_GLOBALNET ^
	RESOURCE_REMEMBERED ^
	RESOURCETYPE_ANY ^
	RESOURCETYPE_DISK ^
	RESOURCETYPE_PRINT ^
	RESOURCEDISPLAYTYPE_NETWORK ^
	RESOURCEUSAGE_CONNECTABLE ^
	RESOURCEUSAGE_CONTAINER ^
	RESOURCEUSAGE_ATTACHED ^
	RESOURCEUSAGE_ALL ^
	NO_ERROR ^
	ERROR_NOT_CONTAINER ^
	ERROR_INVALID_PARAMETER ^
	ERROR_NO_NETWORK ^
	ERROR_EXTENDED_ERROR ^
	ERROR_NO_MORE_ITEMS ^
	ERROR_MORE_DATA
popd

pushd "%~dp0"
go run importconst.go -p dos ^
	FILE_ATTRIBUTE_NORMAL ^
	FILE_ATTRIBUTE_REPARSE_POINT ^
	FILE_ATTRIBUTE_HIDDEN ^
	FILE_ATTRIBUTE_READONLY ^
	FILE_ATTRIBUTE_SYSTEM ^
	FILE_ATTRIBUTE_ARCHIVE ^
	CP_THREAD_ACP ^
	SW_HIDE ^
	SW_MAXIMIZE ^
	SW_MINIMIZE ^
	SW_RESTORE ^
	SW_SHOW ^
	SW_SHOWDEFAULT ^
	SW_SHOWMAXIMIZED ^
	SW_SHOWMINIMIZED ^
	SW_SHOWMINNOACTIVE ^
	SW_SHOWNA ^
	SW_SHOWNOACTIVATE ^
	SW_SHOWNORMAL ^
	COINIT_APARTMENTTHREADED ^
	COINIT_MULTITHREADED ^
	COINIT_DISABLE_OLE1DDE ^
	COINIT_SPEED_OVER_MEMORY ^
	RESOURCE_CONNECTED ^
	RESOURCE_CONTEXT ^
	RESOURCE_GLOBALNET ^
	RESOURCE_REMEMBERED ^
	RESOURCETYPE_ANY ^
	RESOURCETYPE_DISK ^
	RESOURCETYPE_PRINT ^
	RESOURCEDISPLAYTYPE_NETWORK ^
	RESOURCEUSAGE_CONNECTABLE ^
	RESOURCEUSAGE_CONTAINER ^
	RESOURCEUSAGE_ATTACHED ^
	RESOURCEUSAGE_ALL ^
	NO_ERROR ^
	ERROR_NOT_CONTAINER ^
	ERROR_INVALID_PARAMETER ^
	ERROR_NO_NETWORK ^
	ERROR_EXTENDED_ERROR ^
	ERROR_NO_MORE_ITEMS ^
	ERROR_MORE_DATA
popd

remove unused constants.

dos/makeconst.cmd: remove unused constants.


setlocal
call settings.bat

call fetch.bat http://sourceforge.net/projects/winflexbison/files/win_flex_bison-latest.zip .
echo Unpacking binaries...
7z x win_flex_bison-latest.zip data win_flex.exe win_bison.exe
echo Moving binaries to %PREFIX%\bin
move win_flex.exe %PREFIX%\bin
move win_bison.exe %PREFIX%\bin
move data %PREFIX%\bin

cd ..

setlocal
call settings.bat

call fetch.bat http://sourceforge.net/projects/winflexbison/files/win_flex_bison-latest.zip .
echo Unpacking binaries...
7z x win_flex_bison-latest.zip data win_flex.exe win_bison.exe
echo Moving binaries to %PREFIX%\bin
move win_flex.exe %PREFIX%\bin
move win_bison.exe %PREFIX%\bin
move data %PREFIX%\bin
copy %PREFIX%\bin\win_flex.exe %PREFIX%\bin\flex.exe
copy %PREFIX%\bin\win_bison.exe %PREFIX%\bin\bison.exe

cd ..

copy flex/bison

copy flex/bison


Add ngserve.cmd (for port 4200)

Add ngserve.cmd (for port 4200)


:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0"\"node.exe" (
  "%~dp0"\"node.exe"  "%~dp0\..\marked\bin\marked" %*
) ELSE (
  node  "%~dp0\..\marked\bin\marked" %*
)

Add marked windows command

Add marked windows command


@echo off
@setlocal

set RoslynRoot=%~dp0
set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%RoslynRoot%nuget.config" -Project2ProjectTimeOut 1200

:ParseArguments
if /I "%1" == "/?" goto :Usage
if /I "%1" == "/clean" set RestoreClean=true&&shift&& goto :ParseArguments
if /I "%1" == "/fast" set RestoreFast=true&&shift&& goto :ParseArguments
goto :DoneParsing

:DoneParsing

REM Allow for alternate solutions to be passed as restore targets.
set RoslynSolution=%1
if "%RoslynSolution%" == "" set RoslynSolution=%RoslynRoot%\Roslyn.sln

REM Load in the inforation for NuGet
call "%RoslynRoot%build\scripts\LoadNuGetInfo.cmd" || goto :LoadNuGetInfoFailed

if "%RestoreClean%" == "true" (
    echo Clearing the NuGet caches
    call %NugetExe% locals all -clear || goto :CleanFailed
)

if "%RestoreFast%" == "" (
    echo Deleting project.lock.json files
    pushd "%RoslynRoot%src"
    echo "Dummy lock file to avoid error when there is no project.lock.json file" > project.lock.json
    del /s /q project.lock.json
    popd
)

echo Restoring packages: Toolsets
call %NugetExe% restore "%RoslynRoot%build\ToolsetPackages\project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Toolsets (Dev14 VS SDK build tools)
call %NugetExe% restore "%RoslynRoot%build\ToolsetPackages\dev14.project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Toolsets (Dev15 VS SDK build tools)
call %NugetExe% restore "%RoslynRoot%build\ToolsetPackages\dev15.project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Roslyn SDK
call %NugetExe% restore "%RoslynRoot%build\ToolsetPackages\roslynsdk.project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Samples
call %NugetExe% restore "%RoslynRoot%src\Samples\Samples.sln" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Templates
call %NugetExe% restore "%RoslynRoot%src\Setup\Templates\Templates.sln" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Roslyn (this may take some time)
call %NugetExe% restore "%RoslynSolution%" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

exit /b 0

:CleanFailed
echo Clean failed with ERRORLEVEL %ERRORLEVEL%
exit /b 1

:RestoreFailed
echo Restore failed with ERRORLEVEL %ERRORLEVEL%
exit /b 1

:LoadNuGetInfoFailed
echo Error loading NuGet.exe information %ERRORLEVEL%
exit /b 1

:Usage
@echo Usage: Restore.cmd /clean [Solution File]
exit /b 1

@echo off
@setlocal

set RoslynRoot=%~dp0
set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%RoslynRoot%nuget.config" -Project2ProjectTimeOut 1200

:ParseArguments
if /I "%1" == "/?" goto :Usage
if /I "%1" == "/clean" set RestoreClean=true&&shift&& goto :ParseArguments
if /I "%1" == "/fast" set RestoreFast=true&&shift&& goto :ParseArguments
goto :DoneParsing

:DoneParsing

REM Allow for alternate solutions to be passed as restore targets.
set RoslynSolution=%1
if "%RoslynSolution%" == "" set RoslynSolution=%RoslynRoot%\Roslyn.sln

REM Load in the inforation for NuGet
call "%RoslynRoot%build\scripts\LoadNuGetInfo.cmd" || goto :LoadNuGetInfoFailed

if "%RestoreClean%" == "true" (
    echo Clearing the NuGet caches
    call "%NugetExe%" locals all -clear || goto :CleanFailed
)

if "%RestoreFast%" == "" (
    echo Deleting project.lock.json files
    pushd "%RoslynRoot%src"
    echo "Dummy lock file to avoid error when there is no project.lock.json file" > project.lock.json
    del /s /q project.lock.json
    popd
)

echo Restoring packages: Toolsets
call "%NugetExe%" restore "%RoslynRoot%build\ToolsetPackages\project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Toolsets (Dev14 VS SDK build tools)
call "%NugetExe%" restore "%RoslynRoot%build\ToolsetPackages\dev14.project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Toolsets (Dev15 VS SDK build tools)
call "%NugetExe%" restore "%RoslynRoot%build\ToolsetPackages\dev15.project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Roslyn SDK
call "%NugetExe%" restore "%RoslynRoot%build\ToolsetPackages\roslynsdk.project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Samples
call "%NugetExe%" restore "%RoslynRoot%src\Samples\Samples.sln" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Templates
call "%NugetExe%" restore "%RoslynRoot%src\Setup\Templates\Templates.sln" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

echo Restoring packages: Roslyn (this may take some time)
call "%NugetExe%" restore "%RoslynSolution%" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed

exit /b 0

:CleanFailed
echo Clean failed with ERRORLEVEL %ERRORLEVEL%
exit /b 1

:RestoreFailed
echo Restore failed with ERRORLEVEL %ERRORLEVEL%
exit /b 1

:LoadNuGetInfoFailed
echo Error loading NuGet.exe information %ERRORLEVEL%
exit /b 1

:Usage
@echo Usage: Restore.cmd /clean [Solution File]
exit /b 1

Fix restore when run from repo with spaces


mkdir "%SRC_DIR%"\build
pushd "%SRC_DIR%"\build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"  -DBUILD_PYTHON_INTERFACE=ON -G "Ninja" ..
ninja
ninja install
popd

if %PY3K% equ 1 (
  set BUILD_PYTHON="-DBUILD_PYTHON_INTERFACE=ON"
) else (
  set BUILD_PYTHON="-DBUILD_PYTHON2_INTERFACE=ON"
)

mkdir "%SRC_DIR%"\build
pushd "%SRC_DIR%"\build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" %BUILD_PYTHON%" -G "Ninja" ..
ninja
ninja install

move %LIBRARY_PREFIX%\python\_helics.pyd %SP_DIR%
move %LIBRARY_PREFIX%\python\helics.py %SP_DIR%

popd

Make bld.bat work for both Py2 and Py3 and add install to site packages


Update build.bat

Update build.bat


%PYTHON%   setup.py ^
           install

Update build.bat

Update build.bat


@echo off
if "%1" == "" echo "plz input a file path" && exit
if not exist %1 echo "%1 not exist" && exit

set base=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\bin
"%base%\makecert.exe" -a sha512 -r -n "CN=Greedysky studio" -b 01/01/2016 -e 12/31/2019 -sv %temp%\CbipSetupKey.pvk %temp%\CbipSetupKey.cer
"%base%\cert2spc.exe" %temp%\CbipSetupKey.cer %temp%\CbipSetupKey.spc
"%base%\pvk2pfx.exe" -pvk %temp%\CbipSetupKey.pvk -spc %temp%\CbipSetupKey.spc -f -pfx %userprofile%\Desktop\TTKMusicplayer.pfx
"%base%\signtool.exe" sign /f %userprofile%\Desktop\TTKMusicplayer.pfx  /t "http://timestamp.verisign.com/scripts/timstamp.dll" /d "" %1
del %temp%\CbipSetupKey.* >nul 2>nul
del %userprofile%\Desktop\TTKMusicplayer.pfx >nul 2>nul

update make cert script[147851]

update make cert script[147851]


rem Building & compressing serve-d for release inside a virtual machine with Windows 8 or above
rem This will delete the folder C:\build

del /S /Q C:\build
xcopy /e . C:\build
pushd C:\build
set /p Version=<version.txt
dub build --compiler=ldc2 --arch=x86
echo Y | del windows
mkdir windows
echo F | xcopy /f serve-d.exe windows\serve-d.exe
echo F | xcopy /f libcurl.dll windows\libcurl.dll
echo F | xcopy /f libeay32.dll windows\libeay32.dll
echo F | xcopy /f ssleay32.dll windows\ssleay32.dll
del C:\build\windows.zip
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('windows', 'windows.zip'); }"
popd
echo F | xcopy C:\build\windows.zip serve-d-%Version%-windows.zip
pause

rem Building & compressing serve-d for release inside a virtual machine with Windows 8 or above

cd %~dp0

@if not exist version.txt (
	echo.
    echo !-- Error: version.txt is missing :/
    echo.
    pause
    goto :eof
)

rem This will sync this repo with the folder %windir%\..\buildsd
robocopy . %windir%\..\buildsd /MIR /XA:SH /XD .* /XF .* /XF *.zip
pushd %windir%\..\buildsd

set /p Version=<version.txt
dub build --compiler=ldc2 --arch=x86

if exist windows del /S /Q windows
mkdir windows
copy serve-d.exe windows\serve-d.exe
copy libcurl.dll windows\libcurl.dll
copy libeay32.dll windows\libeay32.dll
copy ssleay32.dll windows\ssleay32.dll

if exist windows.zip del windows.zip
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('windows', 'windows.zip'); }"
popd

move %windir%\..\buildsd\windows.zip "serve-d-%Version%-windows.zip"
pause

Improve windows build script

Improve windows build script

Get rid of locale-dependent commands
Change build dir and make it relative to %windir%
Sync build dir instead of delete+copy
Move output zip instead of copying it