tis-sumatrapdf icon

Sumatra PDF

Paquet d’installation silencieuse pour Sumatra PDF

3.5.2-11

  • package: tis-sumatrapdf
  • name: Sumatra PDF
  • version: 3.5.2-11
  • categories: Media,Utilities
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: Krzysztof Kowalczyk, Simon Bünzli and others
  • licence: GPLv3
  • locale: all
  • target_os: windows
  • impacted_process: SumatraPDF
  • architecture: x64
  • signature_date:
  • size: 6.98 Mo
  • homepage : https://www.sumatrapdfreader.org/

package           : tis-sumatrapdf
version           : 3.5.2-11
architecture      : x64
section           : base
priority          : optional
name              : Sumatra PDF
categories        : Media,Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Sumatra PDF is a free PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, Comic Book (CBZ and CBR) reader for Windows.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://www.sumatrapdfreader.org/download-free-pdf-viewer.html
installed_size    : 
impacted_process  : SumatraPDF
description_fr    : Sumatra PDF est un lecteur gratuit de PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, Comic Book (CBZ et CBR) pour Windows
description_pl    : Sumatra PDF to darmowy czytnik plików PDF, eBooków (ePub, Mobi), XPS, DjVu, CHM, komiksów (CBZ i CBR) dla Windows
description_de    : Sumatra PDF ist ein kostenloser PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, Comic Book (CBZ und CBR) Reader für Windows
description_es    : Sumatra PDF es un lector gratuito de PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, Comic Book (CBZ y CBR) para Windows
description_pt    : Sumatra PDF é um leitor gratuito de PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, Comic Book (CBZ e CBR) para Windows
description_it    : Sumatra PDF è un lettore gratuito di PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, fumetti (CBZ e CBR) per Windows
description_nl    : Sumatra PDF is een gratis PDF, eBook (ePub, Mobi), XPS, DjVu, CHM, Stripboek (CBZ en CBR) lezer voor Windows
description_ru    : Sumatra PDF - это бесплатная программа для чтения PDF, электронных книг (ePub, Mobi), XPS, DjVu, CHM, комиксов (CBZ и CBR) для Windows
audit_schedule    : 
editor            : Krzysztof Kowalczyk, Simon Bünzli and others
keywords          : 
licence           : GPLv3
homepage          : https://www.sumatrapdfreader.org/
package_uuid      : 89a5875f-d917-4fd4-b371-a34f1a128cb0
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://www.sumatrapdfreader.org/docs/Version-history.html
min_os_version    : 6.0
max_os_version    : 
icon_sha256sum    : c57c7bd4990f3117be1a77cb7bb6244a88b5331c216a61bc3d4f6bf7b804bf4d
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : fcTmOt4szz5+QF41LTgoi/EUc2bZM1y+trhG09efD4sAjdlMggxv/J8K1ScEhjdDr1j46GxD/KAs4iot2mnU62rPHVCNpAvoOtIE0D7Rg3CjE7pVCTMXpr2ne0cU9Tyb3nZmBUm2oTm3JA4LR2w2dbQGqIIb5xWsyDcS2/4XX8tMZoTeGOlp6jetAPNxSdgBm+ubXlr2QHLCvUn9QfES75tYRNEONkg+bUoxuBVraXax8mcB5SIcK9ash0/V9tKsIB3L6JCf63aZlgrykXRs7BMzWgPRcNHNUC03qZ1+1PBMu2RU6KJrIGGbkFrplImPNFSuwNA2krNWANvMfLfYew==
signature_date    : 2023-10-30T10:00:22.399862
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 time

# Installation procedure: https://www.sumatrapdfreader.org/docs/Installer-cmd-line-arguments.html
# Defining variables
##silent_args = '-s -d "%s"' % makepath(programfiles,'SumatraPDF')
app_uninstallkey = "SumatraPDF"


