tis-deepl icon

DeepL

Paquet d’installation silencieuse pour DeepL

25.7.2.17169-10

  • package: tis-deepl
  • name: DeepL
  • version: 25.7.2.17169-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: 326.67 Mo
  • homepage : https://www.deepl.com/
  • depends:

package           : tis-deepl
version           : 25.7.2.17169-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      : cecbd3f9-4999-4e50-8aa2-e7db171d477a
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-08-09T16:10:57.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         : UPURYT8FmOUX7AFbKgaFYzVmadfADsfPV2+koStI7pv3SFP0mE0h5nFmbC7a/4Czx3lxIUyVKMigxQyBJwdx1k9CxFdWpdGVdAFs9tdRZBXRSynpOePsUBbaYUi10slp8bHLQAFD4RAMC1UhTtsbNG09gnOhBj49CjK0lb3g+WGyWmaDhznbrre7RdFJ0qIP1R5r56MBnE35uQRgGjZ8ntjuowK8j9gLKwmnuBwDsE5xmIsfQTLn5Z55vrd+1BRYw8EEt1LcO+ZOVIB+UE/fX4qDJJmDEsJA/G7vnNrdthwMe4rNg4yjtL2/l3GfEIDbh0YTw2ytd0O0abb0lBpo5A==

# -*- 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

6b4a2db8e4e1325a09b21ce6bd05372bcd8c75180498d5949b9fa8342e3201c2 : DeepL.zip
c7f7bab98e11b4a336897c452a4f357ba92c3c41dbfcc526a31d06d08f544b21 : DeepLSetup.exe
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
8e401b7ea6046c03c10370c8ebbfb566d54d73185c49e037774d2b886ba25bba : WAPT/control
2cc45845a553e6f3939b26037578f62a894c89b3b5d33c12a172aaa1dd83accf : WAPT/icon.png
98c889daafccb1679d0b714f7bdbbc2a0ff48897331fdfe30bfb8484d34ffbf9 : import.cmd
f7985773676f4fa86a5cd9dec70df3b5d1a2d0117adbd900bfa315f7c58ffce0 : luti.json
954b3d9a579172b3957d23736b30e9622ac684c282da09a92dac9b2abec0d51f : setup.py
84bed3538fa261277b01d1e9dfb7e56c467996cc27c2d7395b8ac09b02d2c298 : update_package.py