@echo off
setlocal

if "%~1"=="-?" goto help
if "%~1"=="/?" goto help

if /i "%PROCESSOR_ARCHITECTURE%"=="amd64" call %SystemRoot%\SysWow64\cmd.exe /C "%~dpf0" %* & goto eof
if /i NOT "%PROCESSOR_ARCHITECTURE%"=="x86" echo ERROR: Unsupported processor - script should only be run on an x86 or x64 OS & exit /b -1

REM make sure we are elevated
net session >nul 2>&1
if NOT "%ERRORLEVEL%"=="0" echo ERROR: Must be called from an elevated command prompt.& exit /b -1

set VSVersion=14.0
set BackupDir=%LOCALAPPDATA%\Microsoft\VisualStudio\%VSVersion%\MDDDebuggerBackup\
set MDDDebuggerDir=%ProgramFiles%\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\MDD\Debugger\
if not exist "%MDDDebuggerDir%" echo ERROR: Dev14 C++ MDD Tools are not installed on this computer.& exit /b -1

set FilesToInstall=Microsoft.MICore.dll Microsoft.MIDebugEngine.dll Microsoft.MIDebugEngine.pkgdef Microsoft.MIDebugPackage.dll Microsoft.MIDebugPackage.pkgdef Microsoft.AndroidDebugLauncher.dll Microsoft.AndroidDebugLauncher.pkgdef Microsoft.IOSDebugLauncher.dll Microsoft.IOSDebugLauncher.pkgdef Microsoft.JDbg.dll

if "%~1"=="/restore" goto RestoreBackup

goto Backup

:Backup
if exist "%BackupDir%" goto InstallFiles
echo INFO: Backing up MDD Debugger to '%BackupDir%'.
mkdir "%BackupDir%"
set CopyError=
for /f %%f in ('dir /b "%MDDDebuggerDir%"') do call :CopyFile "%MDDDebuggerDir%\%%f" "%BackupDir%"
if NOT "%CopyError%"=="" echo ERROR: Failed to backup one or more files& echo.& exit /b -1
rem clean all files after backup
call :CleanDebuggerDir
goto InstallFiles

:RestoreBackup
if not exist "%BackupDir%" echo ERROR: No backup exists.& exit /b -1
echo Restoring from backup
call :CleanDebuggerDir
set CopyError=
for /f %%f in ('dir /b "%BackupDir%"') do call :CopyFile "%BackupDir%\%%f" "%MDDDebuggerDir%"
if NOT "%CopyError%"=="" echo ERROR: Failed to restore one or more files& echo.& exit /b -1
call :DeleteConfigRegistry

echo MDD Debugger succesfully restored from backup

goto eof

:InstallFiles
echo Installing Files
set CopyError=
for %%f in (%FilesToInstall%) do call :CopyFile "%~dp0%%f" "%MDDDebuggerDir%"
if NOT "%CopyError%"=="" echo ERROR: Failed to install one or more files& echo.& exit /b -1

call :DeleteConfigRegistry

echo MDD Debugger succesfully installed

goto eof

rem %1 is file %2 is dest dir
rem both must be quoted prior to calling copy file
:CopyFile
echo copy %1 %2
copy /y %1 %2
if NOT "%ERRORLEVEL%"=="0" set CopyError=1
goto eof

:DeleteConfigRegistry
reg delete HKCU\Software\Microsoft\VisualStudio\%VSVersion%_Config /f
goto eof

:CleanDebuggerDir
pushd %MDDDebuggerDir%
for %%f in (*) do del %%f
popd
goto eof

:help
echo Install.cmd [^/restore]
echo.
echo This script should be run on the test machine and it updates the MDD debugger
echo bits to bits from the directory where the script is.
echo.

:eof

@echo off
setlocal

if "%~1"=="-?" goto help
if "%~1"=="/?" goto help

if /i "%PROCESSOR_ARCHITECTURE%"=="amd64" call %SystemRoot%\SysWow64\cmd.exe /C "%~dpf0" %* & goto eof
if /i NOT "%PROCESSOR_ARCHITECTURE%"=="x86" echo ERROR: Unsupported processor - script should only be run on an x86 or x64 OS & exit /b -1

REM make sure we are elevated
net session >nul 2>&1
if NOT "%ERRORLEVEL%"=="0" echo ERROR: Must be called from an elevated command prompt.& exit /b -1

if NOT exist "%ProgramFiles%\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" echo ERROR: Visual Studio 2015 is not installed, or is not installed to the default location.& exit /b -1

set VSVersion=14.0
set BackupDir=%LOCALAPPDATA%\Microsoft\VisualStudio\%VSVersion%\MDDDebuggerBackup\
set MDDDebuggerDir=%ProgramFiles%\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\MDD\Debugger\

set FilesToInstall=Microsoft.MICore.dll Microsoft.MIDebugEngine.dll Microsoft.MIDebugEngine.pkgdef Microsoft.MIDebugPackage.dll Microsoft.MIDebugPackage.pkgdef Microsoft.AndroidDebugLauncher.dll Microsoft.AndroidDebugLauncher.pkgdef Microsoft.IOSDebugLauncher.dll Microsoft.IOSDebugLauncher.pkgdef Microsoft.JDbg.dll

if "%~1"=="/restore" goto RestoreBackup

goto Backup

:Backup
if exist "%BackupDir%" goto InstallFiles
if not exist "%MDDDebuggerDir%" goto InstallFiles
echo INFO: Backing up MDD Debugger to '%BackupDir%'.
mkdir "%BackupDir%"
set CopyError=
for /f %%f in ('dir /b "%MDDDebuggerDir%"') do call :CopyFile "%MDDDebuggerDir%\%%f" "%BackupDir%"
if NOT "%CopyError%"=="" echo ERROR: Failed to backup one or more files& echo.& exit /b -1
rem clean all files after backup
call :CleanDebuggerDir
goto InstallFiles

:RestoreBackup
if not exist "%BackupDir%" echo ERROR: No backup exists.& exit /b -1
if not exist "%MDDDebuggerDir%" mkdir "%MDDDebuggerDir%"
echo Restoring from backup
call :CleanDebuggerDir
set CopyError=
for /f %%f in ('dir /b "%BackupDir%"') do call :CopyFile "%BackupDir%\%%f" "%MDDDebuggerDir%"
if NOT "%CopyError%"=="" echo ERROR: Failed to restore one or more files& echo.& exit /b -1
call :DeleteConfigRegistry

echo MDD Debugger succesfully restored from backup

goto eof

:InstallFiles
if not exist "%MDDDebuggerDir%" mkdir "%MDDDebuggerDir%"
echo Installing Files
set CopyError=
for %%f in (%FilesToInstall%) do call :CopyFile "%~dp0%%f" "%MDDDebuggerDir%"
if NOT "%CopyError%"=="" echo ERROR: Failed to install one or more files& echo.& exit /b -1

call :DeleteConfigRegistry

echo MDD Debugger succesfully installed

goto eof

rem %1 is file %2 is dest dir
rem both must be quoted prior to calling copy file
:CopyFile
echo copy %1 %2
copy /y %1 %2
if NOT "%ERRORLEVEL%"=="0" set CopyError=1
goto eof

:DeleteConfigRegistry
reg delete HKCU\Software\Microsoft\VisualStudio\%VSVersion%_Config /f >nul 2>&1
goto eof

:CleanDebuggerDir
pushd %MDDDebuggerDir%
for %%f in (*) do del %%f
popd
goto eof

:help
echo Install.cmd [^/restore]
echo.
echo This script should be run on the test machine and it updates the MDD debugger
echo bits to bits from the directory where the script is.
echo.

:eof

Modify install.cmd to work without the C++MDD tools

This checkin modifies install.cmd so that it can still work even if the C++ MDD tools aren't installed. This is useful when using the MIEngine for things outside of the C++ MDD scenario.


@echo off

call "%~dp0lib_base.cmd"
call "%%~dp0lib_console.cmd"
set lib_git=call "%~dp0lib_git.cmd"

if "%~1" == "/h" (
    %lib_base% help "%~0"
) else if "%1" neq "" (
    call :%*
)

exit /b

:read_version
:::===============================================================================
:::read_version - Get the git.exe verion
:::.
:::include:
:::.
:::  call "lib_git.cmd"
:::.
:::usage:
:::.
:::  %lib_git% read_version "[dir_path]"
:::.
:::required:
:::.
:::  [GIT SCOPE]   <in> USER | VENDORED
:::  [GIT PATH]    <in> Fully qualified path to the Git command root.
:::.
:::output:
:::.
:::  GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
:::-------------------------------------------------------------------------------

    :: clear the variables
    set GIT_VERSION_%~1=

    :: set the executable path
    set "git_executable=%~2\git.exe"
    %lib_console% debug_output :read_version "Env Var - git_executable=%git_executable%"

    :: check if the executable actually exists
    if not exist "%git_executable%" (
        %lib_console% debug_output :read_version "%git_executable% does not exist."
        exit /b -255
    )

    :: get the git version in the provided directory

    "%git_executable%" --version > "%temp%\git_version.txt"
    setlocal enabledelayedexpansion
    for /F "tokens=1,2,3 usebackq" %%A in (`type "%temp%\git_version.txt" 2^>nul`) do (
        if /i "%%A %%B" == "git version" (
            set "GIT_VERSION=%%C"
        ) else (
            echo "'git --version' returned an inproper version string!"
            pause
            exit /b
        )
    )
    endlocal & set "GIT_VERSION_%~1=%GIT_VERSION%" & %lib_console% debug_output :read_version "Env Var - GIT_VERSION_%~1=%GIT_VERSION%"

    exit /b

:parse_version
:::===============================================================================
:::parse_version - Parse semantic version string 'x.x.x.x' and return the pieces
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% parse_version "[VERSION]"
:::.
:::required:
:::.
:::  [SCOPE]     <in> USER | VENDORED
:::  [VERSION]   <in> Semantic version String. Ex: 1.2.3.4
:::.
:::output:
:::.
:::  [SCOPE]_MAJOR <out> Scoped Major version.
:::  [SCOPE]_MINOR <out> Scoped Minor version.
:::  [SCOPE]_PATCH <out> Scoped Patch version.
:::  [SCOPE]_BUILD <out> Scoped Build version.
:::-------------------------------------------------------------------------------

    :: process a `x.x.x.xxxx.x` formatted string
    %lib_console% debug_output :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"

    setlocal enabledelayedexpansion
    for /F "tokens=1-3* delims=.,-" %%A in ("%2") do (
        set "%~1_MAJOR=%%A"
        set "%~1_MINOR=%%B"
        set "%~1_PATCH=%%C"
        set "%~1_BUILD=%%D"
    )

    REM endlocal & set "%~1_MAJOR=!%~1_MAJOR!" & set "%~1_MINOR=!%~1_MINOR!" & set "%~1_PATCH=!%~1_PATCH!" & set "%~1_BUILD=!%~1_BUILD!"
    if "%~1" == "VENDORED" (
      endlocal & set "%~1_MAJOR=%VENDORED_MAJOR%" & set "%~1_MINOR=%VENDORED_MINOR%" & set "%~1_PATCH=%VENDORED_PATCH%" & set "%~1_BUILD=%VENDORED_BUILD%"
    ) else (
      endlocal & set "%~1_MAJOR=%USER_MAJOR%" & set "%~1_MINOR=%USER_MINOR%" & set "%~1_PATCH=%USER_PATCH%" & set "%~1_BUILD=%USER_BUILD%"
    )

    exit /b

