@echo off

rem only if we are running from a checkout
IF EXIST "%~dp0\.git" (
  rem if dev_bundle is not present, get it
  IF NOT EXIST "%~dp0\dev_bundle" (
    REM need `< con` so that we can run this file from Node
    REM (See http://stackoverflow.com/questions/9155289/calling-powershell-from-nodejs)
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
  )

  rem if dev_bundle is the wrong version, remove it and get a new one
  PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\check-dev-bundle.ps1" < con

  IF errorlevel 1 (
    rmdir /s /q "%~dp0\dev_bundle"
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
  )
)

SET NODE_PATH=%~dp0\dev_bundle\lib\node_modules

"%~dp0\dev_bundle\bin\node.exe" "%~dp0\tools\main.js" %*


@echo off

rem only if we are running from a checkout
IF EXIST "%~dp0\.git" (
  rem verify that we have 7zip in the path
  7z.exe --help > con
  IF errorlevel 1 (
    echo "Please install 7z.exe (7-Zip) and put it into your PATH"
    exit 1
  )

  rem if dev_bundle is not present, get it
  IF NOT EXIST "%~dp0\dev_bundle" (
    REM need `< con` so that we can run this file from Node
    REM (See http://stackoverflow.com/questions/9155289/calling-powershell-from-nodejs)
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
  )

  rem if dev_bundle is the wrong version, remove it and get a new one
  PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\check-dev-bundle.ps1" < con

  IF errorlevel 1 (
    rmdir /s /q "%~dp0\dev_bundle"
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
  )
)

SET NODE_PATH=%~dp0\dev_bundle\lib\node_modules

"%~dp0\dev_bundle\bin\node.exe" "%~dp0\tools\main.js" %*


Add a check for 7zip
Add a check for 7zip
