Step 1: Extract the installer files
The first step is to extract the true installation files. The setup program is just a container for the real installation
files. Go through these steps to get the real installation files:
- Go to www.teamviewer.com and click the download link.
- Run the setup program, but do not click "next", when the installation starts.
- Open Explorer and go to %temp%\TeamViewer, as shown below.
- There is most likely a subfolder named the version of TeamViewer, for example "Version7". Double-click this folder to change directory.
- Copy TeamViewer_.exe to the folder where you will create the installation script. We will assume your working directory is C:\TV, so copy TeamViewer_.exe to C:\TV.
Step 2 - option 1: Installation through a logon script
The installation can now be executed passing /S to the TeamViewer_.exe file. To make the installation
unattended through a logon script, we need to:
- Obtain administrative permissions to install the application.
- Optionally make sure the installation only happens on computers in a certain Active Directory group.
- Execute TeamViewer_.exe passing /S as an administrator.
- TeamViewer starts after successful installation, so we also need to kill it to avoid end-user confusion.
If you do not have UAC enabled, you can execute the installation as part of your
logon script
and use the internal FastTrack Scripting Host installer logic to keep track of installations, as explained
here.
If you do have UAC enabled, you can do this in a similar way with a startup script, see the
UAC page for more information.
We are assuming here that you have put TeamViewer_.exe in a folder named "TeamViewer" in the root of a share called \\AcmeServer\Installers$.
You need to replace this and the installation user with information that is suitable on your network. As part of the logon script, we can then
insert this:
If ComputerIsMemberOf
TeamViewerComputers Then
If Not InstalledBuild TeamViewer,1 Then
RunScript \\AcmeServer\Installers$\TeamViewer\Install.fsh,AcmeDom\AcmeInstall,DCRWXKMsTt0QEo/xBdqOsw==
End If
End If
If you want TeamViewer installed on all computers, you can remove the outer condition. But in the above
example, TeamViewer is only installed on computers in an Active Directory group called "TeamViewerComputers".
The user "AcmeInstall" must be replaced with an administrative user in your domain. The password must be encrypted
with the "Encrypt Password" tool in the script editor, which can be started by pressing F8.
We now need to create the installation script on the location "\\AcmeServer\Installers$\TeamViewer\Install.fsh". In
the same folder, you also need to have TeamViewer_.exe. The script requires these three lines:
Run TeamViewer_.Exe,/S
KillProcess TeamViewer.Exe
RegisterInstallation TeamViewer,7.0,1
The installation is executed unattended and when the installation is complete, the program
starts and we must terminate it. The user will not see this, as this all happen within a
few milliseconds. Finally the "RegisterInstallation" command ensures that the installation will
not run again, which is explained
here.
Step 2 - option 2: Deployment through Group Policies to a container or Organizational Unit
To deploy TeamViewer with Group Policies, we need to repackage the installation into a Windows Installer
.msi file. FastTrack Scripting Host can package a script and installation files into an .msi file,
as explained
here. The installation script must basically just
run the installation and kill the application. Put the below script in the same folder as your
TeamViewer_.exe file and create an .msi file, as shown below.
Run TeamViewer_.Exe,/S
KillProcess TeamViewer.Exe
You now have an .msi file that will install TeamViewer unattended, which you can now assign as a software installation to any Group Policy.