tis-naps2 icon

NAPS2

Silent install package for NAPS2

7.5.2-1

  • package: tis-naps2
  • name: NAPS2
  • version: 7.5.2-1
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Simon Fonteneau,Pierre COSSON,Clément Baziret
  • licence: opensource_free,wapt_public
  • locale: all
  • target_os: windows
  • impacted_process: NAPS2.exe
  • architecture: x86
  • signature_date:
  • size: 12.06 Mo
  • installed_size: 7.93 Mo

package           : tis-naps2
version           : 7.5.2-1
architecture      : x86
section           : base
priority          : optional
name              : NAPS2
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Simon Fonteneau,Pierre COSSON,Clément Baziret
description       : Free software to scan documents, edit and convert them to PDF and other extensions.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : 
installed_size    : 7929715
impacted_process  : NAPS2.exe
description_fr    : Logiciel libre permettant de scanner des documents, les éditer et les convertir vers le format PDF et d'autres extensions.
description_pl    : Darmowe oprogramowanie do skanowania dokumentów, edycji i konwersji do formatu PDF i innych rozszerzeń
description_de    : Kostenlose Software zum Scannen, Bearbeiten und Konvertieren von Dokumenten in PDF und andere Erweiterungen
description_es    : Software gratuito para escanear documentos, editarlos y convertirlos a PDF y otras extensiones
description_pt    : Software gratuito para digitalizar documentos, editá-los e convertê-los para PDF e outras extensões
description_it    : Software gratuito per scansionare documenti, modificarli e convertirli in PDF e altre estensioni
description_nl    : Gratis software om documenten te scannen, te bewerken en te converteren naar PDF en andere extensies
description_ru    : Бесплатная программа для сканирования документов, их редактирования и преобразования в PDF и другие расширения
audit_schedule    : 
editor            : 
keywords          : 
licence           : opensource_free,wapt_public
homepage          : 
package_uuid      : d7bf7d05-3c60-42b8-9679-de267c0ddc1b
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : c48c5e64a0ec077ccaf7f3c70ca12299f2056c13e7b3eb6471b2c72cde49b797
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-10-10T01:01:49.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         : F+eUxdapEgDnID/gFShHas/hKnLq65CClQIXTDnh1S/Sz76KHccy/rU7KsGKN34PJDVSFNPWimhkfywyJSsFeKsjTTMZMFAoODPfFEOWCF/fga1+Yki8QOfqSRt4WxIIas05rHyH/xGEY+kok0Z7h1hY8GtLWngMoXkuw+3F+2hw8q6q40EJJjrFvrdeYmDreu0Ah+CB2K9jrEyAWsbWfgrDn3spmwfyb2PWwJM0vUqAey8nxyvgZc3FqPY4H8E2S/kMT64GYEYiTpelaoL9llTVgEJeXuTleffPl9euLSp4N6PLj0v4/eiH3W9HhCqCrsb1I0cs2E1QP+tpB90YIg==

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


def install():
    install_msi_if_needed(
        glob.glob("naps2-*.msi")[0],
        killbefore="NAPS2.exe",
        remove_old_version=True,
    )

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


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    api_url = "https://api.github.com/repos/cyanfish/naps2/releases/latest"
    download_dict = {
        "windows-x64": "-win-x64.msi",
        "windows-x86": "-win-x86.msi",
    }

    # Getting latest version information from official sources
    print("API used is: %s" % api_url)
    json_load = wgets(api_url, proxies=proxies, as_json=True)
    version = json_load["tag_name"].replace("v", "").replace(".windows", "")
    for to_download in json_load["assets"]:
        if download_dict[control.target_os + "-" + ensure_list(control.architecture)[0]] in to_download["name"]:
            download_url = to_download["browser_download_url"]
            latest_bin = to_download["name"]
            break

    # Downloading latest binaries
    print("Latest %s version is: %s" % (control.name, 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)

    # Deleting outdated binaries
    remove_outdated_binaries(latest_bin)

    # Checking version from file
    if get_os_name() == "Windows" and "windows" in control.target_os.lower():
        version_from_file = get_version_from_binary(latest_bin)
        if Version(version_from_file, 4) == Version(version, 4):
            print(f"INFO: Binary file version ({version_from_file}) corresponds to online version ({version})")
        else:
            error(f"ERROR: Binary file version ({version_from_file}) do NOT corresponds to online version ({version})")

    # 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

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
89b728339517acbaafa6882c53d464e508201d77ff3114d17d3929249fe1f81b : WAPT/control
c48c5e64a0ec077ccaf7f3c70ca12299f2056c13e7b3eb6471b2c72cde49b797 : WAPT/icon.png
1a60ee3ccc5f13639892c1c55202b4ecc446f19138c1bcf47ea9562327e5a65d : luti.json
75aecedc7c081afed2f32f0746eff10ace05dfbaf0a34fbe03b9b589e71bf010 : naps2-7.5.2-win-x86.msi
04c5c9ac3405a581b9b7507bbfe393c9e848cafb3b065621864539894f9b9b1f : setup.py
ccf2a8d323e72848fc126353bafc6898d376ba08f19c1bbdbbf032b282e13b77 : update_package.py