@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

if not defined PACKER_SEARCH_PATHS set PACKER_SEARCH_PATHS="%USERPROFILE%" a: b: c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:
if not defined SEVENZIP_32_URL set SEVENZIP_32_URL=http://downloads.sourceforge.net/sevenzip/7z938.msi
if not defined SEVENZIP_64_URL set SEVENZIP_64_URL=http://downloads.sourceforge.net/sevenzip/7z938-x64.msi
if not defined VBOX_ISO_URL set VBOX_ISO_URL=http://download.virtualbox.org/virtualbox/4.3.22/VBoxGuestAdditions_4.3.22.iso
if not defined VMWARE_TOOLS_TAR_URL set VMWARE_TOOLS_TAR_URL=https://softwareupdate.vmware.com/cds/vmw-desktop/ws/11.1.0/2496824/windows/packages/tools-windows-9.9.2.exe.tar
goto main

::::::::::::
:install_sevenzip
::::::::::::
if defined ProgramFiles(x86) (
  set SEVENZIP_URL=%SEVENZIP_64_URL%
) else (
  set SEVENZIP_URL=%SEVENZIP_32_URL%
)
pushd .
set SEVENZIP_EXE=
set SEVENZIP_DLL=
for %%i in (7z.exe) do set SEVENZIP_EXE=%%~$PATH:i
if defined SEVENZIP_EXE goto return0
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined SEVENZIP_EXE @if exist "%%~i\7z.exe" set SEVENZIP_EXE=%%~i\7z.exe
if not defined SEVENZIP_EXE goto get_sevenzip
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined SEVENZIP_DLL @if exist "%%~i\7z.dll" set SEVENZIP_DLL=%%~i\7z.dll
if not defined SEVENZIP_DLL goto get_sevenzip
ver >nul
call :copy_sevenzip
if not errorlevel 1 goto return0

:get_sevenzip
for %%i in ("%SEVENZIP_URL%") do set SEVENZIP_MSI=%%~nxi
set SEVENZIP_DIR=%TEMP%\sevenzip
set SEVENZIP_PATH=%SEVENZIP_DIR%\%SEVENZIP_MSI%
echo ==^> Creating "%SEVENZIP_DIR%"
mkdir "%SEVENZIP_DIR%"
cd /d "%SEVENZIP_DIR%"
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%SEVENZIP_URL%" "%SEVENZIP_PATH%"
) else (
  echo ==^> Downloading "%SEVENZIP_URL%" to "%SEVENZIP_PATH%"
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SEVENZIP_URL%', '%SEVENZIP_PATH%')" <NUL
)
if not exist "%SEVENZIP_PATH%" goto return1
echo ==^> Installing "%SEVENZIP_PATH%"
msiexec /qb /i "%SEVENZIP_PATH%"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%SEVENZIP_PATH%"
ver>nul
if exist "%ProgramFiles%\7-Zip" cd /D "%ProgramFiles%\7-Zip" & goto find_sevenzip
if defined ProgramFiles(x86) if exist "%ProgramFiles(x86)%\7-Zip" cd /D "%ProgramFiles(x86)%\7-Zip" & goto find_sevenzip
echo ==^> ERROR: Directory not found: "%ProgramFiles%\7-Zip"
goto return1

:find_sevenzip
set SEVENZIP_EXE=
for /r %%i in (7z.exe) do if exist "%%~i" set SEVENZIP_EXE=%%~i
if not exist "%SEVENZIP_EXE%" echo ==^> ERROR: Failed to unzip "%SEVENZIP_PATH%" & goto return1
set SEVENZIP_DLL=
for /r %%i in (7z.dll) do if exist "%%~i" set SEVENZIP_DLL=%%~i
if not exist "%SEVENZIP_DLL%" echo ==^> ERROR: Failed to unzip "%SEVENZIP_PATH%" & goto return1

:copy_sevenzip
echo ==^> Copying "%SEVENZIP_EXE%" to "%SystemRoot%"
copy /y "%SEVENZIP_EXE%" "%SystemRoot%\" || goto return1
copy /y "%SEVENZIP_DLL%" "%SystemRoot%\" || goto return1

:return0
popd
ver>nul
goto return

:return1
popd
verify other 2>nul

:return
goto :eof

::::::::::::
:main
::::::::::::
echo "%PACKER_BUILDER_TYPE%" | findstr /i "vmware" >nul
if not errorlevel 1 goto vmware
echo "%PACKER_BUILDER_TYPE%" | findstr /i "virtualbox" >nul
if not errorlevel 1 goto virtualbox
echo "%PACKER_BUILDER_TYPE%" | findstr /i "parallels" >nul
if not errorlevel 1 goto parallels
echo ==^> ERROR: Unknown PACKER_BUILDER_TYPE: "%PACKER_BUILDER_TYPE%"
pushd .
goto exit1

::::::::::::
:vmware
::::::::::::
if defined ProgramFiles(x86) (
  set VMWARE_TOOLS_SETUP_EXE=setup64.exe
) else (
  set VMWARE_TOOLS_SETUP_EXE=setup.exe
)
for %%i in ("%VMWARE_TOOLS_TAR_URL%") do set VMWARE_TOOLS_TAR=%%~nxi
set VMWARE_TOOLS_DIR=%TEMP%\vmware
set VMWARE_TOOLS_TAR_PATH=%VMWARE_TOOLS_DIR%\%VMWARE_TOOLS_TAR%
set VMWARE_TOOLS_ISO=windows.iso
mkdir "%VMWARE_TOOLS_DIR%"
pushd "%VMWARE_TOOLS_DIR%"
set VMWARE_TOOLS_SETUP_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VMWARE_TOOLS_SETUP_PATH @if exist "%%~i\VMwareToolsUpgrader.exe" set VMWARE_TOOLS_SETUP_PATH=%%~i\%VMWARE_TOOLS_SETUP_EXE%
if defined VMWARE_TOOLS_SETUP_PATH goto install_vmware_tools
set VMWARE_TOOLS_ISO_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VMWARE_TOOLS_ISO_PATH @if exist "%%~i\%VMWARE_TOOLS_ISO%" set VMWARE_TOOLS_ISO_PATH=%%~i\%VMWARE_TOOLS_ISO%
if defined VMWARE_TOOLS_ISO_PATH goto install_vmware_tools_from_iso
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%VMWARE_TOOLS_TAR_URL%" "%VMWARE_TOOLS_TAR_PATH%"
) else (
  echo ==^> Downloading "%VMWARE_TOOLS_TAR_URL%" to "%VMWARE_TOOLS_TAR_PATH%"
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%VMWARE_TOOLS_TAR_URL%', '%VMWARE_TOOLS_TAR_PATH%')" <NUL
)
if not exist "%VMWARE_TOOLS_TAR_PATH%" goto exit1
call :install_sevenzip
if errorlevel 1 goto exit1
7z e -y -o"%VMWARE_TOOLS_DIR%" "%VMWARE_TOOLS_TAR_PATH%" tools-windows-*.exe
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e "%VMWARE_TOOLS_TAR_PATH%"
ver>nul
set VMWARE_TOOLS_INSTALLER_PATH=
for %%i in (tools-windows-*.exe) do set VMWARE_TOOLS_INSTALLER_PATH=%CD%\%%~i
if not exist "%VMWARE_TOOLS_INSTALLER_PATH%" echo ==^> ERROR: Failed to unzip "%VMWARE_TOOLS_TAR_PATH%" & goto exit1
"%VMWARE_TOOLS_INSTALLER_PATH%" /s
set VMWARE_TOOLS_PROGRAM_FILES_DIR=%ProgramFiles%\VMware
if defined ProgramFiles(x86) set VMWARE_TOOLS_PROGRAM_FILES_DIR=%ProgramFiles(x86)%\VMware
if not exist "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" echo ==^> ERROR: Directory not found: "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" & goto exit1
set VMWARE_TOOLS_PROGRAM_FILES_ISO=
for /r "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" %%i in (%VMWARE_TOOLS_ISO%) do if exist "%%~i" set VMWARE_TOOLS_PROGRAM_FILES_ISO=%%~i
if not exist "%VMWARE_TOOLS_PROGRAM_FILES_ISO%" echo ==^> ERROR: File not found: "%VMWARE_TOOLS_ISO%" in "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" & goto exit1
set VMWARE_TOOLS_ISO_PATH="%VMWARE_TOOLS_DIR%\%VMWARE_TOOLS_ISO%"
copy /y "%VMWARE_TOOLS_PROGRAM_FILES_ISO%" "%VMWARE_TOOLS_ISO_PATH%"
if not exist "%VMWARE_TOOLS_ISO_PATH%" echo ==^> ERROR: File not found: "%VMWARE_TOOLS_ISO_PATH%" & goto exit1
rmdir /q /s "%VMWARE_TOOLS_PROGRAM_FILES_DIR%\tools-windows" || ver>nul
rmdir "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" || ver>nul

:install_vmware_tools_from_iso
call :install_sevenzip
if errorlevel 1 goto exit1
echo ==^> Extracting the VMWare Tools installer
7z e -o"%VMWARE_TOOLS_DIR%" "%VMWARE_TOOLS_ISO_PATH%" "%VMWARE_TOOLS_SETUP_EXE%"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e -o"%VMWARE_TOOLS_DIR%" "%VMWARE_TOOLS_ISO_PATH%" "%VMWARE_TOOLS_SETUP_EXE%"
ver>nul
set VMWARE_TOOLS_SETUP_PATH=%VMWARE_TOOLS_DIR%\%VMWARE_TOOLS_SETUP_EXE%
if not exist "%VMWARE_TOOLS_SETUP_PATH%" echo ==^> Unable to unzip "%VMWARE_TOOLS_ISO_PATH%" & goto exit1

:install_vmware_tools
echo ==^> Installing VMware tools
"%VMWARE_TOOLS_SETUP_PATH%" /S /v "/qn REBOOT=R ADDLOCAL=ALL"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%VMWARE_TOOLS_SETUP_PATH%" /S /v "/qn REBOOT=R ADDLOCAL=ALL"
ver>nul
goto exit0

::::::::::::
:virtualbox
::::::::::::
if exist "%SystemDrive%\Program Files (x86)" (
  set VBOX_SETUP_EXE=VBoxWindowsAdditions-amd64.exe
) else (
  set VBOX_SETUP_EXE=VBoxWindowsAdditions-x86.exe
)
for %%i in ("%VBOX_ISO_URL%") do set VBOX_ISO=%%~nxi
set VBOX_ISO_DIR=%TEMP%\vmware
set VBOX_ISO_PATH=%VBOX_ISO_DIR%\%VBOX_ISO%
set VBOX_ISO=VBoxGuestAdditions.iso
mkdir "%VBOX_ISO_DIR%"
pushd "%VBOX_ISO_DIR%"
set VBOX_SETUP_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VBOX_SETUP_PATH @if exist "%%~i\%VBOX_SETUP_EXE%" set VBOX_SETUP_PATH=%%~i\%VBOX_SETUP_EXE%
if defined VBOX_SETUP_PATH goto install_vbox_guest_additions
set VBOX_ISO_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VBOX_ISO_PATH @if exist "%%~i\%VBOX_ISO%" set VBOX_ISO_PATH=%%~i\%VBOX_ISO%
if defined VBOX_ISO_PATH goto install_vbox_guest_additions_from_iso
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%VBOX_ISO_URL%" "%VBOX_ISO_PATH%"
) else (
  echo ==^> Downloading "%VBOX_ISO_URL%" to "%VBOX_ISO_PATH%"
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%VBOX_ISO_URL%', '%VBOX_ISO_PATH%')" <NUL
)
if not exist "%VBOX_ISO_PATH%" goto exit1

:install_vbox_guest_additions_from_iso
call :install_sevenzip
if errorlevel 1 goto exit1
echo ==^> Extracting the VirtualBox Guest Additions installer
7z e -o"%VBOX_ISO_DIR%" "%VBOX_ISO_PATH%" "%VBOX_SETUP_EXE%"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e -o"%VBOX_ISO_DIR%" "%VBOX_ISO_PATH%" "%VBOX_SETUP_EXE%"
ver>nul
set VBOX_SETUP_PATH=%VBOX_ISO_DIR%\%VBOX_SETUP_EXE%
if not exist "%VBOX_SETUP_PATH%" echo ==^> Unable to unzip "%VBOX_ISO_PATH%" & goto exit1

