Wednesday, December 12, 2012

Silent Install Of Shoretel Communicator without Reboot

Here's how to install Shoretel Communicator 12.3 silently, remotely, and without an automatic reboot.

Download the communicator install from your HQ server.

Please note that Communicator will not work properly until the PC has been restarted. I'll have to check into that later I assume it just needs a service restarted.

Here's the entire script I wrote up.
1. We do a check to see if it's a x86 or x64 PC, we get that from the SystemInfo command.
2. Then we set the appropriate path using the variable spth.
It's a bad idea and it will end badly for you. I ALMOST made that mistake, but I have the good habit of re-reading a script one more time before I execute it. Saved my bacon.

3. Determines if Communicator is already installed, then either forks it to the install section or the end function.

The install command line to get a silent non rebooted install of communicator is as follows:

setup.exe /S /v"/qn REBOOT=reallysuppress"

now it's an installshield that's wrapped around an MSI so the switches are split.
/S and /v are for the installshield setup. /S is Silent /v is variable to pass to the msi installer.
You can pass multiple variables / switches to the MSI by enclosing them in " ". Notice there is no space between the /v and the ". Spaces inside the " " are okay.

Here's the script:

@echo off
systeminfo | find /i "System Type" | find /i "X86-based PC"
if %errorlevel% == 0 set spth="C:\Program Files\Shoreline Communications\ShoreWare Client\Shoretel.exe"
Echo Checking System Type (x86 vs x64)
systeminfo | find /i "System Type" | find /i "X64-based PC"
if %errorlevel% == 0 set spth="C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\Shoretel.exe"

Echo Checking if Communicator is already installed.....
if exist %spth% goto end1
if NOT exist %spth% goto install

echo Installing Shoretel Communicator
\\fileserver\installs$\ShoreTel\setup.exe /S /v"/qn REBOOT=reallysuppress"
echo Installation Finished

echo Shoretel Communicator is already installed.
ping -n 5 > nul

Psexec or use your favorite method of pushing out an install and you're golden.