:endlocal_set_git_version

:validate_version
:::===============================================================================
:::validate_version - Validate semantic version string 'x.x.x.x'.
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% validate_version [SCOPE] [VERSION]
:::.
:::required:
:::.
:::  [SCOPE]     <in> Example:  USER | VENDORED
:::  [VERSION]   <in> Semantic version String. Ex: 1.2.3.4
:::-------------------------------------------------------------------------------

    :: now parse the version information into the corresponding variables
    %lib_console% debug_output :validate_version "ARGV[1]=%~1, ARGV[2]=%~2"

    call :parse_version %~1 %~2

    :: ... and maybe display it, for debugging purposes.
    REM %lib_console% debug_output :validate_version "Found Git Version for %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!"
    if "%~1" == "VENDORED" (
      %lib_console% debug_output :validate_version "Found Git Version for %~1: %VENDORED_MAJOR%.%VENDORED_MINOR%.%VENDORED_PATCH%.%VENDORED_BUILD%"
    ) else (
      %lib_console% debug_output :validate_version "Found Git Version for %~1: %USER_MAJOR%.%USER_MINOR%.%USER_PATCH%.%USER_BUILD%"
    )
    exit /b

:compare_versions
:::===============================================================================
:::compare_version - Compare semantic versions return latest version.
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% validate_version [SCOPE1] [SCOPE2]
:::.
:::required:
:::.
:::  [SCOPE1]    <in> Example: USER
:::  [SCOPE2]    <in> Example: VENDOR
:::-------------------------------------------------------------------------------

    :: checks all major, minor, patch and build variables for the given arguments.
    :: whichever binary that has the most recent version will be used based on the return code.

    %lib_console% debug_output Comparing:
    %lib_console% debug_output %~1: %USER_MAJOR%.%USER_MINOR%.%USER_PATCH%.%USER_BUILD%
    %lib_console% debug_output %~2: %VENDORED_MAJOR%.%VENDORED_MINOR%.%VENDORED_PATCH%.%VENDORED_BUILD%

    setlocal enabledelayedexpansion
    if !%~1_MAJOR! GTR !%~2_MAJOR! (endlocal & exit /b  1)
    if !%~1_MAJOR! LSS !%~2_MAJOR! (endlocal & exit /b -1)

    if !%~1_MINOR! GTR !%~2_MINOR! (endlocal & exit /b  1)
    if !%~1_MINOR! LSS !%~2_MINOR! (endlocal & exit /b -1)

    if !%~1_PATCH! GTR !%~2_PATCH! (endlocal & exit /b  1)
    if !%~1_PATCH! LSS !%~2_PATCH! (endlocal & exit /b -1)

    if !%~1_BUILD! GTR !%~2_BUILD! (endlocal & exit /b  1)
    if !%~1_BUILD! LSS !%~2_BUILD! (endlocal & exit /b -1)

    :: looks like we have the same versions.
    endlocal & exit /b 0

:::===============================================================================
:::is_git_shim
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% is_git_shim [filepath]
:::.
:::required:
:::.
:::  [filepath]    <in>
:::-------------------------------------------------------------------------------

:is_git_shim
    pushd "%~1"
    :: check if there's shim - and if yes follow the path
    setlocal enabledelayedexpansion
    if exist git.shim (
        for /F "tokens=2 delims== " %%I in (git.shim) do (
            pushd %%~dpI
            set "test_dir=!CD!"
            popd
        )
    ) else (
        set "test_dir=!CD!"
    )
    endlocal & set "test_dir=%test_dir%"

    popd
    exit /b

:::===============================================================================
:::compare_git_versions
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% compare_git_versions
:::-------------------------------------------------------------------------------

:compare_git_versions
    if ERRORLEVEL 0 (
        setlocal enabledelayedexpansion
        :: compare the user git version against the vendored version
        !lib_git! compare_versions USER VENDORED

        :: use the user provided git if its version is greater than, or equal to the vendored git
        if ERRORLEVEL 0 (
            if exist "!test_dir:~0,-4!\cmd\git.exe" (
                set "GIT_INSTALL_ROOT=!test_dir:~0,-4!"
                set test_dir=
            ) else (
                set "GIT_INSTALL_ROOT=!test_dir!"
                set test_dir=
            )
        ) else (
            !lib_console! verbose_output "Found old !GIT_VERSION_USER! in !test_dir!, but not using..."
            set test_dir=
        )
        endlocal && set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%
    ) else (
        :: compare the user git version against the vendored version
        :: if the user provided git executable is not found
        IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 (
            !lib_console! verbose_output "No git at "!git_executable!" found."
            set test_dir=
        )
    )

    exit /b

:::===============================================================================
:::get_user_git_version - get the version information for the user provided git binary
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% get_user_git_version
:::-------------------------------------------------------------------------------

:get_user_git_version
    :: get the version information for the user provided git binary
    %lib_git% read_version USER "%test_dir%"
    %lib_git% validate_version USER %GIT_VERSION_USER%
    exit  /b

@echo off

call "%~dp0lib_base.cmd"
call "%%~dp0lib_console.cmd"
set lib_git=call "%~dp0lib_git.cmd"

if "%~1" == "/h" (
    %lib_base% help "%~0"
) else if "%1" neq "" (
    call :%*
)

exit /b

:read_version
:::===============================================================================
:::read_version - Get the git.exe verion
:::.
:::include:
:::.
:::  call "lib_git.cmd"
:::.
:::usage:
:::.
:::  %lib_git% read_version "[dir_path]"
:::.
:::required:
:::.
:::  [GIT SCOPE]   <in> USER | VENDORED
:::  [GIT PATH]    <in> Fully qualified path to the Git command root.
:::.
:::output:
:::.
:::  GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
:::-------------------------------------------------------------------------------

    :: clear the variables
    set GIT_VERSION_%~1=

    :: set the executable path
    set "git_executable=%~2\git.exe"
    %lib_console% debug_output :read_version "Env Var - git_executable=%git_executable%"

    :: check if the executable actually exists
    if not exist "%git_executable%" (
        %lib_console% debug_output :read_version "%git_executable% does not exist."
        exit /b -255
    )

    :: get the git version in the provided directory

    "%git_executable%" --version > "%temp%\git_version.txt"
    setlocal enabledelayedexpansion
    for /F "tokens=1,2,3 usebackq" %%A in (`type "%temp%\git_version.txt" 2^>nul`) do (
        if /i "%%A %%B" == "git version" (
            set "GIT_VERSION=%%C"
        ) else (
            echo "'git --version' returned an inproper version string!"
            pause
            exit /b
        )
    )
    endlocal & set "GIT_VERSION_%~1=%GIT_VERSION%" & %lib_console% debug_output :read_version "Env Var - GIT_VERSION_%~1=%GIT_VERSION%"

    exit /b

:parse_version
:::===============================================================================
:::parse_version - Parse semantic version string 'x.x.x.x' and return the pieces
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% parse_version "[VERSION]"
:::.
:::required:
:::.
:::  [SCOPE]     <in> USER | VENDORED
:::  [VERSION]   <in> Semantic version String. Ex: 1.2.3.4
:::.
:::output:
:::.
:::  [SCOPE]_MAJOR <out> Scoped Major version.
:::  [SCOPE]_MINOR <out> Scoped Minor version.
:::  [SCOPE]_PATCH <out> Scoped Patch version.
:::  [SCOPE]_BUILD <out> Scoped Build version.
:::-------------------------------------------------------------------------------

    :: process a `x.x.x.xxxx.x` formatted string
    %lib_console% debug_output :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"

    setlocal enabledelayedexpansion
    for /F "tokens=1-3* delims=.,-" %%A in ("%2") do (
        set "%~1_MAJOR=%%A"
        set "%~1_MINOR=%%B"
        set "%~1_PATCH=%%C"
        set "%~1_BUILD=%%D"
    )

    REM endlocal & set "%~1_MAJOR=!%~1_MAJOR!" & set "%~1_MINOR=!%~1_MINOR!" & set "%~1_PATCH=!%~1_PATCH!" & set "%~1_BUILD=!%~1_BUILD!"
    if "%~1" == "VENDORED" (
      endlocal & set "%~1_MAJOR=%VENDORED_MAJOR%" & set "%~1_MINOR=%VENDORED_MINOR%" & set "%~1_PATCH=%VENDORED_PATCH%" & set "%~1_BUILD=%VENDORED_BUILD%"
    ) else (
      endlocal & set "%~1_MAJOR=%USER_MAJOR%" & set "%~1_MINOR=%USER_MINOR%" & set "%~1_PATCH=%USER_PATCH%" & set "%~1_BUILD=%USER_BUILD%"
    )

    exit /b

:endlocal_set_git_version

:validate_version
:::===============================================================================
:::validate_version - Validate semantic version string 'x.x.x.x'.
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% validate_version [SCOPE] [VERSION]
:::.
:::required:
:::.
:::  [SCOPE]     <in> Example:  USER | VENDORED
:::  [VERSION]   <in> Semantic version String. Ex: 1.2.3.4
:::-------------------------------------------------------------------------------

    :: now parse the version information into the corresponding variables
    %lib_console% debug_output :validate_version "ARGV[1]=%~1, ARGV[2]=%~2"

    call :parse_version %~1 %~2

    :: ... and maybe display it, for debugging purposes.
    REM %lib_console% debug_output :validate_version "Found Git Version for %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!"
    if "%~1" == "VENDORED" (
      %lib_console% debug_output :validate_version "Found Git Version for %~1: %VENDORED_MAJOR%.%VENDORED_MINOR%.%VENDORED_PATCH%.%VENDORED_BUILD%"
    ) else (
      %lib_console% debug_output :validate_version "Found Git Version for %~1: %USER_MAJOR%.%USER_MINOR%.%USER_PATCH%.%USER_BUILD%"
    )
    exit /b

