# -*- coding: utf-8 -*-
from setuphelpers import *

silent_args = "/S"
app_uninstallkey = "TeamViewer"


def install():
    bin_name = glob.glob("TeamViewer_Setup*.exe")[0]
    install_exe_if_needed(
        bin_name,
        silentflags=silent_args,
        key=app_uninstallkey,
        min_version=control.get_software_version(),
        timeout=900,
    )

    # Changing default service start mode of the application
    if control.package.startswith('tis-'):
        set_service_start_mode("TeamViewer", "Manual")