:install_vbox_guest_additions
if not exist a:\oracle-cert.cer echo ==^> ERROR: File not found: a:\oracle-cert.cer & goto exit1
echo ==^> Installing Oracle certificate to keep install silent
certutil -addstore -f "TrustedPublisher" a:\oracle-cert.cer
echo ==^> Installing VirtualBox Guest Additions
"%VBOX_SETUP_PATH%" /S
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%VBOX_SETUP_PATH%" /S
ver>nul
goto :exit0

::::::::::::
:parallels
::::::::::::
set PARALLELS_INSTALL=PTAgent.exe
REM parallels tools don't have a download :(
call :install_sevenzip
if errorlevel 1 goto exit1
echo ==^> Extracting the Parallels Tools installer
echo ==^>   to %TEMP%\parallels\*
7z x -o"%TEMP%\parallels" "%USERPROFILE%\prl-tools-win.iso"
ping 127.0.0.1
echo ==^> Installing Parallels Tools
echo ==^>   from %TEMP%\parallels\%PARALLELS_INSTALL%
"%TEMP%\parallels\%PARALLELS_INSTALL%" /install_silent
REM parallels tools installer tends to exit while the install agent
REM is still running, need to sleep while it's running so we don't
REM delete the tools.
@if errorlevel 1 echo=^> WARNING: Error %ERRORLEVEL% was returned by: "%PARALLELS_INSTALL%" /install_silent
ver>nul
echo ==^> Cleaning up Parallels Tools install
del /F /S /Q "%TEMP%\parallels"
echo ==^> Removing "%USERPROFILE%\prl-tools-win.iso"
del /F "%USERPROFILE%\prl-tools-win.iso"
goto :exit0

:exit0
popd
@ping 127.0.0.1
@ver>nul
@goto :exit

:exit1
popd
@ping 127.0.0.1
@verify other 2>nul

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

@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

if not defined PACKER_SEARCH_PATHS set PACKER_SEARCH_PATHS="%USERPROFILE%" a: b: c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:
if not defined SEVENZIP_32_URL set SEVENZIP_32_URL=http://downloads.sourceforge.net/sevenzip/7z938.msi
if not defined SEVENZIP_64_URL set SEVENZIP_64_URL=http://downloads.sourceforge.net/sevenzip/7z938-x64.msi
if not defined VBOX_ISO_URL set VBOX_ISO_URL=http://download.virtualbox.org/virtualbox/4.3.24/VBoxGuestAdditions_4.3.24.iso
if not defined VMWARE_TOOLS_TAR_URL set VMWARE_TOOLS_TAR_URL=https://softwareupdate.vmware.com/cds/vmw-desktop/ws/11.1.0/2496824/windows/packages/tools-windows-9.9.2.exe.tar
goto main

::::::::::::
:install_sevenzip
::::::::::::
if defined ProgramFiles(x86) (
  set SEVENZIP_URL=%SEVENZIP_64_URL%
) else (
  set SEVENZIP_URL=%SEVENZIP_32_URL%
)
pushd .
set SEVENZIP_EXE=
set SEVENZIP_DLL=
for %%i in (7z.exe) do set SEVENZIP_EXE=%%~$PATH:i
if defined SEVENZIP_EXE goto return0
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined SEVENZIP_EXE @if exist "%%~i\7z.exe" set SEVENZIP_EXE=%%~i\7z.exe
if not defined SEVENZIP_EXE goto get_sevenzip
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined SEVENZIP_DLL @if exist "%%~i\7z.dll" set SEVENZIP_DLL=%%~i\7z.dll
if not defined SEVENZIP_DLL goto get_sevenzip
ver >nul
call :copy_sevenzip
if not errorlevel 1 goto return0

:get_sevenzip
for %%i in ("%SEVENZIP_URL%") do set SEVENZIP_MSI=%%~nxi
set SEVENZIP_DIR=%TEMP%\sevenzip
set SEVENZIP_PATH=%SEVENZIP_DIR%\%SEVENZIP_MSI%
echo ==^> Creating "%SEVENZIP_DIR%"
mkdir "%SEVENZIP_DIR%"
cd /d "%SEVENZIP_DIR%"
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%SEVENZIP_URL%" "%SEVENZIP_PATH%"
) else (
  echo ==^> Downloading "%SEVENZIP_URL%" to "%SEVENZIP_PATH%"
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SEVENZIP_URL%', '%SEVENZIP_PATH%')" <NUL
)
if not exist "%SEVENZIP_PATH%" goto return1
echo ==^> Installing "%SEVENZIP_PATH%"
msiexec /qb /i "%SEVENZIP_PATH%"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%SEVENZIP_PATH%"
ver>nul
if exist "%ProgramFiles%\7-Zip" cd /D "%ProgramFiles%\7-Zip" & goto find_sevenzip
if defined ProgramFiles(x86) if exist "%ProgramFiles(x86)%\7-Zip" cd /D "%ProgramFiles(x86)%\7-Zip" & goto find_sevenzip
echo ==^> ERROR: Directory not found: "%ProgramFiles%\7-Zip"
goto return1

:find_sevenzip
set SEVENZIP_EXE=
for /r %%i in (7z.exe) do if exist "%%~i" set SEVENZIP_EXE=%%~i
if not exist "%SEVENZIP_EXE%" echo ==^> ERROR: Failed to unzip "%SEVENZIP_PATH%" & goto return1
set SEVENZIP_DLL=
for /r %%i in (7z.dll) do if exist "%%~i" set SEVENZIP_DLL=%%~i
if not exist "%SEVENZIP_DLL%" echo ==^> ERROR: Failed to unzip "%SEVENZIP_PATH%" & goto return1

:copy_sevenzip
echo ==^> Copying "%SEVENZIP_EXE%" to "%SystemRoot%"
copy /y "%SEVENZIP_EXE%" "%SystemRoot%\" || goto return1
copy /y "%SEVENZIP_DLL%" "%SystemRoot%\" || goto return1

:return0
popd
ver>nul
goto return

:return1
popd
verify other 2>nul

:return
goto :eof

::::::::::::
:main
::::::::::::
echo "%PACKER_BUILDER_TYPE%" | findstr /i "vmware" >nul
if not errorlevel 1 goto vmware
echo "%PACKER_BUILDER_TYPE%" | findstr /i "virtualbox" >nul
if not errorlevel 1 goto virtualbox
echo "%PACKER_BUILDER_TYPE%" | findstr /i "parallels" >nul
if not errorlevel 1 goto parallels
echo ==^> ERROR: Unknown PACKER_BUILDER_TYPE: "%PACKER_BUILDER_TYPE%"
pushd .
goto exit1

::::::::::::
:vmware
::::::::::::
if defined ProgramFiles(x86) (
  set VMWARE_TOOLS_SETUP_EXE=setup64.exe
) else (
  set VMWARE_TOOLS_SETUP_EXE=setup.exe
)
for %%i in ("%VMWARE_TOOLS_TAR_URL%") do set VMWARE_TOOLS_TAR=%%~nxi
set VMWARE_TOOLS_DIR=%TEMP%\vmware
set VMWARE_TOOLS_TAR_PATH=%VMWARE_TOOLS_DIR%\%VMWARE_TOOLS_TAR%
set VMWARE_TOOLS_ISO=windows.iso
mkdir "%VMWARE_TOOLS_DIR%"
pushd "%VMWARE_TOOLS_DIR%"
set VMWARE_TOOLS_SETUP_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VMWARE_TOOLS_SETUP_PATH @if exist "%%~i\VMwareToolsUpgrader.exe" set VMWARE_TOOLS_SETUP_PATH=%%~i\%VMWARE_TOOLS_SETUP_EXE%
if defined VMWARE_TOOLS_SETUP_PATH goto install_vmware_tools
set VMWARE_TOOLS_ISO_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VMWARE_TOOLS_ISO_PATH @if exist "%%~i\%VMWARE_TOOLS_ISO%" set VMWARE_TOOLS_ISO_PATH=%%~i\%VMWARE_TOOLS_ISO%
if defined VMWARE_TOOLS_ISO_PATH goto install_vmware_tools_from_iso
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%VMWARE_TOOLS_TAR_URL%" "%VMWARE_TOOLS_TAR_PATH%"
) else (
  echo ==^> Downloading "%VMWARE_TOOLS_TAR_URL%" to "%VMWARE_TOOLS_TAR_PATH%"
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%VMWARE_TOOLS_TAR_URL%', '%VMWARE_TOOLS_TAR_PATH%')" <NUL
)
if not exist "%VMWARE_TOOLS_TAR_PATH%" goto exit1
call :install_sevenzip
if errorlevel 1 goto exit1
7z e -y -o"%VMWARE_TOOLS_DIR%" "%VMWARE_TOOLS_TAR_PATH%" tools-windows-*.exe
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e "%VMWARE_TOOLS_TAR_PATH%"
ver>nul
set VMWARE_TOOLS_INSTALLER_PATH=
for %%i in (tools-windows-*.exe) do set VMWARE_TOOLS_INSTALLER_PATH=%CD%\%%~i
if not exist "%VMWARE_TOOLS_INSTALLER_PATH%" echo ==^> ERROR: Failed to unzip "%VMWARE_TOOLS_TAR_PATH%" & goto exit1
"%VMWARE_TOOLS_INSTALLER_PATH%" /s
set VMWARE_TOOLS_PROGRAM_FILES_DIR=%ProgramFiles%\VMware
if defined ProgramFiles(x86) set VMWARE_TOOLS_PROGRAM_FILES_DIR=%ProgramFiles(x86)%\VMware
if not exist "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" echo ==^> ERROR: Directory not found: "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" & goto exit1
set VMWARE_TOOLS_PROGRAM_FILES_ISO=
for /r "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" %%i in (%VMWARE_TOOLS_ISO%) do if exist "%%~i" set VMWARE_TOOLS_PROGRAM_FILES_ISO=%%~i
if not exist "%VMWARE_TOOLS_PROGRAM_FILES_ISO%" echo ==^> ERROR: File not found: "%VMWARE_TOOLS_ISO%" in "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" & goto exit1
set VMWARE_TOOLS_ISO_PATH="%VMWARE_TOOLS_DIR%\%VMWARE_TOOLS_ISO%"
copy /y "%VMWARE_TOOLS_PROGRAM_FILES_ISO%" "%VMWARE_TOOLS_ISO_PATH%"
if not exist "%VMWARE_TOOLS_ISO_PATH%" echo ==^> ERROR: File not found: "%VMWARE_TOOLS_ISO_PATH%" & goto exit1
rmdir /q /s "%VMWARE_TOOLS_PROGRAM_FILES_DIR%\tools-windows" || ver>nul
rmdir "%VMWARE_TOOLS_PROGRAM_FILES_DIR%" || ver>nul

:install_vmware_tools_from_iso
call :install_sevenzip
if errorlevel 1 goto exit1
echo ==^> Extracting the VMWare Tools installer
7z e -o"%VMWARE_TOOLS_DIR%" "%VMWARE_TOOLS_ISO_PATH%" "%VMWARE_TOOLS_SETUP_EXE%"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e -o"%VMWARE_TOOLS_DIR%" "%VMWARE_TOOLS_ISO_PATH%" "%VMWARE_TOOLS_SETUP_EXE%"
ver>nul
set VMWARE_TOOLS_SETUP_PATH=%VMWARE_TOOLS_DIR%\%VMWARE_TOOLS_SETUP_EXE%
if not exist "%VMWARE_TOOLS_SETUP_PATH%" echo ==^> Unable to unzip "%VMWARE_TOOLS_ISO_PATH%" & goto exit1

:install_vmware_tools
echo ==^> Installing VMware tools
"%VMWARE_TOOLS_SETUP_PATH%" /S /v "/qn REBOOT=R ADDLOCAL=ALL"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%VMWARE_TOOLS_SETUP_PATH%" /S /v "/qn REBOOT=R ADDLOCAL=ALL"
ver>nul
goto exit0

