tis-deepl icon

DeepL

Paquet d’installation silencieuse pour DeepL

25.5.2.16201-10

  • package: tis-deepl
  • name: DeepL
  • version: 25.5.2.16201-10
  • categories: Office,Utilities
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ,Clément Baziret
  • editor: Deepl
  • licence: proprietary_free,wapt_public
  • locale: all
  • target_os: windows
  • impacted_process: DeepL
  • architecture: all
  • signature_date:
  • size: 328.09 Mo
  • homepage : https://www.deepl.com/
  • depends:

package           : tis-deepl
version           : 25.5.2.16201-10
architecture      : all
section           : base
priority          : optional
name              : DeepL
categories        : Office,Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ,Clément Baziret
description       : DeepL Translator is a neural machine translation service
depends           : tis-dotnet9
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : https://www.deepl.com/app/
installed_size    : 
impacted_process  : DeepL
description_fr    : DeepL est un service de traduction automatique
description_pl    : DeepL Translator to neuronowa usługa tłumaczenia maszynowego
description_de    : DeepL Translator ist ein neuronaler maschineller Übersetzungsdienst
description_es    : DeepL Translator es un servicio de traducción automática neuronal
description_pt    : DeepL O tradutor é um serviço de tradução automática neural
description_it    : DeepL Translator è un servizio di traduzione automatica neurale
description_nl    : DeepL Translator is een neurale machine vertaaldienst
description_ru    : DeepL Translator - это сервис нейронного машинного перевода
audit_schedule    : 
editor            : Deepl
keywords          : deepl,translator,neural,machine,translation,service
licence           : proprietary_free,wapt_public
homepage          : https://www.deepl.com/
package_uuid      : ee76d4e5-9132-4694-bd25-6591d88bc2f7
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : 2cc45845a553e6f3939b26037578f62a894c89b3b5d33c12a172aaa1dd83accf
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-06-02T16:12:55.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         : Jt86Y0aK2bb6X6ZzhluEQL5PyLjSF0CAr0mpUmt5KzZblwMRYhszriHSKIqisS8PCXBIWsCdq8Lq2aSGdQRgemMDFV++yO8KctcfykcKojPOopacqWqq7Mzr+up80asI3kIY2PPLgCQL5a5oJ1JkpjGeBkVn2FPHsAgXRRgEbRD4CLdJPTPR3xP06nU10QtC3n7n1UHgL/H0iwGLCkvUIEDqAbgyWVIgmxO3Ut1qtCMoo56Fi9Gyda1GqNrWB6e1LGX6YwHEEFTfgUTzr6dFz68baBfHSwjgfv+bta1JLlbFjMx1fAzPCnNq7DCKM9wlhBfvRvFLYMEUh6LU0FXEFg==

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

"""
    Usage of the DeepLSetup.exe seems to crash when there is already 0install installed.
    It tries to override the 0install directory in Program Files (C:\Program Files\Zero Install\)

    We are now doing a portable install of DeepL with the sources downloaded from 0install executable.
    This allow to avoid a lot of complication due to the usage of 0install and wrong usage of 0install by Deepl.
"""

app_name = "DeepL"
app_dir = makepath(programfiles, app_name)
app_path = makepath(app_dir, f"{app_name}.exe")
icon_path = app_path
audit_version = True

def get_installed_version(app_path):
    return get_file_properties(app_path).get("FileVersion", "")


def install():
    # Uninstalling older package version (if deepl in registry, it is old package version)
    for to_uninstall in installed_softwares(name="DeepL"):
        print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
        killalltasks(ensure_list(control.impacted_process))
        run(uninstall_cmd(to_uninstall["key"]))
        wait_uninstallkey_absent(to_uninstall["key"])

    # Declaring local variables
    archive_name = glob.glob(f"{app_name}.zip")[0]

    # Installing software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir) and force:
        remove_tree(app_dir)
    mkdirs(app_dir)
    print("Extracting: %s to: %s" % (archive_name, app_dir))
    unzip(archive_name, programfiles)

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


def audit():
    # Auditing software
    audit_status = "OK"
    installed_version = get_installed_version(app_path)
    if Version(installed_version) < Version(control.get_software_version()) and audit_version:
        print("%s is installed in version (%s) instead of (%s)" % (app_name, installed_version, control.get_software_version()))
        audit_status = "WARNING"
    elif isdir(app_dir) and not dir_is_empty(app_dir):
        print("%s (%s) is installed" % (app_name, installed_version))
        audit_status = "OK"
    else:
        print("%s is not installed" % app_name)
        audit_status = "ERROR"
    return audit_status


