@echo off

SET CHECKFILE="C:\Program Files\Mesh Agent\MeshAgent.exe"

SET INSTALLERPATH="\\smb\Toolbox\Installs\MeshCentral"
SET INSTALLER32="meshagent32-Agent.exe"
SET INSTALLER64="meshagent64-Agent.exe"
SET INSTALLERARGS="-fullinstall"

reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT

IF EXIST %CHECKFILE% (
  echo Already installed. Quitting.
) ELSE (  
  echo Installing...
  if %OS%==32BIT %INSTALLERPATH%\%INSTALLER32% %INSTALLERARGS%
  if %OS%==64BIT %INSTALLERPATH%\%INSTALLER64% %INSTALLERARGS%
)