tis-microsoft-teams icon

Microsoft Teams

Paquet d’installation silencieuse pour Microsoft Teams

1.6.0.4472-67

package           : tis-microsoft-teams
version           : 1.6.0.4472-67
architecture      : x64
section           : base
priority          : optional
name              : Microsoft Teams
categories        : Media,Messaging,Office
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ,Gaëtan SEGAT
description       : System-Wide installation (prevent Per-user installation) - Microsoft Teams, also referred to as simply Teams, is a unified communication and collaboration platform that combines persistent workplace chat, video meetings, file storage (including collaboration on files)
depends           : 
conflicts         : tis-microsoft-teams-appdata
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://docs.microsoft.com/microsoftteams/msi-deployment
installed_size    : 
impacted_process  : Teams
description_fr    : Microsoft Teams, aussi simplement appelé Teams, est une plate-forme de communication et de collaboration unifiée qui combine le chat, les réunions vidéo, le stockage de fichiers (comprend la collaboration sur les fichiers)
description_pl    : Instalacja w całym systemie (zapobieganie instalacji na użytkownika) - Microsoft Teams, określany również jako po prostu Teams, jest platformą ujednoliconej komunikacji i współpracy, która łączy czat w miejscu pracy, spotkania wideo, przechowywanie plików (w tym współpracę nad plikami)
description_de    : Systemweite Installation (verhindert die Installation pro Benutzer) - Microsoft Teams, auch einfach als Teams bezeichnet, ist eine einheitliche Kommunikations- und Kollaborationsplattform, die einen dauerhaften Arbeitsplatz-Chat, Videokonferenzen, Dateispeicherung (einschließlich der Zusammenarbeit an Dateien)
description_es    : Instalación en todo el sistema (evita la instalación por usuario) - Microsoft Teams, también denominada simplemente Teams, es una plataforma de comunicación y colaboración unificada que combina el chat persistente en el lugar de trabajo, las reuniones de vídeo, el almacenamiento de archivos (incluida la colaboración en archivos)
description_pt    : Instalação a nível do sistema (impedir a instalação por utilizador) - Equipas Microsoft, também referidas como simplesmente Equipas, é uma plataforma unificada de comunicação e colaboração que combina chat persistente no local de trabalho, reuniões em vídeo, armazenamento de ficheiros (incluindo colaboração em ficheiros)
description_it    : Installazione a livello di sistema (impedisce l'installazione per utente) - Microsoft Teams, indicato anche come semplicemente Teams, è una piattaforma di comunicazione e collaborazione unificata che combina chat persistenti sul posto di lavoro, riunioni video, archiviazione di file (compresa la collaborazione su file)
description_nl    : Installatie voor het hele systeem (voorkomt installatie per gebruiker) - Microsoft Teams, ook wel gewoon Teams genoemd, is een platform voor verenigde communicatie en samenwerking dat permanente chat op de werkplek, videovergaderingen, bestandsopslag (inclusief samenwerking aan bestanden) combineert
description_ru    : Установка по всей системе (предотвращение установки на одного пользователя) - Microsoft Teams, также называемая просто Teams, представляет собой платформу унифицированных коммуникаций и совместной работы, которая объединяет постоянный чат на рабочем месте, видеовстречи, хранение файлов (включая совместную работу над файлами)
audit_schedule    : 
editor            : Microsoft
keywords          : microsoft,teams,team,communication,collaboration,chat,video,meetings
licence           : Proprietary
homepage          : https://www.microsoft.com/microsoft-365/microsoft-teams/group-chat-software
package_uuid      : afc64570-1734-47b2-b153-15f4440aadce
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://support.office.com/article/what-s-new-in-microsoft-teams-d7092a6d-c896-424c-b362-a472d5f105de
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : c6e1224de3bf5ed2d252f9cee788480febfe2993b02cf91cf3258e7306274674
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : JfiV5iN/FU4rXA7uVUZLDzbM1T5RzPCM8By2zgJn9T/IgKLpKtZvhS7OtPijujA1F6JARpEPcTYAN1ONo8w88rCB0GPBT22OQk+vrLoCNCkxs4ojHjaHAXH7THjNZ8rvCI4V5RjvkOf6mbNa+gRotVNp9+SMaCU8O+qNgg6N3kXyLHkTvPOmo7aQRNyRIqI0wHtEo0suQxMXZwCxed8w9JjMvNGmNDfHEbICT6NesM7Jv+ma6Z25YZ7B91nnnQm/8rrhD73tJR3sKqyZ8XSbL4J6AKjYv1E9szFwZKZYPxsIU8Fh+huW8yqh0x2gU5N7Y1Rtd7LXF8JQw6LFhRBc5Q==
signature_date    : 2023-03-15T21:02:47.104075
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

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

# {731F6BAA-A986-45A4-8936-7C3AAAAA760B}      Teams Machine-Wide Installer        1.3.0.12058         MsiExec.exe /I{731F6BAA-A986-45A4-8936-7C3AAAAA760B}


# Installation procedure: https://docs.microsoft.com/fr-fr/microsoftteams/teams-for-vdi#install-or-update-the-teams-desktop-app-on-vdi

# Defining variables
silent_args = 'OPTIONS="noAutoStart=true" ALLUSER=1'  # OPTIONS="noAutoStart=true" ALLUSER=1 ALLUSERS=1
# silent_args = 'ALLUSER=1' #OPTIONS="noAutoStart=true" ALLUSER=1 ALLUSERS=1
app_name = "Microsoft Teams"
app_name_short = "Teams"
app_dir = makepath(programfiles32, "Microsoft", "Teams")
app_path = makepath(app_dir, "current", "Teams.exe")
# sys_json_setup = makepath(app_dir,'setup.json')
# json_setup_content =  json.loads('{"noAutoStart":true,"--exeName":"Teams.exe"}')


def install():
    # Initializing variables
    package_version = control.version.split("-")[0]
    bin_name = "Teams_windows_%s_x64.msi" % package_version
    app_name = control.name

    # Uninstalling older versions if found
    for uninstall in installed_softwares(name=app_name_short):
        if Version(uninstall["version"]) < Version(package_version):
            print("Older %s version found (%s)" % (app_name, uninstall["version"]))
            print("Removing: %s (%s)" % (uninstall["name"], uninstall["version"]))
            run_notfatal(uninstall_cmd(uninstall["key"]))
            time.sleep(15)

    # Adding fake WVD/VDI RegKey
    # Un/comment if needed
    registry_set(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Teams", "IsWVDEnvironment", 1, type=REG_DWORD)
    registry_set(HKEY_LOCAL_MACHINE, r"SOFTWARE\VMware, Inc.\VMware VDM\Agent", "", "")
    registry_set(HKEY_LOCAL_MACHINE, r"SOFTWARE\Citrix\PortICA", "", "")

    # Installing the package system wide
    print("Installing: %s" % bin_name)
    install_msi_if_needed(bin_name, properties=silent_args, min_version=package_version, accept_returncodes=[0, 3010, 1605, 1614, 1641], timeout=900)

    # Disabling AutoStart
    if iswin64():
        registry_delete(HKEY_LOCAL_MACHINE, r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run", "Teams")
    registry_delete(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Teams")

    # Removing shortcuts
    remove_desktop_shortcut(app_name)

    # Adding Firewall Rules for Teams
    run(
        'netsh advfirewall firewall add rule name="%s" dir=in action=allow program="%s" enable=yes protocol=TCP profile=domain' % (app_name, app_path)
    )
    run(
        'netsh advfirewall firewall add rule name="%s" dir=in action=allow program="%s" enable=yes protocol=TCP profile=private'
        % (app_name, app_path)
    )
    run(
        'netsh advfirewall firewall add rule name="%s" dir=in action=allow program="%s" enable=yes protocol=UDP profile=domain' % (app_name, app_path)
    )
    run(
        'netsh advfirewall firewall add rule name="%s" dir=in action=allow program="%s" enable=yes protocol=UDP profile=private'
        % (app_name, app_path)
    )

    # Cleaning fake WVD/VDI RegKey properly
    # Un/comment if needed
    if reg_value_exists(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Teams", "IsWVDEnvironment"):
        registry_delete(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Teams", "IsWVDEnvironment")
    if reg_key_exists(HKEY_LOCAL_MACHINE, r"SOFTWARE\VMware, Inc."):
        registry_deletekey(HKEY_LOCAL_MACHINE, r"SOFTWARE\VMware, Inc.\VMware VDM\Agent", "", force=False)
        registry_deletekey(HKEY_LOCAL_MACHINE, r"SOFTWARE\VMware, Inc.\VMware VDM", "", force=False)
        registry_deletekey(HKEY_LOCAL_MACHINE, r"SOFTWARE\VMware, Inc.", "", force=False)
    if reg_key_exists(HKEY_LOCAL_MACHINE, r"SOFTWARE\Citrix\PortICA"):
        registry_deletekey(HKEY_LOCAL_MACHINE, r"SOFTWARE\Citrix\PortICA", "", force=False)


def uninstall():
    # Initializing variables
    processes_to_kill = control.impacted_process.strip().replace(" ", "").split(",")
    count = 30  # 30x10=300sec maximum waiting

    # Uninstalling the package
    for uninstall in installed_softwares(name=app_name_short):
        killalltasks(processes_to_kill)
        print("Uninstalling: %s" % uninstall["name"])
        run_notfatal(uninstall_cmd(uninstall["key"]))

    while installed_softwares(name=app_name_short):
        count -= 1
        if count == 0:
            error("Unable to uninstall: %s" % app_name)
        time.sleep(10)

    # Removing remaining files
    if isdir(app_dir):
        killalltasks(processes_to_kill)
        remove_tree(app_dir)


def session_setup():
    # Initializing variables
    user_conf_dir = makepath(application_data, "Microsoft", "Teams")
    json_config = makepath(user_conf_dir, "desktop-config.json")
    json_settings = makepath(user_conf_dir, "settings.json")

    user_app_dir = makepath(user_local_appdata, "Microsoft", "Teams")
    user_app_path = makepath(user_app_dir, "current", "Teams.exe")
    user_app_updater = makepath(user_app_dir, "Update.exe")
    # user_app_version = registry_readstring(HKEY_CURRENT_USER,r'Software\Microsoft\Windows\CurrentVersion\Uninstall\Teams','DisplayVersion')

    user_app_progdata_dir = makepath("C:", "ProgramData", get_current_user(), "Microsoft", "Teams")
    user_app_progdata_path = makepath(user_app_progdata_dir, "current", "Teams.exe")
    user_app_progdata_updater = makepath(user_app_progdata_dir, "Update.exe")

    user_silent_args_uninst = "--uninstall -s"
    processes_to_kill = control.impacted_process.split(",")

    # Uninstalling from user environment (procedure: https://docs.microsoft.com/microsoftteams/msi-deployment)
    if isfile(user_app_path):
        print("Uninstalling Microsoft Teams from user environment")
        killalltasks(processes_to_kill)
        run_notfatal('"%s" %s' % (user_app_updater, user_silent_args_uninst))
    if isdir(user_app_dir):
        remove_tree(user_app_dir)
    if isfile(user_app_progdata_path):
        print("Uninstalling Microsoft Teams from user ProgramData environment")
        killalltasks(processes_to_kill)
        run_notfatal('"%s" %s' % (user_app_progdata_updater, user_silent_args_uninst))
    if isdir(user_app_progdata_dir):
        killalltasks(processes_to_kill)
        remove_tree(user_app_progdata_dir)

    if reg_value_exists(HKEY_CURRENT_USER, r"Software\Microsoft\Office\Teams", "PreventInstallationFromMsi"):
        registry_delete(HKEY_CURRENT_USER, r"Software\Microsoft\Office\Teams", "PreventInstallationFromMsi")

    # No longer Prefill UPN
    registry_set(HKEY_CURRENT_USER, r"Software\Microsoft\Office\Teams", "SkipUpnPrefill", 1, type=REG_DWORD)

    """ # Cleaning up Teams profile once
    if registry_readstring(HKEY_CURRENT_USER,r'Software\WAPT\Teams','CleanupOnce') != 'Done' or force:
        killalltasks(processes_to_kill)
        time.sleep(2)
        remove_tree(user_conf_dir)
        registry_set(HKEY_CURRENT_USER,r'Software\WAPT\Teams','CleanupOnce','Done')
        print("Cleaning up Teams user profile") """

    # Define user settings (procedure: https://techcommunity.microsoft.com/t5/microsoft-teams/how-to-disable-check-for-updates-in-microsoft-teams/m-p/54644)
    print("Setting up user settings")
    if not isdir(user_conf_dir):
        mkdirs(user_conf_dir)

    # desktop-config.json
    if isfile(json_config):
        json_config_content = load_json(json_config)
    else:
        json_config_content = json.loads('{"appPreferenceSettings":{}}')
        # json_config_content = json.load({})

    json_config_content["appPreferenceSettings"]["registerAsIMProvider"] = False
    json_config_content["appPreferenceSettings"]["openAsHidden"] = True
    json_config_content["appPreferenceSettings"]["runningOnClose"] = True
    json_config_content["openAtLogin"] = False
    json_config_content["isForeground"] = True
    json_config_content["wamFallbackInProgress"] = False
    json_config_content["disableWarningOnOpenKeyRegistered"] = True
    json_config_content["isAppFirstRun"] = False

    write_json(json_config, json_config_content)

    # settings.json
    if isfile(json_settings):
        json_settings_content = load_json(json_settings)
    else:
        json_settings_content = json.loads('{"baseSettings":{},"initializedSettings":{},"preauthSettings":{"samplingRules":{}}}')
        # json_settings_content = json.load({})

    # Update part
    json_settings_content["baseSettings"]["enableBlockSilentUpdate"] = True
    json_settings_content["baseSettings"]["disableAllUsersAutoUpdate"] = True
    json_settings_content["baseSettings"]["enableUnAuthUpdates"] = False
    """ json_settings_content['initializedSettings']['disableAllUsersAutoUpdate'] = True
    json_settings_content['preauthSettings']['disableAllUsersAutoUpdate'] = True
    json_settings_content['preauthSettings']['samplingRules']['updateNotificationEnabled'] = False """
    # Telemetry part
    json_settings_content["baseSettings"]["enableAdalMacTelemetryV2"] = False
    json_settings_content["baseSettings"]["enableAdalWinTelemetry"] = False
    json_settings_content["baseSettings"]["proplusAdditionalTelemetryEnabled"] = False
    json_settings_content["baseSettings"]["regionInTelemetryEnabled"] = False
    json_settings_content["baseSettings"]["tenantRegionInTelemetryEnabled"] = False
    """ json_settings_content['initializedSettings']['tenantRegionInTelemetryEnabled'] = False
    json_settings_content['preauthSettings']['tenantRegionInTelemetryEnabled'] = False
    json_settings_content['preauthSettings']['samplingRules']['tenantRegionInTelemetryEnabled'] = False """
    # Other part
    json_settings_content["baseSettings"]["enableRegisterProtocolToRoot"] = False
    """ json_settings_content['preauthSettings']['registerAddinOnMeetingPolicySettingsSync'] = False """

    write_json(json_settings, json_settings_content)


def load_json(json_filename):
    with open(json_filename) as json_file:
        data = json.load(json_file)
    return data


def write_json(json_filename, data):
    with open(json_filename, "w") as outfile:
        json.dump(data, outfile, sort_keys=True, indent=4, default=str)

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

bin_name_temp = "Teams_windows_x64.msi"
url_dl = "https://teams.microsoft.com/downloads/desktopurl?env=production&plat=windows&arch=x64&managedInstaller=true&download=true"
bin_name_string = "Teams_windows_%s_x64.msi"


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    latest_bin = bin_name_temp
    version = "1.0"  # fake version

    # Downloading latest binaries
    if isfile(bin_name_temp):
        remove_file(bin_name_temp)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(url_dl, latest_bin, proxies=proxies)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if version != version_from_file:
            os.rename(latest_bin, bin_name_string % version_from_file)
            version = version_from_file

        # Changing version of the package
        control.version = "%s-%s" % (version, int(control.version.split("-")[-1]) + 1)
        control.save_control_to_wapt()
        print("Changing package version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)

f6a506f47223af994d261ca0d66cfcbfdd074be5198b3a28e8634995914f87f5 : setup.py
a63a8d703263521e958d30996a57ce42666c777262ededd8f2df9490f8151310 : Teams_windows_1.6.0.4472_x64.msi
8483e66238e201954f0122cceb2c9e70397e716915bb3db8bec16caf2107a3e7 : update_package.py
c6e1224de3bf5ed2d252f9cee788480febfe2993b02cf91cf3258e7306274674 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
5d4956da33d00b67af477188719bfeef4b885ec4a2d318444a7d96277fdd7403 : WAPT/changelog.txt
230cd7eef9a04d62a9298d22664ed4607e51789151e5c57a94ff5bdebe13fa3d : luti.json
9e6dbc998ce682cb0126e281b0cbe654f08b39c7622942966697c4f1e0b32c20 : WAPT/control