@echo off
REM Install-eMxInfo.cmd - copy the site-specific eMxInfo.txt into both
REM Program Files eDNC paths. Run by Install-FromManifest.ps1 (Type=CMD)
REM when Hash detection on C:\Program Files\eDNC\eMxInfo.txt fails.

set "SRC=%~dp0eMxInfo.txt"
if not exist "%SRC%" (
    echo Install-eMxInfo: source file not found at %SRC%
    exit /b 1
)

if not exist "C:\Program Files\eDNC\"        mkdir "C:\Program Files\eDNC\"        2>/dev/null
if not exist "C:\Program Files (x86)\eDNC\"  mkdir "C:\Program Files (x86)\eDNC\"  2>/dev/null

copy /Y "%SRC%" "C:\Program Files\eDNC\eMxInfo.txt"       >/dev/null || exit /b 2
copy /Y "%SRC%" "C:\Program Files (x86)\eDNC\eMxInfo.txt" >/dev/null || exit /b 3

echo Install-eMxInfo: deployed eMxInfo.txt to both eDNC paths
exit /b 0