:compare_versions
:::===============================================================================
:::compare_version - Compare semantic versions return latest version.
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% validate_version [SCOPE1] [SCOPE2]
:::.
:::required:
:::.
:::  [SCOPE1]    <in> Example: USER
:::  [SCOPE2]    <in> Example: VENDOR
:::-------------------------------------------------------------------------------

    :: checks all major, minor, patch and build variables for the given arguments.
    :: whichever binary that has the most recent version will be used based on the return code.

    %lib_console% debug_output Comparing:
    %lib_console% debug_output %~1: %USER_MAJOR%.%USER_MINOR%.%USER_PATCH%.%USER_BUILD%
    %lib_console% debug_output %~2: %VENDORED_MAJOR%.%VENDORED_MINOR%.%VENDORED_PATCH%.%VENDORED_BUILD%

    setlocal enabledelayedexpansion
    if !%~1_MAJOR! GTR !%~2_MAJOR! (endlocal & exit /b  1)
    if !%~1_MAJOR! LSS !%~2_MAJOR! (endlocal & exit /b -1)

    if !%~1_MINOR! GTR !%~2_MINOR! (endlocal & exit /b  1)
    if !%~1_MINOR! LSS !%~2_MINOR! (endlocal & exit /b -1)

    if !%~1_PATCH! GTR !%~2_PATCH! (endlocal & exit /b  1)
    if !%~1_PATCH! LSS !%~2_PATCH! (endlocal & exit /b -1)

    if !%~1_BUILD! GTR !%~2_BUILD! (endlocal & exit /b  1)
    if !%~1_BUILD! LSS !%~2_BUILD! (endlocal & exit /b -1)

    :: looks like we have the same versions.
    endlocal & exit /b 0

:::===============================================================================
:::is_git_shim
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% is_git_shim [filepath]
:::.
:::required:
:::.
:::  [filepath]    <in>
:::-------------------------------------------------------------------------------

:is_git_shim
    pushd "%~1"
    :: check if there's shim - and if yes follow the path
    setlocal enabledelayedexpansion
    if exist git.shim (
        for /F "tokens=2 delims== " %%I in (git.shim) do (
            pushd %%~dpI
            set "test_dir=!CD!"
            popd
        )
    ) else (
        set "test_dir=!CD!"
    )
    endlocal & set "test_dir=%test_dir%"

    popd
    exit /b

:::===============================================================================
:::compare_git_versions
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% compare_git_versions
:::-------------------------------------------------------------------------------

:compare_git_versions
    if ERRORLEVEL 0 (
        setlocal enabledelayedexpansion
        :: compare the user git version against the vendored version
        !lib_git! compare_versions USER VENDORED

        :: use the user provided git if its version is greater than, or equal to the vendored git
        if ERRORLEVEL 0 (
            if exist "!test_dir:~0,-4!\cmd\git.exe" (
                set "GIT_INSTALL_ROOT=!test_dir:~0,-4!"
            ) else (
                set "GIT_INSTALL_ROOT=!test_dir!"
            )
        ) else (
            !lib_console! verbose_output "Found old !GIT_VERSION_USER! in !test_dir!, but not using..."
        )
        endlocal && set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT% & set test_dir=
    ) else (
        :: compare the user git version against the vendored version
        :: if the user provided git executable is not found
        IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 (
            !lib_console! verbose_output "No git at "!git_executable!" found."
            set test_dir=
        )
    )

    exit /b

:::===============================================================================
:::get_user_git_version - get the version information for the user provided git binary
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  %lib_git% get_user_git_version
:::-------------------------------------------------------------------------------

:get_user_git_version
    :: get the version information for the user provided git binary
    %lib_git% read_version USER "%test_dir%"
    %lib_git% validate_version USER %GIT_VERSION_USER%
    exit  /b

add setlocal

add setlocal


@if not defined flex_sdk (
	@call properties.bat
)

@call "%flex_bin%\compc.bat" -o "%build_dir%\libs\SubtitlesPlugin.swc" ^
	-debug=%debug% ^
	-swf-version=11 ^
	-target-player=10.2 ^
	-sp "%subtitles_plugin%\src" ^
	-is "%subtitles_plugin%\src" ^
	-external-library-path+=libs ^
	-define CONFIG::LOGGING %logging%

@if not defined flex_sdk (
	@call properties.bat
)

@call "%flex_bin%\compc.bat" -o "%build_dir%\libs\SubtitlesPlugin.swc" ^
	-debug=%debug% ^
	-swf-version=11 ^
	-target-player=10.2 ^
	-sp "%subtitles_plugin%\src" ^
	-is "%subtitles_plugin%\src" ^
	-l libs\blooddy_crypto.swc ^
	-external-library-path+=libs\OSMF.swc ^
	-define CONFIG::LOGGING %logging%

include json in SubtitlesPlugin.swc

include json in SubtitlesPlugin.swc


@echo off
:: Copyright (c) 2012 - 2014, Andres Gomez Casanova (AngocA)
:: All rights reserved.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
::
:: 1. Redistributions of source code must retain the above copyright notice,
::    this list of conditions and the following disclaimer.
:: 2. Redistributions in binary form must reproduce the above copyright notice,
::    this list of conditions and the following disclaimer in the documentation
::    and/or other materials provided with the distribution.
::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
:: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
:: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
:: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
:: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
:: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
:: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
:: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
:: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
:: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
:: POSSIBILITY OF SUCH DAMAGE.

:: Reinstall the utility. Calls the uninstall and then the install.
::
:: Version: 2014-02-14 1-Beta
:: Author: Andres Gomez Casanova (AngocA)
:: Made in COLOMBIA.

call %SRC_MAIN_SCRIPT_PATH%\uninstall.bat
call %SRC_MAIN_SCRIPT_PATH%\install.bat %1 %2

@echo off
:: Copyright (c) 2012 - 2014, Andres Gomez Casanova (AngocA)
:: All rights reserved.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
::
:: 1. Redistributions of source code must retain the above copyright notice,
::    this list of conditions and the following disclaimer.
:: 2. Redistributions in binary form must reproduce the above copyright notice,
::    this list of conditions and the following disclaimer in the documentation
::    and/or other materials provided with the distribution.
::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
:: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
:: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
:: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
:: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
:: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
:: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
:: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
:: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
:: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
:: POSSIBILITY OF SUCH DAMAGE.

:: Reinstall the utility. Calls the uninstall and then the install.
::
:: Version: 2014-02-14 1-Beta
:: Author: Andres Gomez Casanova (AngocA)
:: Made in COLOMBIA.

if EXIST init.bat (
 call init.bat
)

call %SRC_MAIN_SCRIPT_PATH%\uninstall.bat
call %SRC_MAIN_SCRIPT_PATH%\install.bat %1 %2

Call init

Call init


@echo off

:: set batch file directory as current
pushd "%~dp0"

set SHARPMAKE_EXECUTABLE=bin\debug\Sharpmake.Application.exe

call CompileSharpmake.bat Sharpmake.Application/Sharpmake.Application.csproj Debug AnyCPU
if %errorlevel% NEQ 0 goto error

set SM_CMD=%SHARPMAKE_EXECUTABLE% /sources("Sharpmake.Main.sharpmake.cs") /verbose
echo %SM_CMD%
%SM_CMD%
if %errorlevel% NEQ 0 goto error

call :NugetRestore Sharpmake.sln win
if %errorlevel% NEQ 0 goto error

goto success

:NugetRestore
echo Restoring nuget packages for %~1

set DOTNET_RESTORE=dotnet restore "%~1"
if "%~2" neq "" set DOTNET_RESTORE=%DOTNET_RESTORE% -r %2
echo %DOTNET_RESTORE%
%DOTNET_RESTORE%
if %errorlevel% NEQ 0 (
    echo ERROR: Failed to restore nuget package for %~1
    exit /b 1
)
exit /b 0

@REM -----------------------------------------------------------------------
:success
COLOR 2F
echo Bootstrap succeeded^^!
timeout /t 5
exit /b 0

@REM -----------------------------------------------------------------------
:error
COLOR 4F
echo Bootstrap failed^^!
pause
set ERROR_CODE=1
goto end

@REM -----------------------------------------------------------------------
:end
:: restore caller current directory
popd
exit /b %ERROR_CODE%

@echo off

:: set batch file directory as current
pushd "%~dp0"

set SHARPMAKE_EXECUTABLE=bin\debug\Sharpmake.Application.exe

call CompileSharpmake.bat Sharpmake.Application/Sharpmake.Application.csproj Debug AnyCPU
if %errorlevel% NEQ 0 goto error

set SM_CMD=%SHARPMAKE_EXECUTABLE% /sources("Sharpmake.Main.sharpmake.cs") /verbose
echo %SM_CMD%
%SM_CMD%
if %errorlevel% NEQ 0 goto error

call :NugetRestore Sharpmake.sln win
if %errorlevel% NEQ 0 goto error

goto success

:NugetRestore
echo Restoring nuget packages for %~1

set DOTNET_RESTORE=dotnet restore "%~1"
if "%~2" neq "" set DOTNET_RESTORE=%DOTNET_RESTORE% -r %2
echo %DOTNET_RESTORE%
%DOTNET_RESTORE%
if %errorlevel% NEQ 0 (
    echo ERROR: Failed to restore nuget package for %~1
    exit /b 1
)
exit /b 0

@REM -----------------------------------------------------------------------
:success
COLOR 2F
echo Bootstrap succeeded^!
timeout /t 5
exit /b 0

@REM -----------------------------------------------------------------------
:error
COLOR 4F
echo Bootstrap failed^!
pause
set ERROR_CODE=1
goto end

@REM -----------------------------------------------------------------------
:end
:: restore caller current directory
popd
exit /b %ERROR_CODE%

Remove extra hat in bootstrap batch file


@echo off
if "~%1"=="~EXTERNALS" (
   @echo TODO: separate EXTERNALS build target from ALL_BUILD
   exit /B 0
) else if NOT "~%1"=="~" (
   @echo target=%1
)

@echo CD=%CD%
@echo HOME=%HOME%
@echo CONDOR_BLD_EXTERNAL_STAGE=%CONDOR_BLD_EXTERNAL_STAGE%
@echo LIB=%LIB%
@echo INCLUDE=%INCLUDE%
@echo PATH=%PATH%

REM use FOR to convert from linux path separators to windows path seps
for %%I in ("%BASE_DIR%") do set BUILD_ROOT=%%~dpfI
if "~%BUILD_ROOT%"=="~" set BUILD_ROOT=%CD%
@echo BUILD_ROOT=%BUILD_ROOT%

md %BUILD_ROOT%\Temp
REM pcre blows up if the temp path has spaces in it, so make sure that it's a short path.
set TEMP=%BUILD_ROOT%\Temp
set TMP=%BUILD_ROOT%\Temp

