tis-teamviewer-portable icon

TeamViewer Portable

Silent install package for TeamViewer Portable

15.66.4-15

  • package: tis-teamviewer-portable
  • name: TeamViewer Portable
  • version: 15.66.4-15
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: TeamViewer AG
  • licence: proprietary_free,wapt_public
  • locale: all
  • target_os: windows
  • impacted_process: TeamViewer,TeamViewer_Desktop,tv_w32,tv_x64
  • architecture: all
  • signature_date:
  • size: 75.49 Mo
  • installed_size: 132.09 Mo
  • homepage : https://www.teamviewer.com

package           : tis-teamviewer-portable
version           : 15.66.4-15
architecture      : all
section           : base
priority          : optional
name              : TeamViewer Portable
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : TeamViewer is a remote access and remote control computer software, allowing maintenance of computers and other devices
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : https://www.teamviewer.com/download/
installed_size    : 132090815
impacted_process  : TeamViewer,TeamViewer_Desktop,tv_w32,tv_x64
description_fr    : TeamViewer est un logiciel d'accès à distance et de contrôle à distance d'ordinateurs, permettant la maintenance d'ordinateurs et d'autres appareils
description_pl    : TeamViewer to oprogramowanie do zdalnego dostępu i zdalnego sterowania komputerem, umożliwiające konserwację komputerów i innych urządzeń
description_de    : TeamViewer ist eine Fernzugriffs- und Fernsteuerungssoftware, die die Wartung von Computern und anderen Geräten ermöglicht
description_es    : TeamViewer es un software de acceso remoto y control remoto de ordenadores, que permite el mantenimiento de ordenadores y otros dispositivos
description_pt    : O TeamViewer é um software de acesso remoto e controlo remoto de computadores, que permite a manutenção de computadores e outros dispositivos
description_it    : TeamViewer è un software per l'accesso e il controllo remoto del computer, che consente la manutenzione di computer e altri dispositivi
description_nl    : TeamViewer is computersoftware voor toegang op afstand en afstandsbediening, waarmee computers en andere apparaten kunnen worden onderhouden
description_ru    : TeamViewer - это программа удаленного доступа и дистанционного управления компьютером, позволяющая обслуживать компьютеры и другие устройства
audit_schedule    : 
editor            : TeamViewer AG
keywords          : 
licence           : proprietary_free,wapt_public
homepage          : https://www.teamviewer.com
package_uuid      : 5cf16bbc-fe9e-41e2-934c-432e4a5236e2
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://community.teamviewer.com/English/categories/change-logs-en
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : 71d3c188b8ebd8672d0ffcb36dae22598986ef3bf83981d468779f234a617c94
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-06-02T10:01:40.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : wLHx65dDOCuL32hFcPbRMKtgu7tHSiklVyMbLiaXMk7ax9BWr4rE4Dj/WzUiStum2JZs9iRDC8eDbapxuHgwynSnqv+crfA9tCBFyFEG4FsaKc56OqVeZRtI83mS4c2qcioL/a3kVmRX0K/8+aiunl6wpirQCInSTOryXAw8igm8OffDb5QFsMvVP+hs5idi7zPmueKgoqqlFxoi773WgLr/HzZj1Vz6OEkoazug15IkYHENmTgbZGT8jJ3Pi0GnF6P/JmJ8bxQB5yiiqx0PbLFwD4U9YqPg+F1VUIiGIMXbaBz9ffs5xrDG2tZzco3nyN/NpwYc0aY674BrMWkdCw==

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


app_name = "TeamViewer Portable"
zip_name = "TeamViewerPortable.zip"
app_dir = makepath(programfiles32, app_name)
app_path = makepath(app_dir, "TeamViewer.exe")
icon_path = app_path
audit_version_number = False
win64app = None