def uninstall():
    # Uninstalling software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir):
        remove_tree(app_dir)

    # Removing shortcuts
    remove_desktop_shortcut(app_name)
    remove_programs_menu_shortcut(app_name)

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import xml.etree.ElementTree as ET

"""
    This update package download the DeeplSetup.exe from the official website,
    extract the sources from it and create a portable version of DeepL with the sources.
"""

def get_version_from_xml(xml_file_path):
    root = ET.parse(xml_file_path)
    namespace = {"zi": "http://zero-install.sourceforge.net/2004/injector/interface"}

    stable_version = [
        (impl.get("id"), impl.get("version"))
        for impl in root.findall(".//zi:implementation", namespace)
        if impl.get("stability") == "stable"
    ]
    def get_tuple_version(version_str):
        return Version(version_str[1], 4)
    version = sorted(stable_version, key=get_tuple_version, reverse=True)[0]

    return (version[0] + ".tgz", version[1])

def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies_from_wapt_console()
    if not proxies:
        proxies = get_proxies()
    download_url = "https://appdownload.deepl.com/windows/0install/DeepLSetup.exe"
    latest_bin = download_url.split("/")[-1]
    source_folder = "content"

    # Deleting binaries
    if isfile(latest_bin):
        remove_file(latest_bin)
    if isdir(source_folder):
        rmtree(source_folder)

    # Downloading latest binaries
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin) or not isdir(source_folder):
        print("Downloading %s and fetching sources" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
        # Fetch sources from exe file
        run([latest_bin, "--prepare-offline", "--verysilent"])
    else:
        print("Binary is present: %s" % latest_bin)

    # Extract from xml software version and source archive filename
    deepl_xml_file = glob.glob(makepath(os.getcwd(), source_folder, r"https%3a%2f%2fappdownload.deepl.com%2fwindows%2f0install%2fdeepl.xml"))[0]
    (deepl_archive, version) = get_version_from_xml(deepl_xml_file)
    deepl_archive = makepath(os.getcwd(), source_folder, deepl_archive)
    if not isfile(deepl_archive):
        error("Archive %s not found in content directory. Please check the 0install XML file." % deepl_archive)
    
    # Unzipping archives in content folder
    print("Creating deepl full archive with sources located in '%s'" % source_folder)
    for tgz in glob.glob(makepath(os.getcwd(), source_folder, "*.tgz")):
        print("Unzipping tar gz file: %s" % tgz)
        unzip_with_7zip(tgz, source_folder)
    # Unzipping the deepl archive
    unzipped_deepl_archive = makepath(os.getcwd(), source_folder, "deepl")
    deepl_tar_archive = glob.glob(makepath(os.getcwd(), source_folder, deepl_archive.replace(".tgz", ".tar")))[0]
    unzip_with_7zip(deepl_tar_archive, unzipped_deepl_archive)
    # Unzipping other archives in deepl folder
    for tar in glob.glob(makepath(os.getcwd(), source_folder, "*.tar")):
        if tar == deepl_archive.replace(".tgz", ".tar"):
            print("Skipping archive %s as it is the one we are updating to." % tar)
            continue
        print("Unzipping tar file: %s" % tar)
        unzip_with_7zip(tar, unzipped_deepl_archive)

    # Creating 7z archive with sources
    print("Creating archive deepl.zip")
    run([get_7z_path(), "a", "-tzip", "DeepL.zip", unzipped_deepl_archive])

    # Remove content folder
    remove_tree(source_folder)

    # 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

0287deefc9464b08e95e0d5ad8f382d09e50b1883bb4e37c8ca812694db0be65 : DeepL.zip
c0824599dec4170e272c800eb24f1cadc582d3f3dd6f351afa52b95dd4e81967 : DeepLSetup.exe
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
60f912fb27ccf37255cb1591efbb32ca14734b912e6d8f37f2c8a4d1f6e5b411 : WAPT/control
2cc45845a553e6f3939b26037578f62a894c89b3b5d33c12a172aaa1dd83accf : WAPT/icon.png
98c889daafccb1679d0b714f7bdbbc2a0ff48897331fdfe30bfb8484d34ffbf9 : import.cmd
c45eb150d38a46878e1ead458f19958484d70c34ab1b7917f528b9a272818d94 : luti.json
954b3d9a579172b3957d23736b30e9622ac684c282da09a92dac9b2abec0d51f : setup.py
84bed3538fa261277b01d1e9dfb7e56c467996cc27c2d7395b8ac09b02d2c298 : update_package.py