@echo off
setlocal
cd /d "%~dp0"

if exist "%SystemRoot%\System32\vcruntime140_1.dll" goto launch

if exist "%~dp0redist\vc_redist.x64.exe" (
  echo Microsoft Visual C++ Runtime is missing. Installing it now...
  "%~dp0redist\vc_redist.x64.exe" /install /passive /norestart
) else (
  echo Microsoft Visual C++ Runtime is missing, and redist\vc_redist.x64.exe was not found.
  echo NodeNow may not start until the runtime is installed.
  pause
)

:launch
start "" "%~dp0NodeNow.exe"
