@echo off

ver|find "5.0"&&goto XP
ver|find "5.1"&&goto XP
ver|find "5.2"&&goto XP

IF EXIST "%ProgramFiles(x86)%" (start msiexec /i SafeNetAuthenticationClient-x64-10.0.msi ADDDEFAULT=eTokenDrivers,UIDialogs,eTokenPKCS11,SACTools,eTokenJava PROP_CLEAR_REG=1 PROP_ETOKENREADERCOUNT=4 PROP_REG_FILE="%~dp0SACinst.reg" ET_LANG_NAME=Russian /qb) else (start msiexec /i SafeNetAuthenticationClient-x32-10.0.msi ADDDEFAULT=eTokenDrivers,UIDialogs,eTokenPKCS11,SACTools,eTokenJava PROP_CLEAR_REG=1 PROP_ETOKENREADERCOUNT=4 PROP_REG_FILE="%~dp0SACinst.reg" ET_LANG_NAME=Russian /qb)
goto end

:XP
IF EXIST "%ProgramFiles(x86)%" (start msiexec /i PKIClient_x64_5.1_SP1.msi ET_LANG_NAME=Russian /qb) else (start msiexec /i PKIClient_x32_5.1_SP1.msi ET_LANG_NAME=Russian /qb)

:end