def get_installed_version(uninstallkey):
    for soft in installed_softwares(uninstallkey):
        return soft.get("version", None)
    return None


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    installed_version = get_installed_version(app_name)
    ini_file = makepath(app_dir, "TeamViewer.ini")

    # Installing software
    if installed_version is None or Version(installed_version) < Version(package_version) or force:
        print("Installing: %s (%s)" % (app_name, control.get_software_version()))
        killalltasks(ensure_list(control.impacted_process))
        if isdir(app_dir) and force:
            remove_tree(app_dir)
        mkdirs(app_dir)
        print("Extracting: %s to: %s" % (zip_name, app_dir))
        unzipped_dir = zip_name.rsplit(".", 1)[0]
        # unzip(zip_name, app_dir)
        unzip(zip_name, unzipped_dir)
        copytree2(unzipped_dir, app_dir, shutil.ignore_patterns("TeamViewer.ini"), onreplace=default_overwrite)

        # Adding software to regitry
        print("Registering: %s to Windows Registry" % app_name)
        register_windows_uninstall(control, win64app=win64app)
        register_uninstall(app_name, win64app=win64app, install_location=app_dir, icon=icon_path)
    else:
        print("%s is already installed and up-to-date (%s)" % (app_name, control.get_software_version()))

    # Modifying ini file
    inifile_writestring(ini_file, "Settings", "nosave", "1")  # Avoid UAC
    inifile_writestring(ini_file, "Settings", "TermsOfUseAccepted", "1")  # Accept EULA and CLUF
    inifile_writestring(ini_file, "Settings", "UseNewUI", "0")  # Keep the old UI

    # Creating custom shortcuts
    create_desktop_shortcut(app_name, app_path)
    create_programs_menu_shortcut(app_name, app_path)

    # Adding Firewall Rules
    remove_netfirewallrule(app_name)
    add_netfirewallrule(app_name, app_path, app_name, profile="Domain,Private", protocol="UDP")
    add_netfirewallrule(app_name, app_path, app_name, profile="Domain,Private", protocol="TCP")


def audit():
    # Declaring local variables
    package_version = control.get_software_version()
    installed_version = get_installed_version(app_name)

    # Auditing software
    if installed_version is None:
        print("%s is not installed" % app_name)
        return "ERROR"
    elif Version(installed_version) != Version(package_version) and audit_version_number:
        print("%s is installed in version (%s) instead of (%s)" % (app_name, installed_version, package_version))
        return "WARNING"
    else:
        print("%s (%s) is installed" % (app_name, installed_version))
        return "OK"


def uninstall():
    # Uninstalling software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir):
        remove_tree(app_dir)
    unregister_uninstall(app_name, win64app=win64app)

    # Removing shortcuts
    remove_desktop_shortcut(app_name)
    remove_programs_menu_shortcut(app_name)

    # Removing Firewall Rules
    remove_netfirewallrule(app_name)


def add_netfirewallrule(
    rule_name,
    app_path,
    group=None,
    direction="Inbound",
    profile=None,
    enabled=True,
    action="Allow",
    protocol=None,
):
    """
    Add a Windows Firewall rule using New-NetFirewallRule cmdlet in PowerShell for Windows 10 and newer,
    or netsh advfirewall for older Windows versions.

    https://learn.microsoft.com/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior
    https://learn.microsoft.com/powershell/module/netsecurity/new-netfirewallrule

    Args:
        rule_name (str): Display name for the firewall rule.
        app_path (str): Path to the program for which the rule is being created.
        group (str, optional): Group name for the firewall rule (only works with PowerShell).
        direction (str): Direction of the rule (Inbound or Outbound). Default: Inbound.
        profile (str or list, optional): Profile(s) to which the rule should apply (e.g., "Domain,Private"). Default: Any.
        enabled (bool): Specify if the created rule's state is Enabled (True) or not (False). Default: True.
        action (str): Action for the rule (Allow or Block). Default: Allow.
        protocol (str, optional): Protocol by name or number (e.g., "TCP", "UDP", "ICMPv4", or "ICMPv6"). Default: Any.

    Returns:
        waptutils.RunOutput: The result of the command execution.

    .. versionadded:: 2.5

    """
    if not isinstance(profile, list):
        profile = ensure_list(profile)
    profile = ",".join(profile)

    message = f"Adding Firewall Rule: {rule_name}"
    if direction:
        message += f" ({direction})"
    if protocol:
        message += f" ({protocol})"
    if action:
        message += f" ({action})"
    print(message)
    if windows_version() < WindowsVersions.Windows10:
        direction = "out" if direction.lower() == "Outbound".lower() else "in"
        enabled = "no" if not enabled else "yes"
        cmd_command = f'netsh advfirewall firewall add rule name="{rule_name}" dir={direction} action={action} program="{app_path}" enable={enabled}'
        if profile:  # any and all are working
            cmd_command += f' profile="{profile}"'
        if protocol:
            cmd_command += f' protocol="{protocol}"'
        result = run_notfatal(cmd_command)
    else:
        pwsh_command = (
            f'New-NetFirewallRule -DisplayName "{rule_name}" -Direction {direction} -Action {action} -Program "{app_path}" -Enabled {str(enabled)}'
        )
        if group:
            pwsh_command += f' -Group "{group}"'
        if profile:
            pwsh_command += f' -Profile "{profile}"'
        if protocol:
            pwsh_command += f' -Protocol "{protocol}"'
        result = run_powershell(pwsh_command, output_format="text")

    return result