for /D %%I in ("%VS90COMNTOOLS%..") do set VS90ROOT=%%~sdpI
set VS_DIR=%VS90ROOT:~0,-1%
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VS_DIR%\bin

set DOTNET_PATH=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727

set PERL_PATH=
:: Is active perl passed as prereqs?
set ACTIVE_PERL_DIR=%_NMI_PREREQ_ActivePerl_ROOT%
echo nmi ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR%
if NOT "~%ACTIVE_PERL_DIR%"=="~" goto got_active_perl
:: Look for active perl in the registry
for /F "tokens=3" %%I in ('reg query HKLM\Software\Perl /v BinDir') do set ACTIVE_PERL_DIR=%%~sdpI
if NOT "~%ACTIVE_PERL_DIR%"=="~" for %%I in (%ACTIVE_PERL_DIR%\..) do set ACTIVE_PERL_DIR=%%~sfI
echo reg ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR%
if NOT "~%ACTIVE_PERL_DIR%"=="~" goto got_active_perl
:: look for perl in the path. this is dangerous, because we can't use cygwin perl. builds require active perl
for %%I in (perl.exe) do set ACTIVE_PERL_DIR=%%~sdp$PATH:I
if NOT "~%ACTIVE_PERL_DIR%"=="~" for %%I in (%ACTIVE_PERL_DIR%\..) do set ACTIVE_PERL_DIR=%%~sfI
echo path ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR%
if NOT "~%ACTIVE_PERL_DIR%"=="~" goto got_active_perl
set PERL_PATH=c:\perl\site\bin;c:\perl\bin
:got_active_perl
:: strip trailing \ from active perl dir, and then construct a PERL_PATH from it
if "~%ACTIVE_PERL_DIR:~-1%"=="~\" set ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR:~0,-1%
if NOT "~%ACTIVE_PERL_DIR%"=="~" set PERL_PATH=%ACTIVE_PERL_DIR%\site\bin;%ACTIVE_PERL_DIR%\bin;%PERL_PATH%
echo PERL_PATH=%PERL_PATH%
:got_perl

if "~%_NMI_PREREQ_7_Zip_ROOT%"=="~" (
  set ZIP_PATH=%ProgramFiles%\7-Zip
) else (
  set ZIP_PATH=%_NMI_PREREQ_7_Zip_ROOT%
)
set WIX_PATH=%WIX%
set MSCONFIG_TOOLS_DIR=%BUILD_ROOT%\msconfig
if "~%_NMI_PREREQ_cmake_ROOT%"=="~" (
   set CMAKE_BIN_DIR=%ProgramFiles%\CMake 2.8\bin
) else (
   set CMAKE_BIN_DIR=%_NMI_PREREQ_cmake_ROOT%\bin
)

set PATH=%SystemRoot%\system32;%SystemRoot%;%PERL_PATH%;%MSCONFIG_TOOLS_DIR%;%VS_DIR%\Common7\IDE;%VC_BIN%;%CMAKE_BIN_DIR%;%ZIP_PATH%;%WIX_PATH%
@echo PATH=%PATH%

set INCLUDE=%BUILD_ROOT%\src\condor_utils
@echo INCLUDE=%INCLUDE%

@echo ----  build.win.bat ENVIRONMENT --------------------------------
set
@echo ----  end build.win.bat ENVIRONMENT ----------------------------

if not "~%1"=="~" goto %1
:DEFAULT
@echo devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
goto finis

:ALL_BUILD
:BUILD
@echo cmake.exe . -G "Visual Studio 9 2008"
cmake.exe . -G "Visual Studio 9 2008"
if ERRORLEVEL 1 goto finis
@echo devenv CONDOR.sln /Build RelWithDebInfo /project ALL_BUILD
devenv CONDOR.sln /Build RelWithDebInfo /project ALL_BUILD
if ERRORLEVEL 1 goto finis
:RELEASE
@echo cmake.exe -DBUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=release_dir -P cmake_install.cmake
cmake.exe -DBUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=release_dir -P cmake_install.cmake
goto finis

:ZIP
@echo zipping up release directory %BUILD_ROOT%\release_dir
@echo on
pushd %BUILD_ROOT%\release_dir
izip -r ..\condor-%2winnt-x86.zip *
dir .
popd
@echo off
goto finis

:MSI
:MAKE_MSI
:NATIVE
@echo %BUILD_ROOT%\release_dir\etc\WiX\do_wix %BUILD_ROOT\release_dir %BUILD_ROOT\condor-%2winnt-x86.msi
@echo TODO: fix so that do_wix.bat can run in NMI. %ERRORLEVEL%
@echo on
dir %BUILD_ROOT%
dir %BUILD_ROOT%\release_dir
@echo off
:: call %BUILD_ROOT%\release_dir\etc\WiX\do_wix.bat %BUILD_ROOT\release_dir %BUILD_ROOT\condor-%2winnt-x86.msi
goto finis

:PACK
@echo devenv CONDOR.sln /Build RelWithDebInfo /project PACKAGE
devenv CONDOR.sln /Build RelWithDebInfo /project PACKAGE
goto finis

:EXTERNALS
@echo devenv CONDOR_EXTERNALS.sln /Build RelWithDebInfo /project ALL_BUILD
devenv CONDOR_EXTERNALS.sln /Build RelWithDebInfo /project ALL_BUILD
goto finis

REM common exit
:finis
REM if the build failed, we don't want to continue, just exit the cmd shell and return the error
REM if we are in NMI, then we want to quit the command shell and not just the batch file.
if NOT "~%NMI_PLATFORM_TYPE%"=="~nmi" exit /B %ERRORLEVEL%
if ERRORLEVEL 1 exit %ERRORLEVEL%

@echo off
if "~%1"=="~EXTERNALS" (
   @echo TODO: separate EXTERNALS build target from ALL_BUILD
   exit /B 0
) else if NOT "~%1"=="~" (
   @echo target=%1
)

@echo CD=%CD%
@echo HOME=%HOME%
@echo CONDOR_BLD_EXTERNAL_STAGE=%CONDOR_BLD_EXTERNAL_STAGE%
@echo LIB=%LIB%
@echo INCLUDE=%INCLUDE%
@echo PATH=%PATH%

REM use FOR to convert from linux path separators to windows path seps
for %%I in ("%BASE_DIR%") do set BUILD_ROOT=%%~dpfI
if "~%BUILD_ROOT%"=="~" set BUILD_ROOT=%CD%
@echo BUILD_ROOT=%BUILD_ROOT%

md %BUILD_ROOT%\Temp
REM pcre blows up if the temp path has spaces in it, so make sure that it's a short path.
set TEMP=%BUILD_ROOT%\Temp
set TMP=%BUILD_ROOT%\Temp

for /D %%I in ("%VS90COMNTOOLS%..") do set VS90ROOT=%%~sdpI
set VS_DIR=%VS90ROOT:~0,-1%
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VS_DIR%\bin

set DOTNET_PATH=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727

set PERL_PATH=
:: Is active perl passed as prereqs?
set ACTIVE_PERL_DIR=%_NMI_PREREQ_ActivePerl_ROOT%
echo nmi ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR%
if NOT "~%ACTIVE_PERL_DIR%"=="~" goto got_active_perl
:: Look for active perl in the registry
for /F "tokens=3" %%I in ('reg query HKLM\Software\Perl /v BinDir') do set ACTIVE_PERL_DIR=%%~sdpI
if NOT "~%ACTIVE_PERL_DIR%"=="~" for %%I in (%ACTIVE_PERL_DIR%\..) do set ACTIVE_PERL_DIR=%%~sfI
echo reg ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR%
if NOT "~%ACTIVE_PERL_DIR%"=="~" goto got_active_perl
:: look for perl in the path. this is dangerous, because we can't use cygwin perl. builds require active perl
for %%I in (perl.exe) do set ACTIVE_PERL_DIR=%%~sdp$PATH:I
if NOT "~%ACTIVE_PERL_DIR%"=="~" for %%I in (%ACTIVE_PERL_DIR%\..) do set ACTIVE_PERL_DIR=%%~sfI
echo path ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR%
if NOT "~%ACTIVE_PERL_DIR%"=="~" goto got_active_perl
set PERL_PATH=c:\perl\site\bin;c:\perl\bin
:got_active_perl
:: strip trailing \ from active perl dir, and then construct a PERL_PATH from it
if "~%ACTIVE_PERL_DIR:~-1%"=="~\" set ACTIVE_PERL_DIR=%ACTIVE_PERL_DIR:~0,-1%
if NOT "~%ACTIVE_PERL_DIR%"=="~" set PERL_PATH=%ACTIVE_PERL_DIR%\site\bin;%ACTIVE_PERL_DIR%\bin;%PERL_PATH%
echo PERL_PATH=%PERL_PATH%
:got_perl

if "~%_NMI_PREREQ_7_Zip_ROOT%"=="~" (
  set ZIP_PATH=%ProgramFiles%\7-Zip
) else (
  set ZIP_PATH=%_NMI_PREREQ_7_Zip_ROOT%
)
set WIX_PATH=%WIX%
set MSCONFIG_TOOLS_DIR=%BUILD_ROOT%\msconfig
if "~%_NMI_PREREQ_cmake_ROOT%"=="~" (
   set CMAKE_BIN_DIR=%ProgramFiles%\CMake 2.8\bin
) else (
   set CMAKE_BIN_DIR=%_NMI_PREREQ_cmake_ROOT%\bin
)

set PATH=%SystemRoot%\system32;%SystemRoot%;%PERL_PATH%;%MSCONFIG_TOOLS_DIR%;%VS_DIR%\Common7\IDE;%VC_BIN%;%CMAKE_BIN_DIR%;%ZIP_PATH%;%WIX_PATH%
@echo PATH=%PATH%

set INCLUDE=%BUILD_ROOT%\src\condor_utils
@echo INCLUDE=%INCLUDE%

@echo ----  build.win.bat ENVIRONMENT --------------------------------
set
@echo ----  end build.win.bat ENVIRONMENT ----------------------------

if not "~%1"=="~" goto %1
:DEFAULT
@echo devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
devenv CONDOR.sln /Rebuild RelWithDebInfo /project PACKAGE
goto finis

:ALL_BUILD
:BUILD
@echo cmake.exe . -G "Visual Studio 9 2008"
cmake.exe . -G "Visual Studio 9 2008"
if ERRORLEVEL 1 goto finis
@echo devenv CONDOR.sln /Build RelWithDebInfo /project ALL_BUILD
devenv CONDOR.sln /Build RelWithDebInfo /project ALL_BUILD
if ERRORLEVEL 1 goto finis
:RELEASE
@echo cmake.exe -DBUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=release_dir -P cmake_install.cmake
cmake.exe -DBUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=release_dir -P cmake_install.cmake
goto finis

