Suppress application launch after install

Hey all, need help with a TeamViewer install.

After the installation completes, the application automatically launches as the user logged in and prompts them to confirm an application setting. The problem is, the setting does not stick because the user doesn’t have sufficient permissions (admin rights):


What im wondering is, can we use the toolkit to suppress the launch after install, and instead launch it manually as SYSTEM so that when the user click the “allow and finish” button, the setting actually sticks.

Do you know what settings it is trying to set for the user?
If so, we might be able to pre-configure the setting and avoid the popup altogether.

Having had a quick read on a couple of TeamViewer forums articles, I found the following PowerShell script:

# Set variable for the TeamViewer Host install
$TeamViewerHost = ".\TeamViewer_Host.msi"
$TeamViewerCustomConfigID = "XXXXXX"

#Install TeamViewer Host
Write-Output "Installing TeamViewer Host..."
#Start-Process -FilePath "msiexec.exe" -ArgumentList "/i "$TeamViewerHost" /quiet /norestart" -Wait -NoNewWindow
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i "$TeamViewerHost" /quiet /norestart CUSTOMCONFIGID=$TeamViewerCustomConfigID" -Wait -NoNewWindow

#Insert a short waiting time to ensure that the installation is complete
Write-Output "Wait 30 seconds to ensure that the installation is complete."
Start-Sleep -Seconds 30

#Check whether TeamViewer is installed
if (Test-Path "$env:ProgramFiles\TeamViewer\TeamViewer.exe") {
    Write-Output "TeamViewer installed successfully."

    # TeamViewer rollout configuration
    Write-Output "Configuring TeamViewer Host with Config ID: $TeamViewerAssignmentID"

    Start-Process "$env:ProgramFiles\TeamViewer\TeamViewer.exe" -ArgumentList "assignment --id $TeamViewerAssignmentID" -Wait -NoNewWindow

    Write-Output "TeamViewer Host configuration successfull."

} else {

    Write-Output "TeamViewer Host configuration  failed."


N.B. You will need to populate the:

$TeamViewerCustomConfigID = "XXXXXX"

with your TeamViewer supplied details
The point to note is in most of the guides it is mentioned you need to have a 20-30 second pause between installing and running the app - I believe this is because the configuration needs to be sent to TeamViewers servers, as the device can’t enroll correctly if the detail is not yet available.

P.S. I found this script in this comment here:

Or alternatively you could use the solution mentioned here:

:point_up_2: This helpfully has a description how it’s used in practice