def remove_netfirewallrule(rule_name):
    """
    Remove Windows Firewall rule using New-NetFirewallRule cmdlet in PowerShell for Windows 10 and newer,
    or netsh advfirewall for older Windows versions.

    Args:
        rule_name (str): Display name of the firewall rule to remove.

    Returns:
        waptutils.RunOutput: The result of the command execution.

    .. versionadded:: 2.5

    """
    print(f"Removing Firewall Rule: {rule_name}")
    if windows_version() < WindowsVersions.Windows10:
        result = run_notfatal(f'netsh advfirewall firewall delete rule name="{rule_name}"')
    else:
        result = run_powershell(
            f'Remove-NetFirewallRule -DisplayName "{rule_name}" -ErrorAction SilentlyContinue', output_format="text", accept_returncodes=[0, 1, 3010]
        )

    return result

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


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    url = "https://www.teamviewer.com/en/download/windows/"
    download_dict = {
        "windows-all": "https://download.teamviewer.com/download/TeamViewerPortable.zip",
    }
    download_url = download_dict[control.target_os + "-" + ensure_list(control.architecture)[0]]
    latest_bin = download_url.split("/")[-1]

    # Deleting binaries
    remove_outdated_binaries("*", "zip")

    # Downloading latest binaries
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print("Binary is present: %s" % latest_bin)

    version = ".".join(get_version_from_binary(unzip(latest_bin, ".", "tv_x64.exe")[0]).split(".")[:3])
    remove_file("tv_x64.exe")

    # # Checking version from file
    # if get_os_name() == "Windows" and "windows" in control.target_os.lower():
    #     version_from_file = get_version_from_binary(latest_bin)
    #     if Version(version_from_file, 4) == Version(version, 4):
    #         print("INFO: Binary file version corresponds to online version")
    #     else:
    #         error("ERROR: Binary file version do NOT corresponds to online version")

    # Changing version of the package
    if Version(version, 4) > Version(control.get_software_version(), 4):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        package_updated = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating update-package-sources
    return package_updated

    # # Changing version of the package and validating update-package-sources
    # return complete_control_version(control, version)

e1f6084b396cc47f3d2cb7c1d39751f2243894fb6d4d844dd38fec3213ff18d0 : TeamViewerPortable.zip
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
4989815ee6bac012c85ac0bd628dd377d9a6fafc8be9251df1207d2169c3671f : WAPT/control
71d3c188b8ebd8672d0ffcb36dae22598986ef3bf83981d468779f234a617c94 : WAPT/icon.png
30b08120dbc6bd427f2b24384c540735f6832fe8dc16b7120d334863a0bf7b0b : luti.json
47768400b563265179c687f7922ad996901c3a568270dd2d3a7cfe6f46699508 : setup.py
abaee5727c3009484a9b43e3d9f6466a6cb1721b3aa4384910a461579e48e385 : update_package.py