::::::::::::
:virtualbox
::::::::::::
if exist "%SystemDrive%\Program Files (x86)" (
  set VBOX_SETUP_EXE=VBoxWindowsAdditions-amd64.exe
) else (
  set VBOX_SETUP_EXE=VBoxWindowsAdditions-x86.exe
)
for %%i in ("%VBOX_ISO_URL%") do set VBOX_ISO=%%~nxi
set VBOX_ISO_DIR=%TEMP%\vmware
set VBOX_ISO_PATH=%VBOX_ISO_DIR%\%VBOX_ISO%
set VBOX_ISO=VBoxGuestAdditions.iso
mkdir "%VBOX_ISO_DIR%"
pushd "%VBOX_ISO_DIR%"
set VBOX_SETUP_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VBOX_SETUP_PATH @if exist "%%~i\%VBOX_SETUP_EXE%" set VBOX_SETUP_PATH=%%~i\%VBOX_SETUP_EXE%
if defined VBOX_SETUP_PATH goto install_vbox_guest_additions
set VBOX_ISO_PATH=
@for %%i in (%PACKER_SEARCH_PATHS%) do @if not defined VBOX_ISO_PATH @if exist "%%~i\%VBOX_ISO%" set VBOX_ISO_PATH=%%~i\%VBOX_ISO%
if defined VBOX_ISO_PATH goto install_vbox_guest_additions_from_iso
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%VBOX_ISO_URL%" "%VBOX_ISO_PATH%"
) else (
  echo ==^> Downloading "%VBOX_ISO_URL%" to "%VBOX_ISO_PATH%"
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%VBOX_ISO_URL%', '%VBOX_ISO_PATH%')" <NUL
)
if not exist "%VBOX_ISO_PATH%" goto exit1

:install_vbox_guest_additions_from_iso
call :install_sevenzip
if errorlevel 1 goto exit1
echo ==^> Extracting the VirtualBox Guest Additions installer
7z e -o"%VBOX_ISO_DIR%" "%VBOX_ISO_PATH%" "%VBOX_SETUP_EXE%"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: 7z e -o"%VBOX_ISO_DIR%" "%VBOX_ISO_PATH%" "%VBOX_SETUP_EXE%"
ver>nul
set VBOX_SETUP_PATH=%VBOX_ISO_DIR%\%VBOX_SETUP_EXE%
if not exist "%VBOX_SETUP_PATH%" echo ==^> Unable to unzip "%VBOX_ISO_PATH%" & goto exit1

:install_vbox_guest_additions
if not exist a:\oracle-cert.cer echo ==^> ERROR: File not found: a:\oracle-cert.cer & goto exit1
echo ==^> Installing Oracle certificate to keep install silent
certutil -addstore -f "TrustedPublisher" a:\oracle-cert.cer
echo ==^> Installing VirtualBox Guest Additions
"%VBOX_SETUP_PATH%" /S
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%VBOX_SETUP_PATH%" /S
ver>nul
goto :exit0

::::::::::::
:parallels
::::::::::::
set PARALLELS_INSTALL=PTAgent.exe
REM parallels tools don't have a download :(
call :install_sevenzip
if errorlevel 1 goto exit1
echo ==^> Extracting the Parallels Tools installer
echo ==^>   to %TEMP%\parallels\*
7z x -o"%TEMP%\parallels" "%USERPROFILE%\prl-tools-win.iso"
ping 127.0.0.1
echo ==^> Installing Parallels Tools
echo ==^>   from %TEMP%\parallels\%PARALLELS_INSTALL%
"%TEMP%\parallels\%PARALLELS_INSTALL%" /install_silent
REM parallels tools installer tends to exit while the install agent
REM is still running, need to sleep while it's running so we don't
REM delete the tools.
@if errorlevel 1 echo=^> WARNING: Error %ERRORLEVEL% was returned by: "%PARALLELS_INSTALL%" /install_silent
ver>nul
echo ==^> Cleaning up Parallels Tools install
del /F /S /Q "%TEMP%\parallels"
echo ==^> Removing "%USERPROFILE%\prl-tools-win.iso"
del /F "%USERPROFILE%\prl-tools-win.iso"
goto :exit0

:exit0
popd
@ping 127.0.0.1
@ver>nul
@goto :exit

:exit1
popd
@ping 127.0.0.1
@verify other 2>nul

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

Bump vbox version to 4.3.24

Bump vbox version to 4.3.24


Add build time

Add build time


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

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

setlocal EnableDelayedExpansion

set dotfilesDir=%~dp0
set backupDir=%USERPROFILE%\dotfiles_backup
set dotfiles=bashrc bash_profile config minttyrc zshenv puppet-lint.rc

:: add registry key for init.bat
if exist "%CLINK_DIR%" (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%dotfilesDir%init.bat&\"%%CLINK_DIR%%\clink\" inject --profile ~\clink" /f
) else (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f
)

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

IF %homeDir:~-1%==\ SET homeDir=%homeDir:~0,-1%

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

call:createSymLink "%dotfilesDir%config\readline\inputrc" "%homeDir%\.inputrc" "%backupDir%" true

set sublimeDir=%APPDATA%\Sublime Text 3\Packages
set backupDir=%sublimeDir%\dotfiles_backup

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\User" "%sublimeDir%\User" "%backupDir%" false
    call:createSymLink "%dotfilesDir%sublime\User (OS Settings)" "%sublimeDir%\User (OS Settings)" "%backupDir%" false
)

set vsCodeDir=%APPDATA%\Code
set backupDir=%vsCodeDir%\dotfiles_backup

if exist "%vsCodeDir%" (
    call:createSymLink "%dotfilesDir%vscode\User" "%vsCodeDir%\User" "%backupDir%" false
)

set backupDir=%USERPROFILE%\dotfiles_backup\atom
set atomfiles=config.cson init.coffee keymap.cson snippets.cson styles.less

for %%A in (%atomfiles%) DO (
    call:createSymLink "%dotfilesDir%\atom\%%A" "%homeDir%\.atom\%%A" "%backupDir%" true
)

PowerShell.exe -Command  "& Set-ExecutionPolicy RemoteSigned -Force"
PowerShell.exe -ExecutionPolicy RemoteSigned -File install-win.ps1 %dotfilesDir%Microsoft.PowerShell_profile.ps1

call install-open_here.bat

goto:EOF

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

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

goto:EOF

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

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

setlocal EnableDelayedExpansion

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

IF %homeDir:~-1%==\ SET homeDir=%homeDir:~0,-1%

set dotfilesDir=%~dp0
set backupDir=%homeDir%\dotfiles_backup
set dotfiles=bashrc bash_profile config minttyrc zshenv puppet-lint.rc

:: add registry key for init.bat
if exist "%CLINK_DIR%" (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%dotfilesDir%init.bat&\"%%CLINK_DIR%%\clink\" inject --profile ~\clink" /f
) else (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f
)

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

call:createSymLink "%dotfilesDir%config\readline\inputrc" "%homeDir%\.inputrc" "%backupDir%" true

set sublimeDir=%APPDATA%\Sublime Text 3\Packages
set backupDir=%sublimeDir%\dotfiles_backup

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\User" "%sublimeDir%\User" "%backupDir%" false
    call:createSymLink "%dotfilesDir%sublime\User (OS Settings)" "%sublimeDir%\User (OS Settings)" "%backupDir%" false
)

set vsCodeDir=%APPDATA%\Code
set backupDir=%vsCodeDir%\dotfiles_backup

if exist "%vsCodeDir%" (
    call:createSymLink "%dotfilesDir%vscode\User" "%vsCodeDir%\User" "%backupDir%" false
)

set backupDir=%homeDir%\dotfiles_backup\atom
set atomfiles=config.cson init.coffee keymap.cson snippets.cson styles.less

for %%A in (%atomfiles%) DO (
    call:createSymLink "%dotfilesDir%\atom\%%A" "%homeDir%\.atom\%%A" "%backupDir%" false
)

set backupDir=%homeDir%\dotfiles_backup\bin
set binfiles=stree.cmd

for %%A in (%binfiles%) DO (
    call:createSymLink "%dotfilesDir%\bin\%%A" "%homeDir%\bin\%%A" "%backupDir%" false
)

PowerShell.exe -Command  "& Set-ExecutionPolicy RemoteSigned -Force"
PowerShell.exe -ExecutionPolicy RemoteSigned -File install-win.ps1 %dotfilesDir%Microsoft.PowerShell_profile.ps1

call install-open_here.bat

goto:EOF

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

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

goto:EOF

Install binfiles too

Install binfiles too


