tis-birdtray icon

Birdtray

Silent install package for Birdtray

1.11.4-1

package           : tis-birdtray
version           : 1.11.4-1
architecture      : x64
section           : base
priority          : optional
name              : Birdtray
categories        : 
maintainer        : WAPT Team,Tranquil IT,Amel FRADJ
description       : Birdtray is a new mail notification in the system tray for Thunderbird 60+ that doesn't require any extensions
depends           : tis-microsoft-visual-studio-buildtools-2019
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Birdtray est une notification de nouveau courrier dans la barre d'état système pour Thunderbird 60+ qui ne nécessite pas d'extensions
description_pl    : Birdtray to nowe powiadomienie o poczcie w zasobniku systemowym dla Thunderbirda 60+, które nie wymaga żadnych rozszerzeń
description_de    : Birdtray ist eine Benachrichtigung über neue Post in der Taskleiste für Thunderbird 60+, für die keine Erweiterungen erforderlich sind
description_es    : Birdtray es una nueva notificación de correo en la bandeja del sistema para Thunderbird 60+ que no requiere ninguna extensión
description_pt    : O Birdtray é uma nova notificação de correio no tabuleiro do sistema para o Thunderbird 60+ que não necessita de quaisquer extensões
description_it    : Birdtray è una nuova notifica di posta nella barra delle applicazioni per Thunderbird 60+ che non richiede alcuna estensione
description_nl    : Birdtray is een nieuwe mailnotificatie in het systeemvak voor Thunderbird 60+ waarvoor geen extensies nodig zijn
description_ru    : Birdtray - это уведомление о новой почте в системном трее для Thunderbird 60+, не требующее никаких расширений
audit_schedule    : 
editor            : 
keywords          : 
licence           : GPL-3.0 license
homepage          : https://github.com/gyunaev/birdtray
package_uuid      : b345e5d4-82b5-4448-a2db-dddae795faad
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : eae52a45b7b45bdd05d7a2a91a11a6ef5573b46344a819840bd87e1e776930dd
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : TOP+iia+u+lYum11S6RAWpVjC33LUHIdiZNXjAqgQRamjTQrBxO/Yz3ufPVDz48GNevPxWdFFIYueA9lwmJShMt/f8pQOFtFhmzhaORJDPrpFFbA99a+oDK2qy6GsPS4+hLwvzqDNNAohbM/V/ql4JuzbkLlugmCZVBlLyd6V0PXXsOPXu9l10COYL/R2LWnTI3qdfbMc0AVbo5WUqMbagnPK8WZOFmD2VIsm9ZCKqTur+HG+GnEkkUUtUkaFIYjLt9Amc1pCHYrwSaJoIrE18g48xNGQTD/TwkSVhYrpnPmtmJ1j4pPcZclSEDwxQagtB4txt+reNaTORf7OJqFKg==
signature_date    : 2024-08-19T11:00:55.392957
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 *

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    # Declaring local variables
    bin_name = glob.glob('Birdtray-*.exe')[0]
    
    for u in installed_softwares('Birdtray'):
        if Version(u['version']) < Version(control.get_software_version()):
            run(uninstall_cmd(u['key']))
    # Installing the software
    
    install_exe_if_needed(bin_name,
        silentflags='/S /allusers',
        key='Birdtray',
        min_version=control.get_software_version(),
    )
    uninstallkey.clear()

def audit():
    # Declaring local variables
    audit_status = "OK"
    detected_apps = installed_softwares("Birdtray")
    if detected_apps:
        installed_version = detected_apps[0]["version"]
        control.name = detected_apps[0]["name"]
    else:
        installed_version = ""
        control.name = control.package.split("-", 1)[-1].replace("-", " ").title()
    audit_version = False

    # Auditing software
    if not installed_version:
        print(f"{control.name} is not installed.")
        audit_status = "ERROR"
    elif audit_version and Version(installed_version, 4) < Version(control.get_software_version(), 4):
        print(f"{control.name} ({installed_version}) installed version should be: {control.get_software_version()}")
        audit_status = "WARNING"
    else:
        print(f'{control.name} ({installed_version if not installed_version in control.name else "" }) is installed.')
        audit_status = "OK"

    return audit_status

def uninstall():
    # Force uninstalling the software
    for to_uninstall in installed_softwares(name="Birdtray"):
        print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
        killalltasks(ensure_list(control.impacted_process))
        
        try:
            # Adding silent flags to the uninstall command
            uninstall_command = uninstall_cmd(to_uninstall["key"]) + " /S /allusers"
            run(uninstall_command)
            wait_uninstallkey_absent(to_uninstall["key"], max_loop=60)
        except Exception as e:
            print(f"Error during uninstallation: {e}")
            # Handling the case where Birdtray might already be partially uninstalled
            print("Birdtray might have already been uninstalled.")
            print("Removing Birdtray from the list of installed programs.")
            
        if uninstall_key_exists(to_uninstall["key"]):
            unregister_uninstall(to_uninstall["key"], win64app=to_uninstall["win64"])
        
        # Clean up any remaining files
        if isdir(to_uninstall["install_location"]):
            print(f"Removing remaining files in {to_uninstall['install_location']}")
            remove_tree(to_uninstall["install_location"])

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

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def update_package():
    result = False
    proxies = get_proxies()

    if not proxies:
        proxies = get_proxies_from_wapt_console()
    dict_arch = {
        "x64" :"-Win-x64.exe",
        "x86" :"-Win-x86.exe"
    }
    git_repo = "gyunaev/birdtray"
    url_api = "https://api.github.com/repos/%s/releases/latest" % git_repo

    # Getting latest version information from official sources
    print("API used is: %s" % url_api)
    json_load = json.loads(wgets(url_api, proxies=proxies))

   # Getting latest version information from official sources
    print("API used is: %s" % url_api)
    json_load = json.loads(wgets(url_api, proxies=proxies))

    for download in json_load["assets"]:
        if download["browser_download_url"].endswith('.exe') and dict_arch[control.architecture] in download["browser_download_url"]:
            url_dl = download["browser_download_url"]
            version = json_load["tag_name"].replace("v","")
            filename = download["name"]
            break

    if not isfile(filename):
        package_updated = True
        wget(url_dl,filename,proxies=proxies)

    #nettoyer les fichiers temporaires
    for f in glob.glob('*.exe'):
        if f != filename:
            remove_file(f)
    version =get_version_from_binary(filename)
    control.set_software_version(version)
    control.save_control_to_wapt()

    

cda7388ae676f4be6409f637b5c5b5caeb4fe28d47d2b05140abe151652c6b62 : setup.py
a85d70a384db3a75095bf8342b3c4cd9015524076d1881974615ffef2bb4feec : Birdtray-1.11.4-Win-x64.exe
da1cb209d7230809dc26806112a4207bb153bf779d762bdde462afe97745bca0 : update_package.py
eae52a45b7b45bdd05d7a2a91a11a6ef5573b46344a819840bd87e1e776930dd : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
581f7fce2fa41c77e1df338f9fef931387432b7a0daa195efb86a79f80f29a94 : luti.json
f34f25bc293701363b568ffac0a28e59272a050b79e1cadf24a5c60a49e602a6 : WAPT/control