:ZIP
@echo zipping up release directory %BUILD_ROOT%\release_dir
@echo on
pushd %BUILD_ROOT%\release_dir
izip -r ..\condor-%2winnt-x86.zip *
dir .
popd
@echo off
goto finis

:MSI
:MAKE_MSI
:NATIVE
@echo %BUILD_ROOT%\release_dir\etc\WiX\do_wix %BUILD_ROOT\release_dir %BUILD_ROOT\condor-%2winnt-x86.msi
@echo TODO: fix so that do_wix.bat can run in NMI. %ERRORLEVEL%
@echo on
dir %BUILD_ROOT%\release_dir
dir %BUILD_ROOT%
@echo off
:: reset set errorlevel to 0
verify >NUL
:: call %BUILD_ROOT%\release_dir\etc\WiX\do_wix.bat %BUILD_ROOT\release_dir %BUILD_ROOT\condor-%2winnt-x86.msi
@echo ERRORLEVEL=%ERRORLEVEL%
goto finis

:PACK
@echo devenv CONDOR.sln /Build RelWithDebInfo /project PACKAGE
devenv CONDOR.sln /Build RelWithDebInfo /project PACKAGE
goto finis

:EXTERNALS
@echo devenv CONDOR_EXTERNALS.sln /Build RelWithDebInfo /project ALL_BUILD
devenv CONDOR_EXTERNALS.sln /Build RelWithDebInfo /project ALL_BUILD
goto finis

REM common exit
:finis
REM if the build failed, we don't want to continue, just exit the cmd shell and return the error
REM if we are in NMI, then we want to quit the command shell and not just the batch file.
if NOT "~%NMI_PLATFORM_TYPE%"=="~nmi" exit /B %ERRORLEVEL%
if ERRORLEVEL 1 exit %ERRORLEVEL%

reset errorlevel to 0 for create_native task on windows for new batlab ===VersionHistory:None===


@ECHO OFF

C:\elasticsearch\bin\.\elasticsearch.bat