@REM -----
@REM NOTE:
@REM -----
@REM The "npm" command must be in the PATH variable
@REM Requires node.js to be installed (https://nodejs.org/en/).
@REM
@REM The "mvn" command must be in the PATH variable
@REM Requires Maven to be installed (https://maven.apache.org/)
@REM
@REM The "lua" command must be in the PATH variable
@REM Requires Lua to be installed (http://luabinaries.sourceforge.net/download.html)
@REM
@REM The "7z.exe" command must be callable from "C:\Program Files\7-Zip\7z.exe"
@REM Requires 7-zip to be installed (https://www.7-zip.org/)

setlocal
SET oldDir=%CD%
SET projectPath="%~dp0.."

@REM rebuild the server
call "%~dp0build-server-with-app.cmd"
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

@REM Create the installation package for EEP
cd %projectPath%\lua\LUA
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

call lua ModellInstallation.lua
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

cd %oldDir%
endlocal

@REM -----
@REM NOTE:
@REM -----
@REM The "npm" command must be in the PATH variable
@REM Requires node.js to be installed (https://nodejs.org/en/).
@REM
@REM The "mvn" command must be in the PATH variable
@REM Requires Maven to be installed (https://maven.apache.org/)
@REM
@REM The "lua" command must be in the PATH variable
@REM Requires Lua to be installed (http://luabinaries.sourceforge.net/download.html)
@REM
@REM The "7z.exe" command must be callable from "C:\Program Files\7-Zip\7z.exe"
@REM Requires 7-zip to be installed (https://www.7-zip.org/)

setlocal
SET oldDir=%CD%
SET projectPath="%~dp0.."

@REM rebuild the server
call "%~dp0build-server-with-app.cmd"
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

xcopy %projectPath%\ak-eep-web-server\target\ak-eep-web.jar %projectPath%\lua\LUA\ak
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

@REM Create the installation package for EEP
cd %projectPath%\lua\LUA
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

call lua ModellInstallation.lua
IF %ERRORLEVEL% NEQ 0 (
    exit %ERRORLEVEL%
)

cd %oldDir%
endlocal

add eep-web-jar to the release

add eep-web-jar to the release


"%R%" CMD INSTALL --build . %R_ARGS%
IF %ERRORLEVEL% NEQ 0 exit /B 1

Update bld.bat

Update bld.bat


slink /psx /c @LINK.LNK,DISC/MAIN.CPE,DISC/MAIN.SYM,DISC/MAIN.MAP

Add PSX_SLINK.bat

Add PSX_SLINK.bat


echo off
setlocal enableextensions enabledelayedexpansion
call locatevc.bat %1 %2

cls

cl /c %ringcflags% ring.c  ^
ring_string.c ring_list.c ring_item.c ring_items.c ring_hashtable.c ring_general.c ring_state.c ring_scanner.c ring_parser.c ring_hashlib.c ring_vmgc.c ^
ring_stmt.c ring_expr.c ring_codegen.c ring_vm.c ring_vmexpr.c ring_vmvars.c ^
ring_vmlists.c ring_vmfuncs.c ring_api.c ring_vmoop.c ring_vmcui.c ^
ring_vmtrycatch.c ring_vmstrindex.c ring_vmjump.c ring_vmduprange.c ^
ring_vmperformance.c ring_vmexit.c ring_vmstackvars.c ring_vmstate.c ring_generallib_extension.c ring_math_extension.c ring_file_extension.c ring_os_extension.c ring_list_extension.c ring_refmeta_extension.c ^
ring_ext.c ring_dll_extension.c ring_objfile.c -I"..\include"

link  %ringldflags% /DLL /OUT:..\..\lib\ring.dll /SUBSYSTEM:CONSOLE,"%ringsubsystem%"  ring_string.obj ^
ring_list.obj ring_item.obj ring_items.obj ring_hashtable.obj ring_general.obj ring_state.obj ring_scanner.obj ring_parser.obj ring_hashlib.obj ring_vmgc.obj ^
ring_stmt.obj ring_expr.obj ring_codegen.obj ring_vm.obj ring_vmexpr.obj ring_vmvars.obj ^
ring_vmlists.obj ring_vmfuncs.obj ring_api.obj ring_vmoop.obj ring_vmcui.obj ^
ring_vmtrycatch.obj ring_vmstrindex.obj ring_vmjump.obj ring_vmduprange.obj ^
ring_vmperformance.obj ring_vmexit.obj ring_vmstackvars.obj ring_vmstate.obj ring_generallib_extension.obj ring_math_extension.obj ring_file_extension.obj ring_os_extension.obj ring_list_extension.obj ring_refmeta_extension.obj ^
ring_ext.obj ring_dll_extension.obj ring_objfile.obj

lib  /OUT:..\..\lib\ringstatic.lib ring_string.obj ^
ring_list.obj ring_item.obj ring_items.obj ring_hashtable.obj ring_general.obj ring_state.obj ring_scanner.obj ring_parser.obj ring_hashlib.obj ring_vmgc.obj ^
ring_stmt.obj ring_expr.obj ring_codegen.obj ring_vm.obj ring_vmexpr.obj ring_vmvars.obj ^
ring_vmlists.obj ring_vmfuncs.obj ring_api.obj ring_vmoop.obj ring_vmcui.obj ^
ring_vmtrycatch.obj ring_vmstrindex.obj ring_vmjump.obj ring_vmduprange.obj ^
ring_vmperformance.obj ring_vmexit.obj ring_vmstackvars.obj ring_vmstate.obj ring_generallib_extension.obj ring_math_extension.obj ring_file_extension.obj ring_os_extension.obj ring_list_extension.obj ring_refmeta_extension.obj ^
ring_ext.obj ring_dll_extension.obj ring_objfile.obj

copy ..\..\lib\ring.dll ..\..\bin\

cl %ringcflags% ring.c ..\..\lib\ring.lib -I"..\include" /link /SUBSYSTEM:CONSOLE,"%ringsubsystem%" /STACK:8388608 /OUT:..\..\bin\ring.exe

del *.obj

endlocal

echo off
setlocal enableextensions enabledelayedexpansion
call locatevc.bat %1 %2

cls

cl /c %ringcflags% ring.c  ^
rstring.c rlist.c ritem.c ritems.c rhtable.c general.c state.c scanner.c parser.c hashlib.c vmgc.c ^
stmt.c expr.c codegen.c vm.c vmexpr.c vmvars.c ^
vmlists.c vmfuncs.c ringapi.c vmoop.c vmcui.c ^
vmtry.c vmstr.c vmjump.c vmrange.c ^
vmperf.c vmexit.c vmstack.c vmstate.c genlib_e.c math_e.c file_e.c os_e.c list_e.c meta_e.c ^
ext.c dll_e.c objfile.c -I"..\include"

link  %ringldflags% /DLL /OUT:..\..\lib\ring.dll /SUBSYSTEM:CONSOLE,"%ringsubsystem%"  rstring.obj ^
rlist.obj ritem.obj ritems.obj rhtable.obj general.obj state.obj scanner.obj parser.obj hashlib.obj vmgc.obj ^
stmt.obj expr.obj codegen.obj vm.obj vmexpr.obj vmvars.obj ^
vmlists.obj vmfuncs.obj ringapi.obj vmoop.obj vmcui.obj ^
vmtry.obj vmstr.obj vmjump.obj vmrange.obj ^
vmperf.obj vmexit.obj vmstack.obj vmstate.obj genlib_e.obj math_e.obj file_e.obj os_e.obj list_e.obj meta_e.obj ^
ext.obj dll_e.obj objfile.obj

lib  /OUT:..\..\lib\ringstatic.lib rstring.obj ^
rlist.obj ritem.obj ritems.obj rhtable.obj general.obj state.obj scanner.obj parser.obj hashlib.obj vmgc.obj ^
stmt.obj expr.obj codegen.obj vm.obj vmexpr.obj vmvars.obj ^
vmlists.obj vmfuncs.obj ringapi.obj vmoop.obj vmcui.obj ^
vmtry.obj vmstr.obj vmjump.obj vmrange.obj ^
vmperf.obj vmexit.obj vmstack.obj vmstate.obj genlib_e.obj math_e.obj file_e.obj os_e.obj list_e.obj meta_e.obj ^
ext.obj dll_e.obj objfile.obj

copy ..\..\lib\ring.dll ..\..\bin\

cl %ringcflags% ring.c ..\..\lib\ring.lib -I"..\include" /link /SUBSYSTEM:CONSOLE,"%ringsubsystem%" /STACK:8388608 /OUT:..\..\bin\ring.exe

del *.obj

endlocal

Update language/src/buildvc.bat - Use new file names


@@echo off
setlocal

set SVNROOT=http://svn.python.org/projects
if "%PYTHON%" EQU "" set PYTHON=..\pcbuild\python
if "%HTMLHELP%" EQU "" set HTMLHELP=%ProgramFiles%\HTML Help Workshop\hhc.exe
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/sphinxext/patchlevel.py`) do set DISTVERSION=%%v

if "%1" EQU "" goto help
if "%1" EQU "html" goto build
if "%1" EQU "htmlhelp" goto build
if "%1" EQU "latex" goto build
if "%1" EQU "text" goto build
if "%1" EQU "suspicious" goto build
if "%1" EQU "linkcheck" goto build
if "%1" EQU "changes" goto build
if "%1" EQU "checkout" goto checkout
if "%1" EQU "update" goto update

:help
set this=%~n0
echo HELP
echo.
echo %this% checkout
echo %this% update
echo %this% html
echo %this% htmlhelp
echo %this% latex
echo %this% text
echo %this% suspicious
echo %this% linkcheck
echo %this% changes
echo.
goto end

:checkout
svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx
svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils
svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2
svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments
goto end

:update
svn update tools/sphinx
svn update tools/docutils
svn update tools/jinja2
svn update tools/pygments
goto end

:build
if not exist build mkdir build
if not exist build\%1 mkdir build\%1
if not exist build\doctrees mkdir build\doctrees
cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
goto end

:end

@@echo off
setlocal

set SVNROOT=http://svn.python.org/projects
if "%PYTHON%" EQU "" set PYTHON=..\pcbuild\python
if "%HTMLHELP%" EQU "" set HTMLHELP=%ProgramFiles%\HTML Help Workshop\hhc.exe
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/sphinxext/patchlevel.py`) do set DISTVERSION=%%v

if "%1" EQU "" goto help
if "%1" EQU "html" goto build
if "%1" EQU "htmlhelp" goto build
if "%1" EQU "latex" goto build
if "%1" EQU "text" goto build
if "%1" EQU "suspicious" goto build
if "%1" EQU "linkcheck" goto build
if "%1" EQU "changes" goto build
if "%1" EQU "checkout" goto checkout
if "%1" EQU "update" goto update

:help
set this=%~n0
echo HELP
echo.
echo %this% checkout
echo %this% update
echo %this% html
echo %this% htmlhelp
echo %this% latex
echo %this% text
echo %this% suspicious
echo %this% linkcheck
echo %this% changes
echo.
goto end

:checkout
svn co %SVNROOT%/external/Sphinx-0.6.1/sphinx tools/sphinx
svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils
svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2
svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments
goto end

:update
svn update tools/sphinx
svn update tools/docutils
svn update tools/jinja2
svn update tools/pygments
goto end

:build
if not exist build mkdir build
if not exist build\%1 mkdir build\%1
if not exist build\doctrees mkdir build\doctrees
cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
goto end

:end

Fix make.bat to match makefile changes

Fix make.bat to match makefile changes


echo "Building release..."

set RELEASE_DIR=release
set OUTPUT_DIR=%cd%\dependencies\release_files
set CURRENT_DIR=%cd%

set AMD64=%RELEASE_DIR%\amd64
set X86=%RELEASE_DIR%\x86

mkdir "%RELEASE_DIR%"

mkdir "%AMD64%"

mkdir "%X86%"

set VCARGS32="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
set VCARGS64="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"

call build_dependencies.bat %VCARGS64%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
call build_modsecurity.bat %VCARGS64%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

copy "%OUTPUT_DIR%\libapr-1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libapriconv-1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libaprutil-1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libcurl.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libxml2.dll" "%AMD64%"
copy "%OUTPUT_DIR%\lua5.1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\mlogc.exe" "%AMD64%"
copy "%OUTPUT_DIR%\ModSecurityIIS.dll" "%AMD64%"
copy "%OUTPUT_DIR%\pcre.dll" "%AMD64%"
copy "%OUTPUT_DIR%\zlib1.dll" "%AMD64%"

call build_dependencies.bat %VCARGS32%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
call build_modsecurity.bat %VCARGS32%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

copy "%OUTPUT_DIR%\libapr-1.dll" "%X86%"
copy "%OUTPUT_DIR%\libapriconv-1.dll" "%X86%"
copy "%OUTPUT_DIR%\libaprutil-1.dll" "%X86%"
copy "%OUTPUT_DIR%\libcurl.dll" "%X86%"
copy "%OUTPUT_DIR%\libxml2.dll" "%X86%"
copy "%OUTPUT_DIR%\lua5.1.dll" "%X86%"
copy "%OUTPUT_DIR%\mlogc.exe" "%X86%"
copy "%OUTPUT_DIR%\ModSecurityIIS.dll" "%X86%"
copy %OUTPUT_DIR%\pcre.dll "%X86%"
copy %OUTPUT_DIR%\zlib1.dll "%X86%"

:: copy %OUTPUT_DIR%\Installer.exe %RELEASE_DIR%
:: copy %OUTPUT_DIR%\ModSecurity.xml %RELEASE_DIR%
:: copy %OUTPUT_DIR%\owasp_csr.zip %RELEASE_DIR%
:: copy %OUTPUT_DIR%\README.txt %RELEASE_DIR%

exit /B 0

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@cd %CURRENT_DIR%
@exit /B 1

echo "Building release..."

set RELEASE_DIR=release
set OUTPUT_DIR=%cd%\dependencies\release_files
set CURRENT_DIR=%cd%

set AMD64=%RELEASE_DIR%\amd64
set X86=%RELEASE_DIR%\x86

mkdir "%RELEASE_DIR%"

mkdir "%AMD64%"

mkdir "%X86%"

set VCARGS32="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
set VCARGS64="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"

call build_dependencies.bat %VCARGS64%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
call build_modsecurity.bat %VCARGS64%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

copy "%OUTPUT_DIR%\libapr-1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libapriconv-1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libaprutil-1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libcurl.dll" "%AMD64%"
copy "%OUTPUT_DIR%\libxml2.dll" "%AMD64%"
copy "%OUTPUT_DIR%\lua5.1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\mlogc.exe" "%AMD64%"
copy "%OUTPUT_DIR%\ModSecurityIIS.dll" "%AMD64%"
copy "%OUTPUT_DIR%\pcre.dll" "%AMD64%"
copy "%OUTPUT_DIR%\zlib1.dll" "%AMD64%"
copy "%OUTPUT_DIR%\yajl.dll" "%AMD64%"

call build_dependencies.bat %VCARGS32%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
call build_modsecurity.bat %VCARGS32%
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

copy "%OUTPUT_DIR%\libapr-1.dll" "%X86%"
copy "%OUTPUT_DIR%\libapriconv-1.dll" "%X86%"
copy "%OUTPUT_DIR%\libaprutil-1.dll" "%X86%"
copy "%OUTPUT_DIR%\libcurl.dll" "%X86%"
copy "%OUTPUT_DIR%\libxml2.dll" "%X86%"
copy "%OUTPUT_DIR%\lua5.1.dll" "%X86%"
copy "%OUTPUT_DIR%\mlogc.exe" "%X86%"
copy "%OUTPUT_DIR%\ModSecurityIIS.dll" "%X86%"
copy "%OUTPUT_DIR%\pcre.dll" "%X86%"
copy "%OUTPUT_DIR%\zlib1.dll" "%X86%"
copy "%OUTPUT_DIR%\yajl.dll" "%X86%"

:: copy %OUTPUT_DIR%\Installer.exe %RELEASE_DIR%
:: copy %OUTPUT_DIR%\ModSecurity.xml %RELEASE_DIR%
:: copy %OUTPUT_DIR%\owasp_csr.zip %RELEASE_DIR%
:: copy %OUTPUT_DIR%\README.txt %RELEASE_DIR%

exit /B 0

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@cd %CURRENT_DIR%
@exit /B 1

Copy yajl.dll into release files folder

iis: Copy yajl.dll into release files folder

This will help the automagically release process


ECHO CREATING DEBRIEF REGISTRY

SET ICON_PATH=%~dp0\file_icons
SET FILE_COMMAND="%~dp0\DebriefNG.exe --launcher.openFile %%1 %%*"

SET FILE_APP=HKEY_CURRENT_USER\Software\Classes\Applications
SET FILE_EXT=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

:: Plot files Registration. (.dpf)
SET APP=DPF.exe
SET EXT=.dpf

REG DELETE %FILE_APP%\%APP% /F
REG DELETE %FILE_EXT%\%EXT% /F

REG ADD %FILE_APP%\%APP% /v FriendlyTypeName /t REG_SZ /d  "plot file"
REG ADD %FILE_APP%\%APP%\shell\open\command /t REG_SZ /d  %FILE_COMMAND%
REG ADD %FILE_APP%\%APP%\DefaultIcon /t REG_SZ /d  %ICON_PATH%\plot_file.ico
REG ADD %FILE_EXT%\%EXT% /v \"Application\" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F
::END Plot files registration

:: Sensor files Registration. (.dsf)

SET APP=DSF.exe
SET EXT=.dsf

REG DELETE %FILE_APP%\%APP% /F
REG DELETE %FILE_EXT%\%EXT% /F

REG ADD %FILE_APP%\%APP% /v FriendlyTypeName /t REG_SZ /d  "sensor file"
REG ADD %FILE_APP%\%APP%\DefaultIcon /t REG_SZ /d  %ICON_PATH%\sensor_file.ico
REG ADD %FILE_EXT%\%EXT% /v \"Application\" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F
::END Sensor files registration.

::Track File registration  (.rep)
SET APP=REP.exe
SET EXT=.rep

REG DELETE %FILE_APP%\%APP% /F
REG DELETE %FILE_EXT%\%EXT% /F

REG ADD %FILE_APP%\%APP% /v FriendlyTypeName /t REG_SZ /d  "track file"
REG ADD %FILE_APP%\%APP%\shell\open\command /t REG_SZ /d  %FILE_COMMAND%
REG ADD %FILE_APP%\%APP%\DefaultIcon /t REG_SZ /d  %ICON_PATH%\track_file.ico
REG ADD %FILE_EXT%\%EXT% /v \"Application\" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F

::End Track File registration

:: Adding Debrief.exe as a XML OpenWith application list.
REG ADD %FILE_EXT%\.xml\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\.xml\OpenWithList /v "MRUList" /t REG_SZ /d a /F
REG ADD %FILE_EXT%\.xml\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F
::End

@ECHO CREATING DEBRIEF REGISTRY
@ECHO OFF
SET ICON_PATH=%~dp0\file_icons
SET FILE_COMMAND="%~dp0\DebriefNG.exe --launcher.openFile %%1 %%*"

SET FILE_APP=HKEY_CURRENT_USER\Software\Classes\Applications
SET FILE_EXT=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

:: Plot files Registration. (.dpf)
SET APP=DPF.exe
SET EXT=.dpf

REG DELETE %FILE_APP%\%APP% /F
REG DELETE %FILE_EXT%\%EXT% /F

REG ADD %FILE_APP%\%APP% /v FriendlyTypeName /t REG_SZ /d  "Debrief Plot"
REG ADD %FILE_APP%\%APP%\shell\open\command /t REG_SZ /d  %FILE_COMMAND%
REG ADD %FILE_APP%\%APP%\DefaultIcon /t REG_SZ /d  %ICON_PATH%\plot_file.ico
REG ADD %FILE_EXT%\%EXT% /v \"Application\" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F
::END Plot files registration

:: Sensor files Registration. (.dsf)

SET APP=DSF.exe
SET EXT=.dsf

REG DELETE %FILE_APP%\%APP% /F
REG DELETE %FILE_EXT%\%EXT% /F

REG ADD %FILE_APP%\%APP% /v FriendlyTypeName /t REG_SZ /d  "Debrief Sensor Data"
REG ADD %FILE_APP%\%APP%\DefaultIcon /t REG_SZ /d  %ICON_PATH%\sensor_file.ico
REG ADD %FILE_EXT%\%EXT% /v \"Application\" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F
::END Sensor files registration.

::Track File registration  (.rep)
SET APP=REP.exe
SET EXT=.rep

REG DELETE %FILE_APP%\%APP% /F
REG DELETE %FILE_EXT%\%EXT% /F

REG ADD %FILE_APP%\%APP% /v FriendlyTypeName /t REG_SZ /d  "Debrief Track Data"
REG ADD %FILE_APP%\%APP%\shell\open\command /t REG_SZ /d  %FILE_COMMAND%
REG ADD %FILE_APP%\%APP%\DefaultIcon /t REG_SZ /d  %ICON_PATH%\track_file.ico
REG ADD %FILE_EXT%\%EXT% /v \"Application\" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\OpenWithList /v "a" /t REG_SZ /d %APP% /F
REG ADD %FILE_EXT%\%EXT%\UserChoice /v "ProgId" /t REG_SZ /d Applications\%APP% /F
::End Track File registration

tidy file descriptions

tidy file descriptions


SET RDIR=Effekseer150Win

rmdir %RDIR%
mkdir %RDIR%

echo Compile Editor

echo Copy application

mkdir %RDIR%\Tool

copy Dev\release\Effekseer.exe %RDIR%\Tool\.
copy Dev\release\Effekseer.exe.config %RDIR%\Tool\.
copy Dev\release\EffekseerCore.dll %RDIR%\Tool\.
copy Dev\release\EffekseerViewer.dll %RDIR%\Tool\.
copy Dev\release\IronPython.dll %RDIR%\Tool\.
copy Dev\release\IronPython.Modules.dll %RDIR%\Tool\.
copy Dev\release\Microsoft.Dynamic.dll %RDIR%\Tool\.
copy Dev\release\Microsoft.Scripting.dll %RDIR%\Tool\.
copy Dev\release\EffekseerMaterialEditor.exe %RDIR%\Tool\.
copy Dev\release\Viewer.dll %RDIR%\Tool\.
copy Dev\release\TinyCsvParser.dll %RDIR%\Tool\.

mkdir %RDIR%\Tool\scripts
mkdir %RDIR%\Tool\scripts\export
copy Dev\release\scripts\export\Default.cs %RDIR%\Tool\scripts\export\.

mkdir %RDIR%\Tool\tools
copy Dev\release\tools\fbxToEffekseerModelConverter.exe %RDIR%\Tool\tools\.
copy Dev\release\tools\mqoToEffekseerModelConverter.exe %RDIR%\Tool\tools\.

copy Dev\release\tools\EffekseerMaterialCompilerDX9.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerDX11.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerDX12.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerGL.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerMetal.dll %RDIR%\Tool\tools\.

mkdir %RDIR%\Tool\resources
robocopy Dev\release\resources\ %RDIR%\Tool\resources\. /s

echo Sample

mkdir %RDIR%\Sample
robocopy Release\Sample %RDIR%\Sample *.efkproj *.efkmodel *.efkmat *.efkefc *.txt *.png *.mqo *.fbx /S
robocopy ResourceData\samples %RDIR%\Sample *.efkproj *.efkmodel *.efkmat *.efkefc *.txt *.png *.mqo *.fbx /S

echo Readme
copy readme_tool_win.txt %RDIR%\readme.txt
copy docs\readme_sample.txt %RDIR%\Sample\readme.txt

copy docs\Help_Ja.html %RDIR%\Help_Ja.html
copy docs\Help_En.html %RDIR%\Help_En.html
copy LICENSE_TOOL %RDIR%\LICENSE_TOOL

pause

SET RDIR=Effekseer150Win

rmdir %RDIR%
mkdir %RDIR%

echo Compile Editor

echo Copy application

mkdir %RDIR%\Tool

copy Dev\release\Effekseer.exe %RDIR%\Tool\.
copy Dev\release\Effekseer.exe.config %RDIR%\Tool\.
copy Dev\release\EffekseerCore.dll %RDIR%\Tool\.
copy Dev\release\EffekseerViewer.dll %RDIR%\Tool\.
copy Dev\release\IronPython.dll %RDIR%\Tool\.
copy Dev\release\IronPython.Modules.dll %RDIR%\Tool\.
copy Dev\release\Microsoft.Dynamic.dll %RDIR%\Tool\.
copy Dev\release\Microsoft.Scripting.dll %RDIR%\Tool\.
copy Dev\release\EffekseerMaterialEditor.exe %RDIR%\Tool\.
copy Dev\release\Viewer.dll %RDIR%\Tool\.
copy Dev\release\CsvHelper.dll %RDIR%\Tool\.

mkdir %RDIR%\Tool\scripts
mkdir %RDIR%\Tool\scripts\export
copy Dev\release\scripts\export\Default.cs %RDIR%\Tool\scripts\export\.

mkdir %RDIR%\Tool\tools
copy Dev\release\tools\fbxToEffekseerModelConverter.exe %RDIR%\Tool\tools\.
copy Dev\release\tools\mqoToEffekseerModelConverter.exe %RDIR%\Tool\tools\.

copy Dev\release\tools\EffekseerMaterialCompilerDX9.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerDX11.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerDX12.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerGL.dll %RDIR%\Tool\tools\.
copy Dev\release\tools\EffekseerMaterialCompilerMetal.dll %RDIR%\Tool\tools\.

mkdir %RDIR%\Tool\resources
robocopy Dev\release\resources\ %RDIR%\Tool\resources\. /s

echo Sample

mkdir %RDIR%\Sample
robocopy Release\Sample %RDIR%\Sample *.efkproj *.efkmodel *.efkmat *.efkefc *.txt *.png *.mqo *.fbx /S
robocopy ResourceData\samples %RDIR%\Sample *.efkproj *.efkmodel *.efkmat *.efkefc *.txt *.png *.mqo *.fbx /S

echo Readme
copy readme_tool_win.txt %RDIR%\readme.txt
copy docs\readme_sample.txt %RDIR%\Sample\readme.txt

copy docs\Help_Ja.html %RDIR%\Help_Ja.html
copy docs\Help_En.html %RDIR%\Help_En.html
copy LICENSE_TOOL %RDIR%\LICENSE_TOOL

pause

Fix build script

Fix build script


Create windows.bat

Create windows.bat


@ECHO OFF

SET ERRORLEVEL=0
SET VER=2.0.2.0

REM #SET MSB="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild"
SET MSB="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
SET MSB_ARG=/tv:14.0 /t:Build

SET ZIP="C:\Program Files\7-Zip\7z.exe"
SET ZIPEXL="-xr!.svn\* -xr!.vs\* -xr!bin -xr!obj -xr!*.user"

SET OUT_REPO=_Output

IF NOT EXIST %MSB% (
  ECHO Missing MSB
  GOTO :EOF
)

IF NOT EXIST %ZIP% (
  ECHO Missing ZIP
  GOTO :EOF
)

IF "%1"=="-x" GOTO archive

ECHO ---------------------- Minimum -------------------------
SET CFG=Minimum
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

SET CFG=WPFMinimum
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

IF NOT %ERRORLEVEL% LEQ 0 (
  PAUSE
  GOTO :EOF
)

ECHO ------------------ Standard Release ---------------------
SET CFG=Release
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /s /q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO --------------------- WPF ------------------------
SET CFG=WPFRelease
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO -------------------  Extension -----------------------

SET CFG=Extension
%MSB% ReoGrid.sln %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /s /q
MKDIR %OUT_DIR%

COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\FastColoredTextBox.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.EditorLib.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO ---------------- Demo EN ---------------------

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-Demo-Binary
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%

COPY Editor\Bin\Extension\unvell.ReoGridEditor.exe %OUT_DIR%\ /Y
COPY ReoGrid\Bin\Extension\unvell.ReoGrid.dll %OUT_DIR%\ /Y
COPY Demo\Bin\Release\ReoGridDemo.exe %OUT_DIR%\ /Y

MKDIR %OUT_DIR%\_Templates
XCOPY Demo\_Templates %OUT_DIR%\_Templates /e
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\FastColoredTextBox.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.EditorLib.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\
XCOPY Editor\Bin\Extension\ja-JP %OUT_DIR%\ja-JP\ /e
XCOPY Editor\Bin\Extension\ru-RU %OUT_DIR%\ru-RU\ /e
XCOPY Editor\Bin\Extension\zh-CN %OUT_DIR%\zh-CN\ /e

ECHO ---------------- Demo JP ---------------------

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-Demo_Ja-Binary
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%

COPY Editor\Bin\Extension\unvell.ReoGridEditor.exe DemoJP\Ref /Y
COPY ReoGrid\Bin\Extension\unvell.ReoGrid.dll DemoJP\Ref /Y

COPY Editor\Bin\Extension\unvell.ReoGridEditor.exe %OUT_DIR%\ /Y
COPY ReoGrid\Bin\Extension\unvell.ReoGrid.dll %OUT_DIR%\ /Y
COPY DemoJP\Bin\Release\ReoGridDemoJP.exe %OUT_DIR%\ /Y

MKDIR %OUT_DIR%\_Templates
XCOPY DemoJP\_Templates %OUT_DIR%\_Templates /e
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\FastColoredTextBox.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.EditorLib.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\
XCOPY Editor\Bin\Extension\ja-JP %OUT_DIR%\ja-JP\ /e
XCOPY Editor\Bin\Extension\ru-RU %OUT_DIR%\ru-RU\ /e
XCOPY Editor\Bin\Extension\zh-CN %OUT_DIR%\zh-CN\ /e

ECHO -------------------  WPFExtension -----------------------

SET CFG=WPFExtension
%MSB% ReoGridWPF.sln %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO ----------------- Demo WPF ---------------------

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-WPFDemo-Binary
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%

COPY DemoWPF\bin\Release\WPFDemo.exe %OUT_DIR%\
COPY ReoGrid\Bin\WPFRelease\unvell.ReoGrid.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

IF NOT %ERRORLEVEL% LEQ 0 (
  PAUSE
  GOTO :EOF
)

IF EXIST Demo\bin rmdir /s/q Demo\bin
IF EXIST Demo\obj rmdir /s/q Demo\obj
IF EXIST DemoJP\bin rmdir /s/q DemoJP\bin
IF EXIST DemoJP\obj rmdir /s/q DemoJP\obj
IF EXIST DemoWPF\bin rmdir /s/q DemoWPF\bin
IF EXIST DemoWPF\obj rmdir /s/q DemoWPF\obj
IF EXIST TestCase\bin rmdir /s/q TestCase\bin
IF EXIST TestCase\obj rmdir /s/q TestCase\obj
IF EXIST Editor\bin rmdir /s/q Editor\bin
IF EXIST Editor\obj rmdir /s/q Editor\obj

cd %OUT_REPO%

ECHO ----------------- Demo Source En ---------------------
@SET OUT_FILE=ReoGrid-%VER%-Demo-Source.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ..\Demo ..\Readme.md ..\license* ..\Demo2008.sln -xr!?svn\* -xr!?.vs\* -xr!?*.user

ECHO ----------------- Demo Source Ja ---------------------
@SET OUT_FILE=ReoGrid-%VER%-Demo_Ja-Source.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ..\DemoJP ..\Readme.md ..\license* ..\DemoJP.sln -xr!?svn\* -xr!?.vs\* -xr!?*.user

REM @SET OUT_FILE=ReoGrid-%VER%-Demo-Binary.zip
REM IF EXIST %OUT_FILE% del %OUT_FILE%
REM %ZIP% a -tzip %OUT_FILE% ReoGrid-%VER%-Demo-Binary

REM @SET OUT_FILE=ReoGrid-%VER%-DemoWPF-Binary.zip
REM IF EXIST %OUT_FILE% del %OUT_FILE%
REM %ZIP% a -tzip %OUT_FILE% ReoGrid-%VER%-WPFDemo-Binary

ECHO ----------------- Demo WPF Source ---------------------
@SET OUT_FILE=ReoGrid-%VER%-WPFDemo-Source.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ..\DemoWPF ..\DemoWPF.sln ..\Readme.md ..\license* %ZIPEXL%

ECHO ----------------- All Packages EN ---------------------
SET OUT_PKG_NAME=ReoGrid-%VER%-All-Packages.zip
@IF EXIST %OUT_PKG_NAME% DEL %OUT_PKG_NAME%
%ZIP% a -tzip %OUT_PKG_NAME% ^
 ReoGrid-%VER%-Demo-Binary ^
 ReoGrid-%VER%-WPFDemo-Binary ^
 ReoGrid-%VER%-Minimum ^
 ReoGrid-%VER%-WPFMinimum ^
 ReoGrid-%VER%-Release ^
 ReoGrid-%VER%-WPFRelease ^
 ReoGrid-%VER%-Extension ^
 ReoGrid-%VER%-WPFExtension ^
 ReoGrid-%VER%-Demo-Source.zip ^
 ReoGrid-%VER%-WPFDemo-Source.zip

ECHO ----------------- All Packages Ja ---------------------
SET OUT_PKG_NAME=ReoGrid-%VER%-All-Packages-Ja.zip
@IF EXIST %OUT_PKG_NAME% DEL %OUT_PKG_NAME%
%ZIP% a -tzip %OUT_PKG_NAME% ^
 ReoGrid-%VER%-Demo_Ja-Binary ^
 ReoGrid-%VER%-WPFDemo-Binary ^
 ReoGrid-%VER%-Minimum ^
 ReoGrid-%VER%-WPFMinimum ^
 ReoGrid-%VER%-Release ^
 ReoGrid-%VER%-WPFRelease ^
 ReoGrid-%VER%-Extension ^
 ReoGrid-%VER%-WPFExtension ^
 ReoGrid-%VER%-Demo_Ja-Source.zip ^
 ReoGrid-%VER%-WPFDemo-Source.zip

cd..

ECHO --------------------- DONE --------------------------

@ECHO OFF

SET ERRORLEVEL=0
SET VER=2.1.0.0

REM #SET MSB="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild"
SET MSB="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
SET MSB_ARG=/tv:14.0 /t:Build

SET ZIP="C:\Program Files\7-Zip\7z.exe"
SET ZIPEXL="-xr!.svn\* -xr!.vs\* -xr!bin -xr!obj -xr!*.user"

SET OUT_REPO=_Output

IF NOT EXIST %MSB% (
  ECHO Missing MSB
  GOTO :EOF
)

IF NOT EXIST %ZIP% (
  ECHO Missing ZIP
  GOTO :EOF
)

IF "%1"=="-x" GOTO archive

ECHO ---------------------- Minimum -------------------------
SET CFG=Minimum
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

SET CFG=WPFMinimum
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

IF NOT %ERRORLEVEL% LEQ 0 (
  PAUSE
  GOTO :EOF
)

ECHO ------------------ Standard Release ---------------------
SET CFG=Release
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /s /q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO --------------------- WPF ------------------------
SET CFG=WPFRelease
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "LICENSE" %OUT_DIR%\
COPY "License.bzip2.txt" %OUT_DIR%\
COPY "License.DotNetZipLib.txt" %OUT_DIR%\
COPY "License.zlib.txt" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO -------------------  Extension -----------------------

SET CFG=Extension
%MSB% ReoGrid.sln %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /s /q
MKDIR %OUT_DIR%

COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\FastColoredTextBox.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.EditorLib.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO ---------------- Demo EN ---------------------

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-Demo-Binary
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%

COPY Editor\Bin\Extension\unvell.ReoGridEditor.exe %OUT_DIR%\ /Y
COPY ReoGrid\Bin\Extension\unvell.ReoGrid.dll %OUT_DIR%\ /Y
COPY Demo\Bin\Release\ReoGridDemo.exe %OUT_DIR%\ /Y

MKDIR %OUT_DIR%\_Templates
XCOPY Demo\_Templates %OUT_DIR%\_Templates /e
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\FastColoredTextBox.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.EditorLib.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\
XCOPY Editor\Bin\Extension\ja-JP %OUT_DIR%\ja-JP\ /e
XCOPY Editor\Bin\Extension\ru-RU %OUT_DIR%\ru-RU\ /e
XCOPY Editor\Bin\Extension\zh-CN %OUT_DIR%\zh-CN\ /e

ECHO ---------------- Demo JP ---------------------

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-Demo_Ja-Binary
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%

COPY Editor\Bin\Extension\unvell.ReoGridEditor.exe DemoJP\Ref /Y
COPY ReoGrid\Bin\Extension\unvell.ReoGrid.dll DemoJP\Ref /Y

COPY Editor\Bin\Extension\unvell.ReoGridEditor.exe %OUT_DIR%\ /Y
COPY ReoGrid\Bin\Extension\unvell.ReoGrid.dll %OUT_DIR%\ /Y
COPY DemoJP\Bin\Release\ReoGridDemoJP.exe %OUT_DIR%\ /Y

MKDIR %OUT_DIR%\_Templates
XCOPY DemoJP\_Templates %OUT_DIR%\_Templates /e
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\FastColoredTextBox.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.EditorLib.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\
XCOPY Editor\Bin\Extension\ja-JP %OUT_DIR%\ja-JP\ /e
XCOPY Editor\Bin\Extension\ru-RU %OUT_DIR%\ru-RU\ /e
XCOPY Editor\Bin\Extension\zh-CN %OUT_DIR%\zh-CN\ /e

ECHO -------------------  WPFExtension -----------------------

SET CFG=Extension
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-WPF%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY Ref\Antlr3.Runtime.dll %OUT_DIR%\
COPY Ref\unvell.ReoScript.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO -------------------  WPFRelease -----------------------

SET CFG=Release
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-WPF%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO -------------------  WPFMinimum -----------------------

SET CFG=Minimum
%MSB% ReoGrid\ReoGrid.csproj %MSB_ARG% /p:Configuration=%CFG%;TargetFrameworkVersion=v3.5,Profile=Client

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-WPF%CFG%
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.dll %OUT_DIR%\
COPY ReoGrid\bin\%CFG%\unvell.ReoGrid.xml %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

ECHO ----------------- Demo WPF ---------------------

SET OUT_DIR=%OUT_REPO%\ReoGrid-%VER%-WPFDemo-Binary
IF EXIST %OUT_DIR% RMDIR %OUT_DIR% /S /Q
MKDIR %OUT_DIR%

COPY DemoWPF\bin\Release\WPFDemo.exe %OUT_DIR%\
COPY ReoGrid\Bin\WPFRelease\unvell.ReoGrid.dll %OUT_DIR%\
COPY "license*" %OUT_DIR%\
COPY "README.md" %OUT_DIR%\

IF NOT %ERRORLEVEL% LEQ 0 (
  PAUSE
  GOTO :EOF
)

IF EXIST Demo\bin rmdir /s/q Demo\bin
IF EXIST Demo\obj rmdir /s/q Demo\obj
IF EXIST DemoJP\bin rmdir /s/q DemoJP\bin
IF EXIST DemoJP\obj rmdir /s/q DemoJP\obj
IF EXIST DemoWPF\bin rmdir /s/q DemoWPF\bin
IF EXIST DemoWPF\obj rmdir /s/q DemoWPF\obj
IF EXIST TestCase\bin rmdir /s/q TestCase\bin
IF EXIST TestCase\obj rmdir /s/q TestCase\obj
IF EXIST Editor\bin rmdir /s/q Editor\bin
IF EXIST Editor\obj rmdir /s/q Editor\obj

cd %OUT_REPO%

ECHO ----------------- Demo Source En ---------------------
@SET OUT_FILE=ReoGrid-%VER%-Demo-Source.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ..\Demo ..\Readme.md ..\license* ..\Demo2008.sln -xr!?svn\* -xr!?.vs\* -xr!?*.user

ECHO ----------------- Demo Source Ja ---------------------
@SET OUT_FILE=ReoGrid-%VER%-Demo_Ja-Source.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ..\DemoJP ..\Readme.md ..\license* ..\DemoJP.sln -xr!?svn\* -xr!?.vs\* -xr!?*.user

@SET OUT_FILE=ReoGrid-%VER%-Demo-Binary.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ReoGrid-%VER%-Demo-Binary\

@SET OUT_FILE=ReoGrid-%VER%-DemoWPF-Binary.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ReoGrid-%VER%-WPFDemo-Binary\

ECHO ----------------- Demo WPF Source ---------------------
@SET OUT_FILE=ReoGrid-%VER%-WPFDemo-Source.zip
IF EXIST %OUT_FILE% del %OUT_FILE%
%ZIP% a -tzip %OUT_FILE% ..\DemoWPF ..\DemoWPF.sln ..\Readme.md ..\license* %ZIPEXL%

ECHO ----------------- All Packages EN ---------------------
SET OUT_PKG_NAME=ReoGrid-%VER%-All-Packages.zip
@IF EXIST %OUT_PKG_NAME% DEL %OUT_PKG_NAME%
%ZIP% a -tzip %OUT_PKG_NAME% ^
 ReoGrid-%VER%-Demo-Binary ^
 ReoGrid-%VER%-WPFDemo-Binary ^
 ReoGrid-%VER%-Minimum ^
 ReoGrid-%VER%-WPFMinimum ^
 ReoGrid-%VER%-Release ^
 ReoGrid-%VER%-WPFRelease ^
 ReoGrid-%VER%-Extension ^
 ReoGrid-%VER%-WPFExtension ^
 ReoGrid-%VER%-Demo-Source.zip ^
 ReoGrid-%VER%-WPFDemo-Source.zip

ECHO ----------------- All Packages Ja ---------------------
SET OUT_PKG_NAME=ReoGrid-%VER%-All-Packages-Ja.zip
@IF EXIST %OUT_PKG_NAME% DEL %OUT_PKG_NAME%
%ZIP% a -tzip %OUT_PKG_NAME% ^
 ReoGrid-%VER%-Demo_Ja-Binary ^
 ReoGrid-%VER%-WPFDemo-Binary ^
 ReoGrid-%VER%-Minimum ^
 ReoGrid-%VER%-WPFMinimum ^
 ReoGrid-%VER%-Release ^
 ReoGrid-%VER%-WPFRelease ^
 ReoGrid-%VER%-Extension ^
 ReoGrid-%VER%-WPFExtension ^
 ReoGrid-%VER%-Demo_Ja-Source.zip ^
 ReoGrid-%VER%-WPFDemo-Source.zip

cd..

ECHO --------------------- DONE --------------------------

update script for build every release editions


add is_js, lodash

add is_js, lodash


@echo off
REM YourPythonFileName_w.bat will launch without console
REM YourPythonFileName.bat will launch with console
set file=%~n0
if "%file:~-2%" equ "_w" (
  start pythonw %~dp0%file:~0,-2%.py
  goto done
)
call python %~dp0%~n0.py
pause
:done

@echo off
set p3=D:\z_sys\App_Dev\Python35x64_01\

REM YourPythonFileName_w.bat will launch without console
REM YourPythonFileName.bat will launch with console
REM YourPythonFileName_z.bat will launch without console in Python3
REM YourPythonFileName_x.bat will launch with console in Python3

set file=%~n0
if "%file:~-2%" equ "_w" (
  start pythonw %~dp0%file:~0,-2%.py
  goto done
)
if "%file:~-2%" equ "_z" (
  start %p3%pythonw.exe %~dp0%file:~0,-2%.py
  goto done
)
if "%file:~-2%" equ "_x" (
  %p3%python.exe %~dp0%file:~0,-2%.py
  goto console
)
call python %~dp0%~n0.py

:console
pause
:done

Update universal_tool_template.bat

Update universal_tool_template.bat

update for python 2 and 3 subfix auto launch


Update bld.bat

Update bld.bat


#!/usr/bin/env sh
rem(){ :;};rem '
@goto windows
'
# https://github.com/dotnet/cli/issues/2902
# see fix in project.json as well
cp ../../src/ReamQuery/appsettings.* .
mkdir .o bin/Debug/netcoreapp1.0/ubuntu.14.04-x64
cp ../../src/ReamQuery/project.* bin/Debug/netcoreapp1.0/ubuntu.14.04-x64
exit
:windows
copy ..\..\src\ReamQuery\appsettings.* .
copy ..\..\src\ReamQuery\project.* bin\Debug\netcoreapp1.0\win7-x64\.

Fix copy syntax

Fix copy syntax


:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows

IF "%PYTHON_ARCH%"=="64" (
    ECHO Configuring environment to build with MSVC on a 64bit architecture
    ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
    "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
) ELSE (
    ECHO Using default MSVC build environment for 32bit architecture
)

:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows

IF "%PYTHON_ARCH%"=="64" (
    ECHO Configuring environment to build with MSVC on a 64bit architecture
    ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
) ELSE (
    ECHO Using default MSVC build environment for 32bit architecture
)

Fix setup_build_env

Fix setup_build_env


@echo off
chcp 65001
setlocal enableextensions enabledelayedexpansion

set SRCPATH=%~1
if not defined SRCPATH call :PRINT_USAGE

set DESTPATH=%~2
if not defined DESTPATH set DESTPATH=%cd%.

set SRCFILEMASK=%~3
if not defined SRCFILEMASK set SRCFILEMASK="\b*"

set PROCS="%~dp0procs.cmd"

if not exist "%SRCPATH%" call %PROCS% DIR_ERROR
if not exist "%DESTPATH%" ( md "%DESTPATH%" || exit /b )

for %%I in ( "%SRCPATH%." ) do set "FFCONCATFILENAME=%%~nxI.ffconcat"

@echo.ffconcat version 1.0>"%DESTPATH%\%FFCONCATFILENAME%" &&^
for /f "usebackq tokens=* delims=" %%I in ( `dir /b /s /a:-d "%SRCPATH%\*" 2^>NUL ^| find /I "%SRCFILEMASK%" 2^>NUL` ) do (
	set FN=%%I
	@echo.file !FN:\=\\!>>%DESTPATH%\%FFCONCATFILENAME%
)

echo.Ready. File "%DESTPATH%\%FFCONCATFILENAME%" saved.

set OUTFILEPREFIX=%~3
if not defined OUTFILEPREFIX for %%I in ( %SRCFILE% ) do set "OUTFILEPREFIX=%%~nI"

for /f "usebackq tokens=* delims=" %%I in ( `call %PROCS% NEWDATENAME %OUTFILEPREFIX%` ) do set "OUTFILENAME=%%I.mp4"

set "ffmpeg=e:\Work\video\bin\ffmpeg\ffmpeg.exe"

set "x264opts=colorprim=bt709:transfer=bt709:colormatrix=bt709:fullrange=off:analyse=0x3,0x133"

%ffmpeg% -y -fflags +genpts  -f concat -safe 0 -i "%DESTPATH%\%FFCONCATFILENAME%" -map 0:0 -c:v libx264 -crf:v 21 -level:v 4.1 -profile:v high422 -tune:v film -preset:v fast ^
-maxrate:v 1000k -bufsize:v 2000k -threads 0 -f mp4 -pix_fmt yuv422p -metadata title=%OUTFILEPREFIX% ^
-map 0:1 -c:a aac -q:a 2 -ac 1 -ar 22050 ^
-x264opts %x264opts% -x264-params %x264opts% %DESTPATH%\%OUTFILENAME%

::-map 0:1 -c:a libfdk_aac -profile:a aac_he_v2 -afterburner 1 -signaling explicit_sbr -vbr 5 -ac 2 -ar 44100 ^

echo.Ready. File "%DESTPATH%\%OUTFILENAME%" saved.
echo.&pause&goto:eof

:PRINT_USAGE
   echo:
   echo USAGE:
   echo %~nx0 ^<source^> [destination] [outfile prefix title]
exit /b !ERRORLEVEL!

Concatenate multiple video files into one using ffmpeg ffconcat.

Signed-off-by: anex5 <56b5d6c4009d4ecf6dc83c29940abaab2935d225@gmail.com>


@ECHO OFF
REM Copyright 2015 Ben Vanik. All Rights Reserved.

SET DIR=%~dp0

REM ============================================================================
REM Environment Validation
REM ============================================================================

CALL :check_python
IF %_RESULT% NEQ 0 (
  ECHO.
  ECHO Python 3.4+ must be installed and on PATH:
  ECHO https://www.python.org/
  GOTO :eof
)

REM ============================================================================
REM Trampoline into xenia-build
REM ============================================================================

"%PYTHON_EXE%" xenia-build %*
EXIT /b %ERRORLEVEL%

REM ============================================================================
REM Utilities
REM ============================================================================

:check_python
SETLOCAL ENABLEDELAYEDEXPANSION

SET FOUND_PATH=""

SET CANDIDATE_PATHS[0]=C:\python37\python.exe
SET CANDIDATE_PATHS[1]=C:\python36\python.exe
SET CANDIDATE_PATHS[2]=C:\python35\python.exe
SET CANDIDATE_PATHS[3]=C:\python34\python.exe
SET OUTPUT_INDEX=4

FOR /F "usebackq" %%l IN (`2^>NUL where python3`) DO (
  SET CANDIDATE_PATHS[!OUTPUT_INDEX!]=%%l
  SET /A OUTPUT_INDEX+=1
)
FOR /F "usebackq" %%l IN (`2^>NUL where python`) DO (
  SET CANDIDATE_PATHS[!OUTPUT_INDEX!]=%%l
  SET /A OUTPUT_INDEX+=1
)

SET CANDIDATE_INDEX=0
:check_candidate_loop
IF NOT DEFINED CANDIDATE_PATHS[%CANDIDATE_INDEX%] (
  GOTO :found_python
)
CALL SET CANDIDATE_PATH=%%CANDIDATE_PATHS[%CANDIDATE_INDEX%]%%
IF NOT EXIST %CANDIDATE_PATH% (
  SET /A CANDIDATE_INDEX+=1
  GOTO :check_candidate_loop
)
CALL :get_size %CANDIDATE_PATH%
IF %_SIZE% NEQ 0 (
  SET FOUND_PATH=%CANDIDATE_PATH%
  GOTO :found_python
)
SET /A CANDIDATE_INDEX+=1
GOTO :check_candidate_loop

:found_python
IF %FOUND_PATH%=="" (
  ECHO ERROR: no Python executable found on PATH.
  ECHO Make sure you can run 'python' or 'python3' in a Command Prompt.
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)

CMD /C %FOUND_PATH% -c "import sys; sys.exit(1 if not sys.version_info[:2] >= (3, 4) else 0)"
IF %ERRORLEVEL% NEQ 0 (
  ECHO ERROR: Python version mismatch - not 3.4+
  ECHO Found Python executable was '%FOUND_PATH%'.
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)

ENDLOCAL & (
  SET _RESULT=0
  SET PYTHON_EXE=%FOUND_PATH%
)
GOTO :eof

:get_size
SET _SIZE=%~z1
goto :eof

@ECHO OFF
REM Copyright 2015 Ben Vanik. All Rights Reserved.

SET "DIR=%~dp0"

REM ============================================================================
REM Environment Validation
REM ============================================================================

CALL :check_python
IF %_RESULT% NEQ 0 (
  ECHO.
  ECHO Python 3.4+ must be installed and on PATH:
  ECHO https://www.python.org/
  GOTO :eof
)

REM ============================================================================
REM Trampoline into xenia-build
REM ============================================================================

"%PYTHON_EXE%" "%DIR%\xenia-build" %*
EXIT /b %ERRORLEVEL%

REM ============================================================================
REM Utilities
REM ============================================================================

:check_python
SETLOCAL ENABLEDELAYEDEXPANSION

SET FOUND_PATH=""

SET "CANDIDATE_PATHS[0]=C:\python37\python.exe"
SET "CANDIDATE_PATHS[1]=C:\python36\python.exe"
SET "CANDIDATE_PATHS[2]=C:\python35\python.exe"
SET "CANDIDATE_PATHS[3]=C:\python34\python.exe"
SET OUTPUT_INDEX=4

FOR /F "usebackq delims=" %%L IN (`2^>NUL where python3`) DO (
  IF %%~zL NEQ 0 (
    SET "CANDIDATE_PATHS[!OUTPUT_INDEX!]=%%L"
    SET /A OUTPUT_INDEX+=1
  )
)
FOR /F "usebackq delims=" %%L IN (`2^>NUL where python`) DO (
  IF %%~zL NEQ 0 (
    SET "CANDIDATE_PATHS[!OUTPUT_INDEX!]=%%L"
    SET /A OUTPUT_INDEX+=1
  )
)

SET CANDIDATE_INDEX=0
:check_candidate_loop
IF NOT DEFINED CANDIDATE_PATHS[%CANDIDATE_INDEX%] (
  GOTO :found_python
)
CALL SET CANDIDATE_PATH=%%CANDIDATE_PATHS[%CANDIDATE_INDEX%]%%
IF NOT EXIST "%CANDIDATE_PATH%" (
  SET /A CANDIDATE_INDEX+=1
  GOTO :check_candidate_loop
)
SET "FOUND_PATH=%CANDIDATE_PATH%"

:found_python
IF "%FOUND_PATH%"=="" (
  ECHO ERROR: no Python executable found on PATH.
  ECHO Make sure you can run 'python' or 'python3' in a Command Prompt.
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)

CMD /C ""%FOUND_PATH%" -c "import sys; sys.exit(1 if not sys.version_info[:2] ^>= (3, 4) else 0)"
IF %ERRORLEVEL% NEQ 0 (
  ECHO ERROR: Python version mismatch, not at least 3.4.
  ECHO Found Python executable was "%FOUND_PATH%".
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)

ENDLOCAL & (
  SET _RESULT=0
  SET "PYTHON_EXE=%FOUND_PATH%"
)
GOTO :eof

Fix handling of paths to Python with spaces in xb.bat.


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

@echo off

set ASSET=%1
set ASSETDIR=%2%ASSET%

If not exist %ASSETDIR% (
	mkdir %ASSETDIR%
)

title %PROJECTDIR% / %ASSET%

:: Clear screen
cls

echo+
echo %ASSET% -----------
echo+

:: List available tasks
setlocal enabledelayedexpansion
set FOLDERQUERRY=%ASSETDIR%
for /f %%i in ('dir %FOLDERQUERRY%\work /b ') do (
   set x=%%i
   echo   !x!
)
endlocal

echo+
echo   1. Type application and task.
echo   2. Press [Enter] to launch application.
echo+
echo   For example:
echo+
echo   $ maya animation
echo   $ houdini sim
echo   $ nuke comp
echo+
echo --------------------------------------

pushd %ASSETDIR%

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

@echo off

set ASSET=%1
set ASSETDIR=%2%ASSET%

If not exist %ASSETDIR% (
	mkdir %ASSETDIR%
)

title %PROJECTDIR% / %ASSET%

:: Clear screen
cls

echo+
echo %ASSET% -----------
echo+

:: List available tasks
setlocal enabledelayedexpansion
set FOLDERQUERRY=%ASSETDIR%
if {%FOLDERQUERRY%\work\*}=={} (
	for /f %%i in ('dir %FOLDERQUERRY%\work /b ') do (
   		set x=%%i
   		echo   !x!
	)
)
endlocal

echo+
echo   1. Type application and task.
echo   2. Press [Enter] to launch application.
echo+
echo   For example:
echo+
echo   $ maya animation
echo   $ houdini sim
echo   $ nuke comp
echo+
echo --------------------------------------

pushd %ASSETDIR%

add if folder is empty dont echo folder and dont give error


pandoc mengzi.txt -o ..\mengzi.html -s --toc

pandoc mengzi.txt -o mengzi.html --standalone --toc --css=UnemphasizedName.css --verbose

Use more explicit options

Use more explicit options


Update build script

Update build script


@echo on

set PATH_BAK=%PATH%

rmdir build-Qt4.MinGW /s /q
rmdir build-Qt4.MSVC2008 /s /q
rmdir build-Qt5.MinGW /s /q
rmdir build-Qt5.MSVC2010 /s /q
mkdir build-Qt4.MinGW
mkdir build-Qt4.MSVC2008
mkdir build-Qt5.MinGW
mkdir build-Qt5.MSVC2010

:Qt4MinGW
rem
rem Qt4 MinGW
rem From C:\Qt\4.8.6_MinGW\bin\qtvars.bat
rem
set QTDIR=C:\Qt\4.8.6_MinGW
set PATH=C:\Qt\4.8.6_MinGW\bin
set PATH=%PATH%;C:\Qt\mingw32\bin
set PATH=%PATH%;%SystemRoot%\System32
set QMAKESPEC=win32-g++-4.6
rem Build
cd build-Qt4.MinGW
qmake ..\AvalonMiner\AvalonMiner.pro
mingw32-make
set AvalonDir=AvalonMiner.Qt4MinGW
mkdir %AvalonDir%
move release\AvalonMiner.exe %AvalonDir%\AvalonMiner.exe
copy %QTDIR%\bin\QtCore4.dll %AvalonDir%
copy %QTDIR%\bin\QtGui4.dll %AvalonDir%
copy %QTDIR%\bin\QtNetwork4.dll %AvalonDir%
copy %~dp0\MinGW.runtime\* %AvalonDir%
cd ..

rem goto END

:Qt5MinGW
rem
rem Qt5 MinGW
rem From C:\Qt\Qt5.3.0_MinGW\5.3\mingw482_32\bin\qtenv2.bat
rem
set PATH=C:\Qt\Qt5.3.0_MinGW\5.3\mingw482_32\bin;C:\Qt\Qt5.3.0_MinGW\Tools\mingw482_32\bin;%SystemRoot%\System32;%SystemRoot%
set QTDIR=
set QMAKESPEC=
rem Build
cd build-Qt5.MinGW
qmake ..\AvalonMiner\AvalonMiner.pro
mingw32-make
set AvalonDir=AvalonMiner.Qt5MinGW
mkdir %AvalonDir%
move release\AvalonMiner.exe %AvalonDir%\AvalonMiner.exe
cd %AvalonDir%
windeployqt AvalonMiner.exe
cd ..\..

:Qt4MSVC
rem
rem Qt4 MSVC2008
rem From C:\Qt\4.8.6_MSVC2008\bin\qtvars.bat vsvars
rem
set QTDIR=C:\Qt\4.8.6_MSVC2008
set PATH=C:\Qt\4.8.6_MSVC2008\bin;%SystemRoot%\System32;%SystemRoot%
set QMAKESPEC=win32-msvc2008
call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
rem Build
cd build-Qt4.MSVC2008
qmake ..\AvalonMiner\AvalonMiner.pro
nmake
set AvalonDir=AvalonMiner.Qt4MSVC
mkdir %AvalonDir%
move release\AvalonMiner.exe %AvalonDir%\AvalonMiner.exe
copy %QTDIR%\bin\QtCore4.dll %AvalonDir%
copy %QTDIR%\bin\QtGui4.dll %AvalonDir%
copy %QTDIR%\bin\QtNetwork4.dll %AvalonDir%
copy %~dp0\MSVC2008\* %AvalonDir%
cd ..

:Qt5MSVC
rem Qt5 MSVC2010
set QTDIR=
set PATH=C:\Qt\Qt5.3.0_MSVC2010\5.3\msvc2010_opengl\bin;%SystemRoot%\System32;%SystemRoot%
set QMAKESPEC=
call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
rem Build
cd build-Qt5.MSVC2010
qmake ..\AvalonMiner\AvalonMiner.pro
nmake
set AvalonDir=AvalonMiner.Qt5MSVC
mkdir %AvalonDir%
move release\AvalonMiner.exe %AvalonDir%\AvalonMiner.exe
copy %~dp0\MSVC2010\* %AvalonDir%
cd %AvalonDir%
windeployqt AvalonMiner.exe
cd ..\..

:END
set PATH=%PATH_BAK%

Add build script for Windows

Add build script for Windows


@echo off
rem Only need to run this the first time after clone. Subsequent builds can be just "msbuild".

cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

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

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

:restore
IF EXIST packages\MSBuilder.NuGet.GetLatestVersion goto run
build\.nuget\NuGet.exe install packages.config -OutputDirectory packages -ExcludeVersion

:run
msbuild /nologo /v:minimal

@echo off
rem Only need to run this the first time after clone. Subsequent builds can be just "msbuild".
rem Alternatively, this batch file can be invoked passing msbuild parameters, like: build.cmd /v:detailed /t:Rebuild

cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

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

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

:restore
IF NOT EXIST packages.config goto run
IF EXIST packages\MSBuilder.NuGet.GetLatestVersion goto run
build\.nuget\NuGet.exe install packages.config -OutputDirectory packages -ExcludeVersion

:run
msbuild /nologo /v:minimal %1 %2 %3 %4 %5 %6 %7 %8 %9

Allow arbitrary msbuild parameters to the batch.cmd file


@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*"

@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"

Return the error code from build.cmd

Return the error code from build.cmd


dotnet build src/dotnet-ildasm/dotnet-ildasm.csproj -f netcoreapp1.0 %*
dotnet build src/dotnet-ildasm/dotnet-ildasm.csproj -f netstandard1.6 %*
dotnet build src/dotnet-ildasm/dotnet-ildasm.csproj -f net45 %*

dotnet build src/dotnet-ildasm.Sample/dotnet-ildasm.Sample.csproj -f net45 %*
dotnet build src/dotnet-ildasm.Sample/dotnet-ildasm.Sample.csproj -f netstandard1.6 %*

dotnet build src/dotnet-ildasm/dotnet-ildasm.csproj -f netcoreapp1.0 %*
dotnet build src/dotnet-ildasm/dotnet-ildasm.csproj -f netstandard1.5 %*
dotnet build src/dotnet-ildasm/dotnet-ildasm.csproj -f net45 %*

dotnet build src/dotnet-ildasm.Sample/dotnet-ildasm.Sample.csproj -f net45 %*
dotnet build src/dotnet-ildasm.Sample/dotnet-ildasm.Sample.csproj -f netstandard1.6 %*

Change build script to target correct version of framework.


@echo off
cd %~dp0

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

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

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

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

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

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

@echo off
cd %~dp0

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

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

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

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

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

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

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


@rem Used by the buildbot "test" step.
cd PC\VS7.1
call rt.bat -q -uall -rw

@rem Used by the buildbot "test" step.
cd PC
call rt.bat -q -uall -rw -x64

Use -x64 flag.

Use -x64 flag.


cd /d %~dp0

mkdir OSVR-Unity-Dist
mkdir OSVR-Unity-Dist\src
mkdir OSVR-Unity-Dist\src\OSVR-Unity
mkdir OSVR-Unity-Dist\src\Managed-OSVR
xcopy Managed-OSVR OSVR-Unity-Dist\src\Managed-OSVR /Y /S
xcopy OSVR-Unity OSVR-Unity-Dist\src\OSVR-Unity /Y /S

rem the -F 0x4 is to turn off smartypants.
third-party\discount-2.1.6-win32\markdown.exe -F 0x4 -o README.html OSVR-Unity/README.md
move README.html OSVR-Unity-Dist\
third-party\discount-2.1.6-win32\markdown.exe -F 0x4 -o CONTRIBUTING.html CONTRIBUTING.md
move CONTRIBUTING.html OSVR-Unity-Dist\

rem Copy the license and the notice
xcopy LICENSE OSVR-Unity-Dist /Y
xcopy NOTICE OSVR-Unity-Dist /Y
xcopy CONTRIBUTING OSVR-Unity-Dist /Y

Fix build.

Fix build.


echo STABLE_BUILD_GERRIT_LABEL dev
echo STABLE_WORKSPACE_ROOT %cd%

Bazel: Add workspace-status-command script for other platform

Per default, Bazel is using tools/workspace-status.sh script to provide
used git version. This script cannot be used on the other platform. Add
another dummy platform specific script. This would allow us to add CI
build for other platform on ci.bazel.io. See these issues for more
background: [1], [2].

Note, that this Bazel fix is needed to build :headless on the other
platform: [3]:

  bazel build \
  --workspace_status_command=tools\workspace-status.cmd :headless

[1] https://github.com/bazelbuild/continuous-integration/issues/126
[2] https://github.com/bazelbuild/bazel/issues/3965
[3] https://github.com/bazelbuild/bazel/issues/3962

Change-Id: I29b4bd8c9f8b85e2ed7b8cb2546ff5f2979af0da


# Display settings at startup
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+PrintCommandLineFlags

# Discourage address map swapping by setting Xms and Xmx to the same value
# http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues
set CATALINA_OPTS=%CATALINA_OPTS% -Xms64m
set CATALINA_OPTS=%CATALINA_OPTS% -Xmx512m

# Prevent "Unrecognized Name" SSL warning
set CATALINA_OPTS=%CATALINA_OPTS% -Djsse.enableSNIExtension=false

rem Display settings at startup
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+PrintCommandLineFlags

rem Discourage address map swapping by setting Xms and Xmx to the same value
rem http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues
set CATALINA_OPTS=%CATALINA_OPTS% -Xms64m
set CATALINA_OPTS=%CATALINA_OPTS% -Xmx512m

rem Prevent "Unrecognized Name" SSL warning
set CATALINA_OPTS=%CATALINA_OPTS% -Djsse.enableSNIExtension=false

Use 'rem' to comment a line in a .bat file, not '#'


set CONFIGURATION=%1
set OUTPUT=%2

set OPENCOVER=".\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe"
set TARGET="%VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
set TARGET_ARGS=".\ThScoreFileConverterTests\bin\%CONFIGURATION%\ThScoreFileConverterTests.dll"
set FILTER="+[*]*"

%OPENCOVER% ^
    -register:user ^
    -target:%TARGET% ^
    -targetargs:%TARGET_ARGS% ^
    -filter:%FILTER% ^
    -output:%OUTPUT%

set CONFIGURATION=%1
set OUTPUT=%2

set OPENCOVER=".\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe"
set TARGET="%VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
set TARGET_ARGS=".\ThScoreFileConverterTests\bin\%CONFIGURATION%\ThScoreFileConverterTests.dll"
set FILTER="+[*]* -[ThScoreFileConverterTests]*"

%OPENCOVER% ^
    -register:user ^
    -target:%TARGET% ^
    -targetargs:%TARGET_ARGS% ^
    -filter:%FILTER% ^
    -output:%OUTPUT%

Exclude ThScoreFileConverterTests from the coverage result


cd application
php bin/compposer install --no-dev -o

cd application
php bin/composer install --no-dev -o

Fix windows bootstrap.bat

Fix windows bootstrap.bat