def install():
    # Initializing variablesS
    package_version = control.get_software_version()
    bin_name = "SumatraPDF-%s-64-install.exe" % package_version
    app_name = control.name

    # Uninstalling older versions
    for uninstall in installed_softwares(uninstallkey=app_uninstallkey):
        if Version(uninstall["version"]) < Version(package_version):
            print("Older %s version found (%s)" % (app_name, uninstall["version"]))
            print("Removing: %s" % uninstall["name"])
            killalltasks(control.impacted_process)
            run(uninstall_cmd(uninstall["key"]))
            wait_uninstallkey_absent(uninstall["key"])
            if isdir(makepath(programfiles, "SumatraPDF")):
                remove_tree(makepath(programfiles, "SumatraPDF"))
            time.sleep = 60

    # Installing the package
    install_exe_if_needed(
        bin_name,
        silentflags="-s -all-users",
        key=app_uninstallkey,
        min_version=package_version,
    )

# -*- coding: utf-8 -*-
from setuphelpers import *
import bs4 as BeautifulSoup
import requests
import platform


# Installation procedure: https://www.sumatrapdfreader.org/docs/Installer-cmd-line-arguments.html

# Defining variables
bin_name_string = "SumatraPDF-%s-64-install.exe"


def update_package():
    print("Download/Update package content from upstream binary sources")

    # Getting proxy informations from WAPT settings
    proxy = {}
    if platform.system() == "Windows" and isfile(makepath(user_local_appdata(), "waptconsole", "waptconsole.ini")):
        proxywapt = inifile_readstring(makepath(user_local_appdata(), "waptconsole", "waptconsole.ini"), "global", "http_proxy")
        if proxywapt:
            proxy = {"http": proxywapt, "https": proxywapt}

    # Initializing variables
    app_name = control.name
    url = control.sources
    bin_end = bin_name_string.split("%s")[-1]

    # Getting latest version from official website
    page = requests.get(url, proxies=proxy, headers={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64)"}).text
    bs = BeautifulSoup.BeautifulSoup(page)
    bs_read = bs.findAll("a", {"onclick": "return SetupRedirect()"})
    for link in bs_read:
        if link["href"].endswith(bin_end):
            # https://www.sumatrapdfreader.org/dl2/SumatraPDF-3.2-64-install.exe
            url_dl = "https://www.sumatrapdfreader.org" + link["href"]

    latest_bin = url_dl.split("/")[-1]
    version = latest_bin.split("-")[1]

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)

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

        # Checking version from file
        version_from_file = get_file_properties(latest_bin)["ProductVersion"]
        if version != version_from_file and version_from_file != "":
            version = version_from_file
            old_latest_bin = latest_bin
            latest_bin = bin_name_string % version
            if isfile(latest_bin):
                remove_file(latest_bin)
            os.rename(old_latest_bin, latest_bin)
            print("Verified latest " + app_name + " version is: " + version)

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

    # Deleting outdated binaries
    for bin_in_dir in glob.glob("*.exe") or glob.glob("*.msi"):
        if bin_in_dir != latest_bin:
            print("Outdated binary: " + bin_in_dir + " Deleted")
            remove_file(bin_in_dir)

6a70751b4154a731cc9da8d319057736d07cf73e812049f3892f23c2fe0e0c5e : setup.py
82d644251263f4a12ea0c576784746d8acaf8db31c0e7f1aac82849ec9fde13f : update_package.py
c57c7bd4990f3117be1a77cb7bb6244a88b5331c216a61bc3d4f6bf7b804bf4d : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
13efa41d8be59d09ea74e6f40adca2f0ad4702bfcc8afea3ca34f9aaca69d2e4 : luti.json
2be4a27b83830ea07c6671c3557673d509544e5f70fc6b2dc8cc4388b302c1f2 : SumatraPDF-3.5.2-64-install.exe
d9f615a1c4bcb6f05b85c79c6433251be2e09da5062044a912e724aabda77247 : WAPT/control