Add Elastic search starting script (#295)


@ECHO OFF
rem ******************************************************************************
rem *
rem * Notepad2-mod
rem *
rem * build.cmd
rem *   Batch file "wrapper" for makefile.mak, used to build Notepad2 with WDK
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem *                                       (c) XhmikosR 2010
rem *                                       http://code.google.com/p/notepad2-mod/
rem *
rem ******************************************************************************

SETLOCAL
CD /D %~dp0

rem Set the WDK and SDK directories
SET "WDKBASEDIR=C:\WinDDK\7600.16385.1"
SET "SDKDIR=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1"

rem Check the building environment
IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!"
IF NOT EXIST "%SDKDIR%" CALL :SUBMSG "ERROR" "Specify your SDK directory!"

rem check for the help switches
IF /I "%1"=="help" GOTO :SHOWHELP
IF /I "%1"=="/help" GOTO :SHOWHELP
IF /I "%1"=="-help" GOTO :SHOWHELP
IF /I "%1"=="--help" GOTO :SHOWHELP
IF /I "%1"=="/?" GOTO :SHOWHELP
GOTO :CHECKFIRSTARG

:SHOWHELP
TITLE "build.cmd %1"
ECHO.
ECHO:Usage:  build.cmd [Clean^|Build^|Rebuild] [x86^|x64^|all]
ECHO.
ECHO:You can use prefix the commands with "-", "--" or "/"
ECHO.
ECHO.
ECHO:Edit "build.cmd" and set your WDK and SDK directories.
ECHO:You shouldn't need to make any changes other than that.
ECHO.
ECHO.
ECHO:Executing "build.cmd" will use the defaults: "build.cmd build all"
ECHO:If you skip the second argument the default one will be used. Example:
ECHO:"build.cmd rebuild" is equivalent to "build.cmd rebuild all"
ECHO:NOTE: "build.cmd x86" won't work.
ECHO.
ENDLOCAL
EXIT /B

:CHECKFIRSTARG
REM Check for the first switch
IF "%1" == "" (
SET BUILDTYPE=Build
) ELSE (
IF /I "%1" == "Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
ECHO.
ECHO:Unsupported commandline switch!
ECHO:Run "build.cmd help" for details about the commandline switches.
CALL :SUBMSG "ERROR" "Compilation failed!"
)

:CHECKSECONDARG
REM Check for the second switch
IF "%2" == "" (
SET ARCH=all
) ELSE (
IF /I "%2" == "x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "/x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "-x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "--x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "/x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "-x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "--x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "all" SET ARCH=all&&GOTO :START
IF /I "%2" == "/all" SET ARCH=all&&GOTO :START
IF /I "%2" == "-all" SET ARCH=all&&GOTO :START
IF /I "%2" == "--all" SET ARCH=all&&GOTO :START
ECHO.
ECHO:Unsupported commandline switch!
ECHO:Run "build.cmd help" for details about the commandline switches.
CALL :SUBMSG "ERROR" "Compilation failed!"
)

:START
IF /I "%BUILDTYPE%" == "Clean" GOTO :x86
PUSHD ..
CALL "update_version.bat"
POPD

:x86
SET "INCLUDE=%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x64" GOTO :x64

TITLE Building Notepad2 x86...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE clean
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE clean
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64

:x64
SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x86" GOTO :END

TITLE Building Notepad2 x64...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE "x64=1" clean
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE "x64=1" clean

:END
TITLE Building Notepad2 - Finished!
ENDLOCAL
EXIT /B

:SUBNMAKE
nmake /NOLOGO /f "makefile.mak" %1 %2
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
EXIT /B

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

@ECHO OFF
rem ******************************************************************************
rem *
rem * Notepad2-mod
rem *
rem * build.cmd
rem *   Batch file "wrapper" for makefile.mak, used to build Notepad2 with WDK
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem *                                       (c) XhmikosR 2010
rem *                                       http://code.google.com/p/notepad2-mod/
rem *
rem ******************************************************************************

SETLOCAL
CD /D %~dp0

rem Set the WDK and SDK directories
SET "WDKBASEDIR=C:\WinDDK\7600.16385.1"
SET "SDKDIR=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1"

rem Check the building environment
IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!"
IF NOT EXIST "%SDKDIR%" CALL :SUBMSG "ERROR" "Specify your SDK directory!"

rem check for the help switches
IF /I "%1"=="help" GOTO :SHOWHELP
IF /I "%1"=="/help" GOTO :SHOWHELP
IF /I "%1"=="-help" GOTO :SHOWHELP
IF /I "%1"=="--help" GOTO :SHOWHELP
IF /I "%1"=="/?" GOTO :SHOWHELP
GOTO :CHECKFIRSTARG

:SHOWHELP
TITLE "build.cmd %1"
ECHO.
ECHO:Usage:  build.cmd [Clean^|Build^|Rebuild] [x86^|x64^|all]
ECHO.
ECHO:Note:   You can also prefix the commands with "-", "--" or "/".
ECHO.
ECHO.
ECHO:Edit "build.cmd" and set your WDK and SDK directories.
ECHO:You shouldn't need to make any changes other than that.
ECHO.
ECHO.
ECHO:Executing "build.cmd" will use the defaults: "build.cmd build all"
ECHO:If you skip an argument the default one will be used.
ECHO.
ECHO:Examples:
ECHO:  "build.cmd rebuild" is equivalent to "build.cmd rebuild all"
ECHO:  "build.cmd x86" is equivalent to "build.cmd build x86"
ECHO.
ENDLOCAL
EXIT /B

:CHECKFIRSTARG
REM Check for the first switch
IF "%1" == "" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Build" SET BUILDTYPE=Build&&GOTO :CHECKSECONDARG
IF /I "%1" == "Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Clean" SET BUILDTYPE=Clean&&GOTO :CHECKSECONDARG
IF /I "%1" == "Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "/Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "-Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "--Rebuild" SET BUILDTYPE=Rebuild&&GOTO :CHECKSECONDARG
IF /I "%1" == "x86" SET ARCH=x86&&GOTO :CHECKSECONDARG
IF /I "%1" == "/x86" SET ARCH=x86&&GOTO :CHECKSECONDARG
IF /I "%1" == "-x86" SET ARCH=x86&&GOTO :CHECKSECONDARG
IF /I "%1" == "--x86" SET ARCH=x86&&GOTO :CHECKSECONDARG
IF /I "%1" == "x64" SET ARCH=x64&&GOTO :CHECKSECONDARG
IF /I "%1" == "/x64" SET ARCH=x64&&GOTO :CHECKSECONDARG
IF /I "%1" == "-x64" SET ARCH=x64&&GOTO :CHECKSECONDARG
IF /I "%1" == "--x64" SET ARCH=x64&&GOTO :CHECKSECONDARG
IF /I "%1" == "all" SET ARCH=all&&GOTO :CHECKSECONDARG
IF /I "%1" == "/all" SET ARCH=all&&GOTO :CHECKSECONDARG
IF /I "%1" == "-all" SET ARCH=all&&GOTO :CHECKSECONDARG
IF /I "%1" == "--all" SET ARCH=all&&GOTO :CHECKSECONDARG
ECHO.
ECHO:"%1": Unsupported commandline switch!
ECHO:Run "build.cmd help" for details about the commandline switches.
CALL :SUBMSG "ERROR" "Compilation failed!"

:CHECKSECONDARG
REM Check for the second switch
IF "%2" == "" SET ARCH=all&&GOTO :START
IF /I "%2" == "x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "/x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "-x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "--x86" SET ARCH=x86&&GOTO :START
IF /I "%2" == "x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "/x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "-x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "--x64" SET ARCH=x64&&GOTO :START
IF /I "%2" == "all" SET ARCH=all&&GOTO :START
IF /I "%2" == "/all" SET ARCH=all&&GOTO :START
IF /I "%2" == "-all" SET ARCH=all&&GOTO :START
IF /I "%2" == "--all" SET ARCH=all&&GOTO :START
IF /I "%2" == "Build" SET BUILDTYPE=Build&&GOTO :START
IF /I "%2" == "/Build" SET BUILDTYPE=Build&&GOTO :START
IF /I "%2" == "-Build" SET BUILDTYPE=Build&&GOTO :START
IF /I "%2" == "--Build" SET BUILDTYPE=Build&&GOTO :START
IF /I "%2" == "Clean" SET BUILDTYPE=Clean&&GOTO :START
IF /I "%2" == "/Clean" SET BUILDTYPE=Clean&&GOTO :START
IF /I "%2" == "-Clean" SET BUILDTYPE=Clean&&GOTO :START
IF /I "%2" == "--Clean" SET BUILDTYPE=Clean&&GOTO :START
IF /I "%2" == "Rebuild" SET BUILDTYPE=Rebuild&&GOTO :START
IF /I "%2" == "/Rebuild" SET BUILDTYPE=Rebuild&&GOTO :START
IF /I "%2" == "-Rebuild" SET BUILDTYPE=Rebuild&&GOTO :START
IF /I "%2" == "--Rebuild" SET BUILDTYPE=Rebuild&&GOTO :START
ECHO.
ECHO:"%2": Unsupported commandline switch!
ECHO:Run "build.cmd help" for details about the commandline switches.
CALL :SUBMSG "ERROR" "Compilation failed!"

:START
IF /I "%BUILDTYPE%" == "" SET BUILDTYPE=Build
IF /I "%ARCH%" == "" SET ARCH=all
IF /I "%BUILDTYPE%" == "Clean" GOTO :x86
PUSHD ..
CALL "update_version.bat"
POPD

:x86
SET "INCLUDE=%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x64" GOTO :x64

TITLE Building Notepad2 x86...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE clean
CALL :SUBNMAKE
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE clean
IF /I "%ARCH%" == "x86" GOTO :END
IF /I "%ARCH%" == "x64" GOTO :x64
IF /I "%ARCH%" == "all" GOTO :x64

:x64
SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"
SET "FPATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%SDKDIR%\Bin"
SET "PATH=%FPATH%"

IF /I "%ARCH%" == "x86" GOTO :END

TITLE Building Notepad2 x64...
ECHO. && ECHO.

IF /I "%BUILDTYPE%" == "Build" (
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Rebuild" (
CALL :SUBNMAKE "x64=1" clean
CALL :SUBNMAKE "x64=1"
GOTO :END
)

IF /I "%BUILDTYPE%" == "Clean" CALL :SUBNMAKE "x64=1" clean

:END
TITLE Building Notepad2 - Finished!
ENDLOCAL
EXIT /B

:SUBNMAKE
nmake /NOLOGO /f "makefile.mak" %1 %2
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
EXIT /B

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

update build.cmd

update build.cmd


set user=
set password=

:: DEVELOPER ONLY, DO NOT MODIFY THE FOLLOWING CODE!!
set url="http://securelogin.arubanetworks.com/cgi-bin/login"
set params="user=$user&password=$password&cmd=authenticate&Login=Log+In"

set user=
set password=

:: DEVELOPER ONLY, DO NOT MODIFY THE FOLLOWING CODE!!
set url="https://securelogin.arubanetworks.com/cgi-bin/login"
set params="user=$user&password=$password&cmd=authenticate&Login=Log+In"

use https

use https


mkdir build && cd build

cmake -G "NMake Makefiles"^
    -DCMAKE_BUILD_TYPE=Release^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%^
    -DDART_MSVC_DEFAULT_OPTIONS=ON^
    %SRC_DIR%

if errorlevel 1 exit 1

nmake
if errorlevel 1 exit 1

nmake install
if errorlevel 1 exit 1

mkdir build && cd build

cmake -G "NMake Makefiles"^
    -DCMAKE_BUILD_TYPE=Release^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%^
    -DDART_MSVC_DEFAULT_OPTIONS=ON^
    -DDART_VERBOSE=ON^
    %SRC_DIR%

if errorlevel 1 exit 1

nmake
if errorlevel 1 exit 1

nmake install
if errorlevel 1 exit 1

Update bld.bat

Update bld.bat


:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
ECHO NUL > C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:port/bfmirror/downloads/ >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Log_Days=30 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000 >> C:\Windows\Temp\clientsettings.cfg

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
REM http://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows
type NUL > C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:port/bfmirror/downloads/ >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Log_Days=30 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000 >> C:\Windows\Temp\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000 >> C:\Windows\Temp\clientsettings.cfg

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.2.9\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.2.10\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

bump report generator dep

chore: bump report generator dep


@echo off
setlocal

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _bootimage_version=latest
) else if "%1"=="latest" (
    set _bootimage_version=latest
) else if "%1"=="clean" (
    set _bootimage_version=clean
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

if %_bootimage_version%==clean (
    set _git_branch=clean-windows-%_target%
    set _bootimage_path=clean/windows-%_target%
) else (
    set _git_branch=master
    set _bootimage_path=latest
)

echo Updating working copy from %_git_branch%...
call git pull http://factorcode.org/git/factor.git %_git_branch%
if errorlevel 1 goto fail

echo Building vm...
nmake /nologo /f Nmakefile clean
if errorlevel 1 goto fail
nmake /nologo /f Nmakefile %_target%
if errorlevel 1 goto fail

echo Fetching %_bootimage_version% boot image...
cscript /nologo build-support\http-get.vbs http://downloads.factorcode.org/images/%_bootimage_path%/%_bootimage% %_bootimage%
if errorlevel 1 goto fail

echo Bootstrapping...
.\factor.com -i=%_bootimage%
if errorlevel 1 goto fail

echo Copying fresh factor.image to factor.image.fresh.
copy factor.image factor.image.fresh
if errorlevel 1 goto fail

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build-support\factor.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build-support\factor.cmd [latest/clean]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo     If latest is specified, then the working copy is updated to the
echo     upstream "master" branch and the boot image corresponding to the
echo     most recent factor build is downloaded. This is the default.
echo     If clean is specified, then the working copy is updated to the
echo     upstream "clean-windows-*" branch corresponding to the current
echo     platform and the corresponding boot image is downloaded.
goto :EOF

@echo off
setlocal

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _bootimage_version=latest
) else if "%1"=="latest" (
    set _bootimage_version=latest
) else if "%1"=="clean" (
    set _bootimage_version=clean
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

if %_bootimage_version%==clean (
    set _git_branch=clean-windows-%_target%
    set _bootimage_path=clean/windows-%_target%
) else (
    set _git_branch=master
    set _bootimage_path=latest
)

echo Deleting staging images from temp/...
del temp\staging.*.image
if errorlevel 1 goto fail

echo Updating working copy from %_git_branch%...
call git pull http://factorcode.org/git/factor.git %_git_branch%
if errorlevel 1 goto fail

echo Building vm...
nmake /nologo /f Nmakefile clean
if errorlevel 1 goto fail
nmake /nologo /f Nmakefile %_target%
if errorlevel 1 goto fail

echo Fetching %_bootimage_version% boot image...
cscript /nologo build-support\http-get.vbs http://downloads.factorcode.org/images/%_bootimage_path%/%_bootimage% %_bootimage%
if errorlevel 1 goto fail

echo Bootstrapping...
.\factor.com -i=%_bootimage%
if errorlevel 1 goto fail

echo Copying fresh factor.image to factor.image.fresh.
copy factor.image factor.image.fresh
if errorlevel 1 goto fail

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build-support\factor.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build-support\factor.cmd [latest/clean]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo     If latest is specified, then the working copy is updated to the
echo     upstream "master" branch and the boot image corresponding to the
echo     most recent factor build is downloaded. This is the default.
echo     If clean is specified, then the working copy is updated to the
echo     upstream "clean-windows-*" branch corresponding to the current
echo     platform and the corresponding boot image is downloaded.
goto :EOF

Delete staging images when running factor.cmd. Fixes #104.


cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_allegro.c -I"..\..\libdepwin\allegro5.2.4\include" -I"..\..\include"
link /DEBUG ring_allegro.obj  ..\..\lib\ring.lib ..\..\libdepwin\allegro5.2.4\lib\allegro.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_image.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_dialog.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_ttf.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_acodec.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_primitives.lib ^
..\..\libdepwin\allegro5.2.4\lib\allegro_audio.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_color.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_font.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_video.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_primitives.lib ..\..\libdepwin\allegro5.2.4\lib\allegro_memfile.lib ^
		..\..\libdepwin\allegro5.2.4\lib\allegro_physfs.lib ^
	  /DLL /OUT:..\..\bin\ring_allegro.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_allegro.obj

cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_allegro.c -I"..\..\extensions\libdepwin\allegro5.2.4\include" -I"..\..\include"
link /DEBUG ring_allegro.obj  ..\..\lib\ring.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_image.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_dialog.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_ttf.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_acodec.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_primitives.lib ^
..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_audio.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_color.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_font.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_video.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_primitives.lib ..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_memfile.lib ^
		..\..\extensions\libdepwin\allegro5.2.4\lib\allegro_physfs.lib ^
	  /DLL /OUT:..\..\bin\ring_allegro.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_allegro.obj

Update RingAllegro - extensions/ringallegro/buildvc_allegro5.2.4.bat


set PATH=C:\Ruby192\bin;%PATH%

ruby -v
call bundle install --binstubs --without docgen --path vendor/bundle || ( call rm Gemfile.lock && call bundle install --binstubs --path vendor/bundle )
ruby bin\rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec/functional spec/unit spec/stress
set RSPEC_ERRORLVL=%ERRORLEVEL%

REM Return the error level from rspec
exit /B %RSPEC_ERRORLVL%

ruby -v

call bundle check

if %ERRORLEVEL% NEQ 0 (
   call rm Gemfile.lock
   call bundle install --without docgen --path vendor/bundle
)

bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec

set RSPEC_ERRORLVL=%ERRORLEVEL%

set RSPEC_ERRORLVL=%ERRORLEVEL%
REM Return the error level from rspec
exit /B %RSPEC_ERRORLVL%

Clean up `jenkins_run_tests.bat`

Clean up `jenkins_run_tests.bat`

This change ensures the bat file is in sync with what we have in
opscode/chef.


Commande ECHO active.
### application.bat - 201x - Laurent THOMAS ###
echo "Copyright company - 201x"
echo "Build:10:00"
echo "version 1.2"

add partner name

add partner name


@echo off
setlocal
:prompt
set /p ans="List Directory Files (y/n)? "
if /i "%ans%" neq "y" goto end

dir %1 /b /a-d /o:en > "%cd%\filelist.txt"
pause

:end
endlocal

Create filelist.bat

Create filelist.bat


set /p Build=<ver.txt

echo Building version %Build%

fart ..\Properties\AssemblyInfo.cs 1.0.0.0  1.0.%Build%
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\DEVENV"   ..\..\Budford.sln /Rebuild Release

call "c:\Program Files (x86)\NSIS\Bin\makensis.exe" Budford.nsi
ren "Budford - Setup.exe" "Budford - Setup - V1.0.%Build%.exe"

set /a Build=%Build%+1
echo %Build% > ver.txt

git commit -m "New release" ver.txt
git status
git push origin master
git checkout ..\..

set /p Build=<ver.txt

echo Building version %Build%

fart ..\Properties\AssemblyInfo.cs 1.0.0.0  1.0.%Build%
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\DEVENV"   ..\..\Budford.sln /Rebuild Release

call "c:\Program Files (x86)\NSIS\Bin\makensis.exe" Budford.nsi
ren "Budford - Setup.exe" "Budford - Setup - V1.0.%Build%.exe"

"C:\Program Files\7-Zip\7z.exe" a "Budford - V1.0.%Build%.zip" Users
"C:\Program Files\7-Zip\7z.exe" a "Budford - V1.0.%Build%.zip" Budford.exe
"C:\Program Files\7-Zip\7z.exe" a "Budford - V1.0.%Build%.zip" CNUSLib.dll
"C:\Program Files\7-Zip\7z.exe" a "Budford - V1.0.%Build%.zip" discord-rpc.dll

set /a Build=%Build%+1
echo %Build% > ver.txt

git commit -m "New release" ver.txt
git status
git push origin master
git checkout ..\..

Build script now creates zip

Build script now creates zip


PROMPT $g
SET outfolder=DRChrome

ECHO "*** Compiling TS to single 'src\darkreader.js'... ***"
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe" @DRChrome_files.txt --out %outfolder%\src\darkreader.js -t ES5 --declaration

ECHO "*** Compiling TS for pop-up page... ***"
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe" @DRChrome_popup_files.txt %outfolder%\src\darkreader.d.ts --out %outfolder%\src\popup.js -t ES5

ECHO "*** Compiling event.ts for pop-up page... ***"
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe" ..\src\DarkReader\app\event.ts --out %outfolder%\src\event.js -t ES5

ECHO "*** Removing type definition... ***"
DEL %outfolder%\src\darkreader.d.ts

ECHO "*** Copying contents... ***"
XCOPY ..\src\DarkReader\chrome\content\background.html %outfolder%\ /d /y
XCOPY ..\src\DarkReader\chrome\content\popup.html %outfolder%\ /d /y
XCOPY ..\src\DarkReader\chrome\content\manifest.json %outfolder%\ /d /y
XCOPY ..\src\DarkReader\chrome\content\img\* %outfolder%\img\ /d /y
XCOPY ..\src\DarkReader\chrome\content\style\style.css %outfolder%\style\ /d /y
XCOPY ..\src\DarkReader\generation\*.json %outfolder%\ /d /y
XCOPY ..\src\DarkReader\img\*.* %outfolder%\img\ /d /y

PROMPT $g
SET outfolder=DRChrome

ECHO "*** Compiling TS to single 'src\darkreader.js'... ***"
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe" @DRChrome_files.txt --out %outfolder%\src\darkreader.js -t ES5 --declaration

ECHO "*** Compiling TS for pop-up page... ***"
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe" @DRChrome_popup_files.txt %outfolder%\src\darkreader.d.ts --out %outfolder%\src\popup.js -t ES5

ECHO "*** Compiling event.ts for pop-up page... ***"
"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe" ..\src\DarkReader\app\event.ts --out %outfolder%\src\event.js -t ES5

ECHO "*** Removing type definition... ***"
DEL %outfolder%\src\darkreader.d.ts

ECHO "*** Copying contents... ***"
XCOPY ..\src\DarkReader\chrome\content\background.html %outfolder%\ /d /y
XCOPY ..\src\DarkReader\chrome\content\popup.html %outfolder%\ /d /y
XCOPY ..\src\DarkReader\chrome\content\manifest.json %outfolder%\ /d /y
XCOPY ..\src\DarkReader\chrome\content\img\* %outfolder%\img\ /d /y
XCOPY ..\src\DarkReader\chrome\content\font\* %outfolder%\font\ /d /y
XCOPY ..\src\DarkReader\chrome\content\style\style.css %outfolder%\style\ /d /y
XCOPY ..\src\DarkReader\generation\*.json %outfolder%\ /d /y
XCOPY ..\src\DarkReader\img\*.* %outfolder%\img\ /d /y

Include font into build content.

Include font into build content.


@ECHO OFF
setlocal
call "%~dp0vars.cmd"
bundle exec ruhoh publish github

@ECHO OFF
setlocal
call "%~dp0vars.cmd"
echo.
echo ===========================================================
echo Please be sure that all directories and files are unlocked before continuing.
echo This is running in %CD%
pause
bundle exec ruhoh publish github

Update publish_github.cmd

Update publish_github.cmd

Warn before publishing


IF  "%1"=="" (
	SET _VERSION_="0.0"
) ELSE (
	SET _VERSION_=%1
)

IF  "%2"=="" (
	SET _FULLVERSION_=%_VERSION_%
) ELSE (
	SET _SEMANTIC_=%2
	SET _FULLVERSION_=%_VERSION_%-%_SEMANTIC_%
)

IF EXIST _TempNugets rd /q /s _TempNugets

md _TempNugets

powershell.exe -ExecutionPolicy Bypass -Command .\UpdateVersionFiles.ps1 %_VERSION_% %_SEMANTIC_%

call build.bat waslibs.sln

.nuget\nuget.exe pack src\AppStudio.DataProviders\AppStudio.DataProviders.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release
.nuget\nuget.exe pack src\AppStudio.Common\AppStudio.Common.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release

call build.bat waslibs.controls.sln /p:NuGetPackagesDirectory=_TempNugets
.nuget\nuget.exe pack src\AppStudio.Controls\AppStudio.Controls.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_%  -Prop Configuration=Release

IF  "%1"=="" (
	SET _VERSION_="0.0"
) ELSE (
	SET _VERSION_=%1
)

IF  "%2"=="" (
	SET _FULLVERSION_=%_VERSION_%
) ELSE (
	SET _SEMANTIC_=%2
	SET _FULLVERSION_=%_VERSION_%-%_SEMANTIC_%
)

IF EXIST _TempNugets del /q /s _TempNugets\WindowsAppStudio*

IF NOT EXIST _TempNugets md _TempNugets

REM powershell.exe -ExecutionPolicy Bypass -Command .\UpdateVersionFiles.ps1 %_VERSION_% %_SEMANTIC_%

call build.bat waslibs.sln

.nuget\nuget.exe pack src\AppStudio.DataProviders\AppStudio.DataProviders.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release
.nuget\nuget.exe pack src\AppStudio.Common\AppStudio.Common.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release

.nuget\nuget.exe restore -Source %cd%\_TempNugets waslibs.Controls.sln
build waslibs.controls.sln
.nuget\nuget.exe pack src\AppStudio.Controls\AppStudio.Controls.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_%  -Prop Configuration=Release

update build script

update build script


IF  "%1"=="" (
	GOTO HELL
) ELSE (
	SET _VERSION_=%1
)

IF  "%2"=="" (
	SET _FULLVERSION_=%_VERSION_%
) ELSE (
	SET _FULLVERSION_=%_VERSION_%-%2%
)

IF EXIST _TempNugets del /q /s _TempNugets\WindowsAppStudio*

IF NOT EXIST _TempNugets md _TempNugets

powershell.exe -ExecutionPolicy Bypass -Command .\UpdateVersionFiles.ps1 %_VERSION_% %_SEMANTIC_%

call build.bat waslibs.sln

.nuget\nuget.exe pack src\AppStudio.DataProviders\AppStudio.DataProviders.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release
.nuget\nuget.exe pack src\AppStudio.Common\AppStudio.Common.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release

.nuget\nuget.exe restore -Source %cd%\_TempNugets waslibs.Controls.sln
call build.bat waslibs.controls.sln
.nuget\nuget.exe pack src\AppStudio.Controls\AppStudio.Controls.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_%  -Prop Configuration=Release

IF "%3"=="" (
	  ECHO NUGET Key not found. Not publishing
) ELSE (
	.nuget\nuget.exe push _TempNugets\AppStudio.DataProviders.%_FULLVERSION_%.nupkg %3
	.nuget\nuget.exe push _TempNugets\AppStudio.Common.%_FULLVERSION_%.nupkg %3
	.nuget\nuget.exe push _TempNugets\AppStudio.Controls.%_FULLVERSION_%.nupkg %3
)

GOTO END

:HELL
ECHO VERSION NOT FOUND

:END
ECHO PROCESS FINISHED

IF  "%1"=="" (
	GOTO HELL
) ELSE (
	SET _VERSION_=%1
)

IF  "%2"=="" (
	SET _FULLVERSION_=%_VERSION_%
) ELSE (
	SET _FULLVERSION_=%_VERSION_%-%2%
)

IF EXIST _TempNugets del /q /s _TempNugets\WindowsAppStudio*

IF NOT EXIST _TempNugets md _TempNugets

powershell.exe -ExecutionPolicy Bypass -Command .\UpdateVersionFiles.ps1 %_VERSION_% %_SEMANTIC_%

call build.bat waslibs.sln

.nuget\nuget.exe pack src\AppStudio.DataProviders\AppStudio.DataProviders.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release
.nuget\nuget.exe pack src\AppStudio.Common\AppStudio.Common.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_% -Prop Configuration=Release

.nuget\nuget.exe restore -Source %cd%\_TempNugets waslibs.Controls.sln
call build.bat waslibs.controls.sln
.nuget\nuget.exe pack src\AppStudio.Controls\AppStudio.Controls.nuspec -OutPutDirectory _TempNugets -Version %_FULLVERSION_%  -Prop Configuration=Release

IF "%3"=="" (
	  ECHO NUGET Key not found. Not publishing
) ELSE (
	.nuget\nuget.exe push _TempNugets\WindowsAppStudio.DataProviders.%_FULLVERSION_%.nupkg %3
	.nuget\nuget.exe push _TempNugets\WindowsAppStudio.Common.%_FULLVERSION_%.nupkg %3
	.nuget\nuget.exe push _TempNugets\WindowsAppStudio.Controls.%_FULLVERSION_%.nupkg %3
)

GOTO END

:HELL
ECHO VERSION NOT FOUND

:END
git add .
git commit -m "Created version %_FULLVERSION_%"
git tag v%_FULLVERSION_%
git push
ECHO PROCESS FINISHED

tag version after build

tag version after build


if not exist ..\.publish\ mkdir ..\.publish\

..\.nuget\nuget.exe pack ..\src\MVC\MVC.fsproj -OutputDirectory ..\.publish\

..\.nuget\nuget.exe pack ..\src\Web.Angular.Bootstrap2\Web.Angular.Bootstrap2.csproj -Exclude **\*.dll -OutputDirectory ..\.publish\

if not exist ..\.publish\ mkdir ..\.publish\

..\.nuget\nuget.exe pack ..\src\MVC\MVC.fsproj -OutputDirectory ..\.publish\

..\.nuget\nuget.exe pack ..\src\Web.Angular.Bootstrap\Web.Angular.Bootstrap.csproj -Exclude **\*.dll -OutputDirectory ..\.publish\

fix nuget bat file

fix nuget bat file


REM Startup of commonly used applications
taskkill /F /IM iexplore.exe
sleep 3
start outlook
start explorer \\domain\Your Name\My Documents
start iexplore "http://www.theseleniumguys.com"

REM Shutdown of items to clear the workspace
taskkill /F /IM outlook.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM explorer.exe
sleep 3
start explorer.exe

Create startAndStop.bat

Create startAndStop.bat


@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel

xcopy /Y conemu.xml %appdata%\Roaming\ConEmu.xml

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel

copy /Y conemu.xml %appdata%\Roaming\ConEmu.xml

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

Use `copy` instead of `xcopy` to copy single file


set name="%1"
set src=%~2
set pub=%~2..\..\..\..\pub

echo Copy from %src%
echo Copy to %pub%

if not exist "%pub%" mkdir "%pub%"

:: xcopy "$(TargetDir)*" "$(SolutionDir)..\pub\$(TargetName)\" /D /Y /S

 xcopy "%src%*.exe" "%pub%" /D /Y /S
 xcopy "%src%*.dll" "%pub%" /D /Y /S
 xcopy "%src%*.config" "%pub%" /D /Y /S

 xcopy "%src%*.ids" "%pub%" /D /Y /S

set name="%1"
set src=%~2
set pub=%~2..\..\..\..\pub\
set archiv=%pub%\com-kit_%APPVEYOR_BUILD_NUMBER%.zip

echo Copy from %src%
echo Copy to %pub%

if not exist "%pub%" mkdir "%pub%"

:: xcopy "$(TargetDir)*" "$(SolutionDir)..\pub\$(TargetName)\" /D /Y /S

 ::xcopy "%src%*.exe" "%pub%" /D /Y /S
 ::xcopy "%src%*.dll" "%pub%" /D /Y /S
 ::xcopy "%src%*.config" "%pub%" /D /Y /S

 ::xcopy "%src%*.ids" "%pub%" /D /Y /S

pushd "%src%"

7z a "%archiv%" "*.exe"
7z a "%archiv%" "*.dll"
7z a "%archiv%" "*.config"

7z a "%archiv%" "*.ids" -r

popd

Make zip archive from release

Make zip archive from release


bjam -sICU_PATH=C:\boost\icu -sICU_LINK="/LIBPATH:C:\boost\icu\lib64 icuuc.lib icuin.lib icudt.lib" --toolset=msvc-14.0 address-model=64 --build-type=complete stage

build boost with icu

build boost with icu


@echo off

REM ---------------------------------------------------------------------------
REM   Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) 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 ---------------------------------------------------------------------------
rem Main Script for WSO2 Carbon
rem
rem Environment Variable Prequisites
rem
rem   CARBON_HOME   Home of CARBON installation. If not set I will  try
rem                   to figure it out.
rem
rem   RUNTIME_HOME  Home of WSO2 Carbon Runtime.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------
:checkJava

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto checkServer

