Unattended installation of teamviewer msi package for corporate license

Options

We have a requirement to distribute teamviewer to 100's of devices and need to be able to run a silient installation on the msi.

We have tried many scenarious but are unable to acheive this, it appears it always required interaction.  Can you please assist in what is required to make this work.  As ane example we have tried.

msiexec /i Teamviewer.msi /s /qn

And this does not work.

Comments

  • HeinM
    HeinM Posts: 9 ✭✭
    Options

    Add the necessary info in place of the xxxxxx in the below batch file. We have deployed to more than 30000 pc's using it. It also repairs a faulty installation. Just remember to delete the pc from the management console when you run this script on the pc:

    c:\windows\system32\sc stop TeamViewer
    c:\windows\system32\ping 127.0.0.1 -n 2

    c:\windows\system32\taskkill /f /im TeamViewer.exe
    c:\windows\system32\ping 127.0.0.1 -n 2

    cd\
    cd "%ProgramFiles%\TeamViewer"
    uninstall.exe /S
    c:\windows\system32\ping 127.0.0.1 -n 5
    c:\windows\system32\reg delete "HKLM\Software\TeamViewer" /f
    c:\windows\system32\ping 127.0.0.1 -n 2

    cd\
    cd "%temp%"
    del *teamviewer*.* /s /f /q

    cd\
    if not exist "c:\Program Files\sysinternals\psexec.exe" C:\Windows\System32\wbem\wmic product where vendor="TeamViewer" call uninstall

    "C:\Program Files\utils.Uninstall.exe" "/dTeamViewer 12 Host" /sTeamviewer
    "C:\Program Files\utils.Uninstall.exe" "/dTeamViewer 12 Host (MSI Wrapper)"

    c:\windows\system32\reg delete "HKLM\Software\TeamViewer" /f
    c:\windows\system32\reg delete "HKCU\Software\TeamViewer" /f
    rd /S /Q "C:\Program Files\Teamviewer"
    rd /S /Q "%LOCALAPPDATA%\Temp\TeamViewer"

    cd "C:\SETUP\Teamviewer"

    c:\windows\system32\ping 127.0.0.1 -n 15
    if exist "%ProgramFiles%\TeamViewer\AssignmentData.json" del /f /q "%ProgramFiles%\TeamViewer\AssignmentData.json"
    if exist "%ProgramFiles%\TeamViewer\TeamViewer12_Logfile.log" del /f /q "%ProgramFiles%\TeamViewer\TeamViewer12_Logfile.log"
    @rem if exist "C:\SETUP\Teamviewer\TeamViewer_Settings.reg" del /f /q "C:\SETUP\Teamviewer\TeamViewer_Settings.reg"
    if exist "C:\SETUP\Teamviewer\TeamviewerInstall.txt" del /f /q "C:\SETUP\Teamviewer\TeamviewerInstall.txt"

    c:\windows\system32\msiexec.exe /i Teamviewer_Host-idcxxxxxxxxx.msi /L* Teamviewer.log /quiet
    c:\windows\system32\ping 127.0.0.1 -n 180

    :WAITJSON
    if exist "%ProgramFiles%\TeamViewer\AssignmentData.json" GOTO RUNASSIGN
    c:\windows\system32\findstr /i /C:"[RemoteSettings] ProviderRegistrationAdministration: Registration at provider" "%ProgramFiles%\TeamViewer\TeamViewer12_Logfile.log"
    if %errorlevel%==0 GOTO ALREADYREGISTERED
    c:\windows\system32\findstr /i /C:"Communication with https://client.teamviewer.com/taf/index.aspx failed" "%ProgramFiles%\TeamViewer\TeamViewer12_Logfile.log"
    if %errorlevel%==0 GOTO FAILEDCOMM
    c:\windows\system32\ping 127.0.0.1 -n 60
    GOTO WAITJSON

    :RUNASSIGN
    if exist "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt" del /f /q "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt"
    echo Assignment - %date% - %time% >> "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt"

    TeamViewer_Assignment.exe -allowEasyAccess=true -apitoken=xxxx-xxxxxxxxx -datafile "%ProgramFiles%\TeamViewer\AssignmentData.json" -groupID "gxxxxxx" -apiurl "https://webapi.teamviewer.com/api/v1/" >> "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt"

    c:\windows\system32\ping 127.0.0.1 -n 15
    c:\windows\system32\findstr /i /C:"Assignment successful" "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt"
    if %errorlevel%==0 GOTO ASSIGNSUCCESS
    @rem error assignment
    echo 1 > "C:\SETUP\Teamviewer\AssignmentStatus.txt"
    GOTO EXITNOW

    :ASSIGNSUCCESS
    @rem success assignment
    echo 0 > "C:\SETUP\Teamviewer\AssignmentStatus.txt"
    GOTO EXITNOW

    :FAILEDCOMM
    echo Communication failed - %date% - %time% >> "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt"
    echo 3 > "C:\SETUP\Teamviewer\AssignmentStatus.txt"
    GOTO EXITNOW

    :ERRORMESSAGE
    GOTO EXITNOW

    :ALREADYREGISTERED
    echo AlreadyRegistered - %date% - %time% >> "C:\SETUP\Teamviewer\AssignmentTeamviewer.txt"
    echo 2 > "C:\SETUP\Teamviewer\AssignmentStatus.txt"
    GOTO EXITNOW

    :EXITNOW
    time /t > c:\temp\cshcsys.now