tis-element icon

Element

Paquet d’installation silencieuse pour Element

1.12.17-1
Utilities
Utilities

Les paquets PREPROD sont des paquets construits via LUTI. Ils restent généralement 5 jours en PREPROD, après quoi un deuxième scan VirusTotal est effectué pour vérifier que le status n'a pas changé.
Si le paquet réussit ce dernier contrôle, il est promu en PROD et publié sur le store.

  • package: tis-element
  • name: Element
  • version: 1.12.17-1
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Ingrid TALBOT
  • locale: all
  • target_os: windows
  • impacted_process: Element
  • architecture: x64
  • signature_date:
  • size: 189.34 Mo
  • installed_size: 674.87 Mo

package           : tis-element
version           : 1.12.17-1
architecture      : x64
section           : base
priority          : optional
name              : Element
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Ingrid TALBOT
description       : Element is a free and open-source software instant messaging client implementing the Matrix protocol
depends           : 
conflicts         : 
maturity          : PREPROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : 
installed_size    : 674868071
impacted_process  : Element
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : 
keywords          : messaging
licence           : 
homepage          : 
package_uuid      : 95e4e28a-1a55-45d0-b4e4-b76bc6f0e171
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 97bc7b132a900ec71b17a423ad8c979dac0134bdde3a89726d263874c7fd2f3e
signer            : test
signer_fingerprint: b82fc8ef4a4475c0f69ac168176c2bfc58f572eb716c4eadd65e4785c155dd8e
signature_date    : 2026-04-30T10:31:22.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         : SwecEpWFFa0gXDvQv0BgPKYgcJZK7TusaY2bExdFS1iPJQlcxlTu+mQLyuEqOuFNpNtnF/x3ivRVOUy3n5bs23T5pton4MRVfgkBEGdDNXnzXdGkaYpJ42wsmF6wungVEHhjBGGAd9DucQEgyDuEDA3AMlECjRHpYDUCHPAFfHSQh2uenEK3x2GEkEgzHZEPgm7lkqGCyWCmQzKhRwn/4h04N2NKEja9vY3U8y8TnLxA2Qfk3fIfs4aVCEJJM+TGCnRlryC8/RohHYF0ernbiLD4aGZVihK9jANSzCxytJ/K3Oh7rTeISeG2O6hhy4riQqjYtLgMNGTzXIWnNTig2A==

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

element_install_dir = makepath(programfiles32, "element_install")
element_install_path = makepath(element_install_dir, "ElementSetup.exe")


def install():
    mkdirs(element_install_dir)
    filecopyto("ElementSetup.exe", element_install_path)
    element_squirrel_remove()


def session_setup():
    
    programdata_user_dir = makepath(programdata, get_current_user)
    programdata_app_dir = makepath(programdata_user_dir, "Element")

    if isdir(programdata_app_dir):
        if not isfile(makepath(programdata_app_dir, ".dead")):
            try:
                app_uninstall_cmd = rf'"{programdata_app_dir}\Update.exe" --uninstall -s'
                run(app_uninstall_cmd)
            except:
                print("Unable to remove Element in: %s" % programdata_app_dir)
        remove_tree(programdata_app_dir)

    if dir_is_empty(programdata_user_dir):
        remove_tree(programdata_user_dir)

    # Install app
    user_app_dir = makepath(user_local_appdata, "Element")
    element_versions = glob.glob(makepath(user_app_dir, "**/ElementSetup.exe"))
    if element_versions:
        element_version = "1.0"
        for d in element_versions:
            if Version(get_file_properties(d)["ProductVersion"]) > Version(element_version):
                element_version = get_file_properties(d)["ProductVersion"]
        if Version(control.get_software_version()) > Version(element_version):
            run('"%s"' % element_install_path)
        else:
            print("Element already up-to-date (%s)" % element_version)
    else:
        run('"%s"' % element_install_path + " --silent")


    # Element interact differently if user is admin
    if running_as_admin():
        element_squirrel_remove()


def uninstall():
    if isdir(element_install_dir):
        remove_tree(element_install_dir)
    element_squirrel_remove()


    # if element was uninstalled a .dead file is left behind to prevent automatic reinstall
    for user_dir in glob.glob(makepath(systemdrive, "Users", "*")):
        # "C:\Users\username\AppData\Local\element-desktop\Update.exe"
        local_appdata_app_dir = makepath(user_dir, "AppData", "Local", "element-desktop")
        if isdir(local_appdata_app_dir):
            if not isfile(makepath(local_appdata_app_dir, ".dead")):
                try:
                    app_uninstall_cmd = rf'"{local_appdata_app_dir}\Update.exe" --uninstall -s'
                    print(app_uninstall_cmd)
                    run(app_uninstall_cmd)
                except:
                    print("Unable to remove Element for user: %s" % user_dir.split(os.sep)[-1])
            remove_tree(local_appdata_app_dir)

        # "C:\Users\jpadmin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Element Inc"
        start_shortcut = makepath(user_dir, r"AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Element")
        desktop_shortcut = makepath(user_dir, r"Desktop\Element.lnk")
        if isfile(desktop_shortcut):
            remove_file(desktop_shortcut)
        if isdir(start_shortcut):
            remove_tree(start_shortcut)


def element_squirrel_remove():
    squirrel_dir = makepath(programdata, "SquirrelMachineInstalls")
    element_old_installer = makepath(programdata, "Element.exe")
    if isfile(element_old_installer):
        remove_file(element_old_installer)
    if dir_is_empty(squirrel_dir):
        remove_tree(squirrel_dir)

from setuphelpers import *
import waptlicences


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    update_dict = {"windows": ".exe"}
    download_url = "https://packages.element.io/desktop/install/win32/x64/Element%20Setup.exe"

    latest_bin = download_url.rsplit("/")[-1].replace("%20","")

    version_url = "https://api.github.com/repos/element-hq/element-web/releases/latest"


    # Getting latest version information from official sources

    json_load = wgets(version_url, proxies=proxies, as_json=True)
    version = json_load["tag_name"].replace("v", "").replace(".windows", "")

    # Downloading latest binaries
    print(f"Latest version of {control.name} is: {version}")
    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)

    
    # Check signature bin
    expected_issuer = 'ELEMENT CREATIONS LIMITED'
    sign_name = waptlicences.check_exe_signing_certificate(latest_bin)[0]
    if sign_name != expected_issuer:
        error('Bad issuer %s != %s ' % (sign_name,expected_issuer))



    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")

    # Deleting binaries
    for f in glob.glob("*.exe"):
        if f != latest_bin:
            remove_file(f)
    
    control.set_software_version(version)
    control.save_control_to_wapt()

    return package_updated

25314da0144b857cda0330028da495dc788a8df74dfd840ed8fe715b838e0eff : ElementSetup.exe
01ca7fe94636e5a08fcb73849d3b5df25d51e2c82f4dd1a08f01798b25899819 : WAPT/certificate.crt
febbdb5574d0ac3b2681d0ce3e68db46796438668595ac5296586c6158ef7d04 : WAPT/control
97bc7b132a900ec71b17a423ad8c979dac0134bdde3a89726d263874c7fd2f3e : WAPT/icon.png
cf2bd4091ee8fb899ffd0341a96098bf9f0114f093775f986ebf9b8b3cc6def0 : luti.json
0da3704f700b966254a0b9372407bf876386ca5cb29ea7474726c7d6bc6a445e : setup.py
98eaf88cfb60a186b492db2369d70fd53813459777b2386962f2223ab577323c : update_package.py