To detect the OS, I take advantage of the fact that different OS's have different environment vars set. Sometimes I use the VER command and FIND command.
"OS"="Windows_NT" on any NT or higher box.
"ProgramFiles" is set on 2000 or higher
IF NOT "%OS%"=="Windows_NT" ECHO This is 95/98/me
IF "%OS%"=="Windows_NT" ECHO This is NT4/2000/XP/2003
IF "%OS%"=="Windows_NT IF "%ProgramFiles%"=="" ECHO This is NT4
IF "%OS%"=="Windows_NT IF NOT "%ProgramFiles%"=="" ECHO This is 2000 or higher
I am not familair with SMS client, but since it is a Microsoft product, I assume it has an .MSI based install? Try this: (QB! = only show a progress bar and disable the cancel button)
MSIEXEC.EXE /I /QB! SMSClient.MSI
or
SETUP.EXE /QB!
To see if an app is already installed, I usually look for it's EXE, but this has problems if you don't know where it's installed (e.g. the user ran setup and changed the installation folder to D: or something)
IF EXIST "C:\Program Files\SMS Client\SMSClient.EXE" ECHO Looks like it's installed.
Also use the FIND command and check the return code to see inside files. If FIND returns 0 the text was found.
VER > "%TEMP%\OSVER.TXT"
FIND "Microsoft Windows XP" "%TEMP%\OSVER.TXT"
IF "%ERRORLEVEL%"=="0" ECHO This is XP
IF NOT "%ERRORLEVEL%"=="0" ECHO This NOT XP
DEL "%TEMP%\OSVER.TXT"