Break On
$SystemDrive = Left('%WINDIR%', 2)
$InstRoot = 'S:\Lync\'
$Is64 = IIf(InStr('%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%', 'AMD64'), 1, 0)
$Install = '' ; default is to not install
If InGroup('Domain Users')
; OK to Instal Lync
; set the installer based on the platform bitness, but only if the appropriate
; Lync version is not already installed
If $Is64 ; running on x64 platform
If Not Exist(Path_to\64-bit\Lync)
$Install = 'setup.exe /configure configuration-en-64.xml'
EndIf
Else
If Not Exist(Path_to\32-bit\Lync)
$Install = 'setup.exe /configure configuration-en-86.xml'
EndIf
EndIf
; run the installer only if it was defined above. If not defined, it's already here!
If $Install
'Running: ' $InstRoot $Install @CRLF
; Shell $InstRoot + $Install
Else
'Lync is already installed!' @CRLF
EndIf
Else
'No Lync for you!' @CRLF
EndIf