:noJavaHome
echo "You must set the JAVA_HOME variable before running CARBON."
goto end

rem ----- Only set CARBON_HOME if not already set ----------------------------
:checkServer
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..\..\..
SET curDrive=%cd:~0,1%
SET wsasDrive=%CARBON_HOME:~0,1%
if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:

rem ----- Only set RUNTIME_HOME if not already set ----------------------------
:setRuntimeHome
setlocal
if "%RUNTIME_HOME%"=="" set RUNTIME_HOME=%~sdp0..
rem --- derive RUNTIME NAME from the RUNTIME_HOME path.
cd /d %RUNTIME_HOME%
set path1=%cd%
cd ..
set path2=%cd%
call set "RUNTIME=%%path1:%path2%\=%%"

rem find CARBON_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if not exist "%CARBON_HOME%\bin\kernel-version.txt" goto noServerHome

goto updateClasspath

:noServerHome
echo CARBON_HOME is set incorrectly or CARBON_HOME could not be located. Please set CARBON_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath

setlocal EnableDelayedExpansion
cd %RUNTIME_HOME%
set CARBON_CLASSPATH=
FOR %%C in ("%CARBON_HOME%\bin\bootstrap\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\bootstrap\%%~nC%%~xC"

set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;

FOR %%D in ("%CARBON_HOME%\bin\bootstrap\commons-lang*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\bootstrap\%%~nD%%~xD"

rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:setupArgs
if ""%1""=="""" goto doneStart

if ""%1""==""-run""     goto commandLifecycle
if ""%1""==""--run""    goto commandLifecycle
if ""%1""==""run""      goto commandLifecycle

if ""%1""==""-restart""  goto commandLifecycle
if ""%1""==""--restart"" goto commandLifecycle
if ""%1""==""restart""   goto commandLifecycle

if ""%1""==""debug""    goto commandDebug
if ""%1""==""-debug""   goto commandDebug
if ""%1""==""--debug""  goto commandDebug

if ""%1""==""version""   goto commandVersion
if ""%1""==""-version""  goto commandVersion
if ""%1""==""--version"" goto commandVersion

shift
goto setupArgs

rem ----- commandVersion -------------------------------------------------------
:commandVersion
shift
type "%CARBON_HOME%\bin\kernel-version.txt"
goto end

rem ----- commandDebug ---------------------------------------------------------
:commandDebug
shift
set DEBUG_PORT=%1
if "%DEBUG_PORT%"=="" goto noDebugPort
if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option.
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
echo Please start the remote debugging client to continue...
goto findJdk

:noDebugPort
echo Please specify the debug port after the --debug option
goto end

rem ----- commandLifecycle -----------------------------------------------------
:commandLifecycle
goto findJdk

:doneStart
if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

rem ---------- Handle the SSL Issue with proper JDK version --------------------
rem find the version of the jdk
:findJdk

set CMD=RUN %*

:checkJdk16
"%JAVA_HOME%\bin\java" -version 2>&1 | findstr /r "1.[8] 11.[0]" >NUL
IF ERRORLEVEL 1 goto unknownJdk
goto jdk16

:unknownJdk
echo Starting WSO2 Carbon (in unsupported JDK)
echo [ERROR] CARBON is supported only on JDK 1.8 and 11
goto jdk16

:jdk16
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer
cd %RUNTIME_HOME%

rem ---------- Add jars to classpath ----------------

set CARBON_CLASSPATH="%CARBON_HOME%\bin\bootstrap\*";%CARBON_CLASSPATH%

PATH %PATH%;%JAVA_HOME%\bin\
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "jver=%%j%%k%%l%%m"

set JAVA_VER_BASED_OPTS

set JAVA_ENDORSED="%CARBON_HOME%\bin\bootstrap\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"

if %jver% LSS 11000 set JAVA_VER_BASED_OPTS="-Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"

set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%RUNTIME_HOME%\logs\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% %JAVA_VER_BASED_OPTS% -Dcarbon.home="%CARBON_HOME%" -Dwso2.runtime.path="%RUNTIME_HOME%" -Dwso2.runtime="%RUNTIME%" -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dcarbon.classpath=%CARBON_CLASSPATH% -Dfile.encoding=UTF8

:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%
echo RUNTIME_HOME environment variable is set to %RUNTIME_HOME%
echo RUNTIME environment variable is set to %RUNTIME%
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.wso2.carbon.launcher.Main %CMD%
if "%ERRORLEVEL%"=="121" goto runJava
:end
goto endlocal

:endlocal

:END

Add eof

Add eof


:: Copyright 2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Build

del /s *.o *.a *.lo *.la *.lai *.Plo >> nul 2>&1
sh -x "./configure"
mingw32-make MAKE=C:\w\mingw64\bin\mingw32-make

:: Make steps for determinism

if exist .libs\*.a strip -p --enable-deterministic-archives -g .libs\*.a

touch -c .libs/*.a -r Changes

popd
endlocal

:: Copyright 2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Build

set > env_env.txt

del /s *.o *.a *.lo *.la *.lai *.Plo >> nul 2>&1
sh -x "./configure"
mingw32-make MAKE=C:\w\mingw64\bin\mingw32-make

:: Make steps for determinism

if exist .libs\*.a strip -p --enable-deterministic-archives -g .libs\*.a

touch -c .libs/*.a -r Changes

popd
endlocal

save env to compare it with working RDP env


@echo off
REM Creates the canonical library files for samples in this repo
REM Such samples acquire these files by copying them from here.
REM This command file makes the canonical files by copying them from
REM their home locations in related repositories (e.g.
REM breeze.js, breeze.js.labs, and breeze.server.labs)
REM which must be available on this machine as sibling directories
REM to the breeze.js.samples repository

if not exist "%1js" MKDIR "%1js"
if not exist "%1js.adapters" MKDIR "%1js.adapters"
if not exist "%1js.labs" MKDIR "%1js.labs"
if not exist "%1server.labs" MKDIR "%1server.labs"

echo Copying breeze client files into the breeze.js.samples repo
@echo on
XCOPY "%1..\..\..\breeze.js\build\*.js" "%1js" /Y

XCOPY "%1..\..\..\breeze.js\src\breeze.dataService.mongo.js" "%1js.adapters" /Y

XCOPY "%1..\..\..\breeze.js.labs\*.js" "%1js.labs" /Y
XCOPY "%1..\..\..\breeze.js.labs\*.css" "%1js.labs" /Y

XCOPY "%1..\..\..\breeze.server.labs\*.cs" "%1server.labs" /Y

REM Exclude certain files
DEL "%1js.labs\breeze.to$q.shim.js" 2>nul

pause

@echo off
REM Creates the canonical library files for samples in this repo
REM Such samples acquire these files by copying them from here.
REM This command file makes the canonical files by copying them from
REM their home locations in related repositories (e.g.
REM breeze.js, breeze.js.labs, and breeze.server.labs)
REM which must be available on this machine as sibling directories
REM to the breeze.js.samples repository

if not exist "%1js" MKDIR "%1js"
if not exist "%1js.adapters" MKDIR "%1js.adapters"
if not exist "%1js.labs" MKDIR "%1js.labs"
if not exist "%1server.labs" MKDIR "%1server.labs"

echo Copying breeze client files into the breeze.js.samples repo
@echo on
XCOPY "%1..\..\..\breeze.js\build\*.js" "%1js" /Y

XCOPY "%1..\..\..\breeze.js\src\breeze.dataService.mongo.js" "%1js.adapters" /Y

XCOPY "%1..\..\..\breeze.js.labs\*.js" "%1js.labs" /Y
XCOPY "%1..\..\..\breeze.js.labs\*.css" "%1js.labs" /Y

XCOPY "%1..\..\..\breeze.server.labs\*.cs" "%1server.labs" /Y

REM Exclude certain files
DEL "%1js.labs\breeze.to$q.shim.js" 2>nul
DEL "%1js\gulpfile.js" 2>nul

pause

getLibs.cmd: exclude gulpfile.js from the imported js files