tis-python38-32 icon

Python 3.8 (32-bit)

Paquet d’installation silencieuse pour Python 3.8 (32-bit)

3.8.10-41

  • package: tis-python38-32
  • name: Python 3.8 (32-bit)
  • version: 3.8.10-41
  • categories: Development
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: Python Software Foundation
  • licence: Python Software Foundation License
  • locale: all
  • target_os: windows
  • architecture: all
  • signature_date:
  • size: 26.94 Mo
  • installed_size: 129.99 Mo
  • homepage : https://www.python.org/
  • depends:

package           : tis-python38-32
version           : 3.8.10-41
architecture      : all
section           : base
priority          : optional
name              : Python 3.8 (32-bit)
categories        : Development
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Python is an interpreted, high-level, general-purpose programming language
depends           : tis-vcredist
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://www.python.org/downloads/windows/
installed_size    : 129994752
impacted_process  : 
description_fr    : Python est un langage de programmation interprété, multi-paradigme et multiplateformes
description_pl    : Python jest interpretowanym, wysokopoziomowym językiem programowania ogólnego przeznaczenia
description_de    : Python ist eine interpretierte Hochsprachenprogrammiersprache für allgemeine Zwecke
description_es    : Python es un lenguaje de programación interpretado, de alto nivel y de propósito general
description_pt    : Python é uma linguagem de programação interpretada, de alto nível, de uso geral
description_it    : Python è un linguaggio di programmazione interpretato, di alto livello e di uso generale
description_nl    : Python is een geïnterpreteerde, algemene programmeertaal op hoog niveau
description_ru    : Python - интерпретируемый, высокоуровневый язык программирования общего назначения
audit_schedule    : 
editor            : Python Software Foundation
keywords          : python,3,3.8,programming,language,interpreted,py,.py,code,coding,language,object-oriented
licence           : Python Software Foundation License
homepage          : https://www.python.org/
package_uuid      : 84331a50-5f7d-4b0d-a9fa-4c468ae84e67
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://docs.python.org/3.8/whatsnew/changelog.html
min_os_version    : 6.0
max_os_version    : 
icon_sha256sum    : b55b23fa81945c6cd4c2f4f114188aa9f8f3d0c3cbb9fb353b2803ffbb67b43b
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : YQ4tI/N1MWg3JAk44Ob0KNvJ7m5i7Q3zpOIaMFXttJVhvlS6d3Y+RFHetHAmRwqyrK3zhf3qDc3TnKJ0dD655eTlg16FHaYTd05QsixzBqhlLLRRAJCqM+Wg9GawVB3IuWSUz9aDouQ+AWXTpA/lfxnYrVzRUEmoGf/m8grevfmvDDIbGz0IfeT1WfUGSiGcdkupUtZF8tjkWWmvofVPOeL0+xinHzRAgX5EChRw2JIg8es98Hqw7D72jthma4O/gdj2Wm3ig+urOVP0mVUR6D+qpPJioohptf6kWUxywT1rwNnTccs6XuDhBgfxYJtIoTQLHvo1saE0/aE+Uajv7A==
signature_date    : 2023-12-20T12:00:16.535301
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"""
Installation procedure: https://docs.python.org/3.8/using/windows.html
"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_contains = "python-"
python_version_to_uninstall_list = []
python_version_to_keep_list = ["3.6"]


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    short_version = ".".join(package_version.split(".")[:2])
    digit_version = "".join(package_version.split(".")[:2])
    bin_name = glob.glob("*%s*.exe" % bin_contains)[0]
    app_name = control.name
    product_name = get_file_properties(bin_name)["ProductName"]
    if control.architecture == "x64":
        arch = "64-bit"
        app_dir_sub = makepath(programfiles, "Python%s")
    elif not iswin64():
        arch = "32-bit"
        app_dir_sub = makepath(programfiles, "Python%s-32")
        if not isdir(app_dir_sub) and isdir(makepath(programfiles, "Python%s")):
            # app_dir_sub = makepath(programfiles, "Python%s")
            uninstall_python(short_version)
    else:
        arch = "32-bit"
        app_dir_sub = makepath(programfiles32, "Python%s-32")
    app_dir = app_dir_sub % digit_version
    silent_args = '/quiet InstallAllUsers=1 PrependPath=1 AssociateFiles=1 Include_launcher=0 InstallLauncherAllUsers=0 TargetDir="%s"' % app_dir
    # silent_args = '/quiet InstallAllUsers=1 PrependPath=1 AssociateFiles=1 Include_launcher=0 InstallLauncherAllUsers=0'

    # Uninstalling Python 3.9 for Python 3.1x
    for python_version_to_uninstall in python_version_to_uninstall_list:
        if installed_softwares("Python %s" % python_version_to_uninstall):
            try:
                uninstall_python(python_version_to_uninstall)
            except:
                print("WARNING: Unable to uninstall Python %s.x" % python_version_to_uninstall)

    # Repairing if older installation is incomplete
    python_app = installed_softwares(name="Python %s" % short_version)
    if python_app and len(python_app) < 9 and not force:
        print("Repairing: %s in: %s" % (product_name, app_dir))
        run('"%s" /repair %s' % (bin_name, silent_args))

    # Installing the package
    if need_install(name="Python %s..*(%s)" % (short_version, arch), min_version=get_version_from_binary(bin_name), force=force):
        print("Installing: %s in: %s" % (product_name, app_dir))
        install_exe_if_needed(
            bin_name,
            silentflags=silent_args,
            key="",
            min_version=package_version,
        )
        if need_install(name="Python %s..*(%s)" % (short_version, arch), min_version=get_version_from_binary(bin_name)):
            error("%s is not installed" % app_name)
    else:
        print("%s is already installed and up-to-date" % app_name)

    # Copying installer for future uninstall
    if not isfile(makepath(app_dir, bin_name)):
        print("Copying: %s in: %s for future uninstall" % (bin_name, app_dir))
        filecopyto(bin_name, app_dir)


def uninstall():
    # Declaring local variables
    package_version = control.get_software_version()
    short_version = ".".join(package_version.split(".")[:2])
    uninstall_python(short_version)


def uninstall_python(python_version):
    # Declaring local variables
    digit_version = "".join(python_version.split(".")[:2])
    silent_uninst_args = "/uninstall /quiet"
    if control.architecture == "x64":
        arch = "64-bit"
        old_app_dir_sub = makepath(programfiles, "Python%s")
    elif not iswin64():
        arch = "32-bit"
        old_app_dir_sub = makepath(programfiles, "Python%s-32")
        if not isdir(old_app_dir_sub) and isdir(makepath(programfiles, "Python%s")):
            old_app_dir_sub = makepath(programfiles, "Python%s")
    else:
        arch = "32-bit"
        old_app_dir_sub = makepath(programfiles32, "Python%s-32")
    old_app_dir = old_app_dir_sub % digit_version

    # uninstalling it first avoids errors
    skip_uninstall = ["Executables", "Core Interpreter"]
    for p in skip_uninstall:
        for soft in installed_softwares("^Python %s" % python_version):
            if p in soft["name"]:
                continue
            for python_to_keep in python_version_to_keep_list:
                if python_to_keep in soft["name"]:
                    continue
            if iswin64() and (not arch in soft["name"]):
                continue
            print("Removing: %s" % soft["name"])
            run(uninstall_cmd(soft["key"]))

    # Uninstalling the package
    try:
        old_app_installer_path = glob.glob(r"%s\*%s*.exe" % (old_app_dir, bin_contains))[0]
        print("Removing Python %s with installer in folder: %s" % (python_version, old_app_dir))
        run('"%s" %s' % (old_app_installer_path, silent_uninst_args))
    except:
        print("Unable to remove Python %s with installer in folder: %s" % (python_version, old_app_dir))

    for soft in installed_softwares(name=r"^Python %s" % python_version):
        for python_to_keep in python_version_to_keep_list:
            if python_to_keep in soft["name"]:
                continue
        if iswin64() and (not arch in soft["name"]):
            continue
        print("Removing: %s" % soft["name"])
        run(uninstall_cmd(soft["key"]))

    # Removing remaining files of this Python version
    try:
        if isdir(old_app_dir):
            print("Removing remaining folder: %s" % old_app_dir)
            remove_tree(old_app_dir)
    except:
        print("Unable to remove Python %s remaining folder: %s" % (python_version, old_app_dir))

    # Removing system environment variables
    remove_from_system_path(old_app_dir)
    remove_from_system_path(makepath(old_app_dir, "Scripts"))

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


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = "https://www.python.org/downloads/windows/"
    if control.architecture == "x64":
        arch = "64-bit"
    else:
        arch = "32-bit"

    # Getting latest version from official sources
    version = None
    for bs_search in bs_find_all(url, "a", proxies=proxies):
        if bs_search.string:
            if "https://www.python.org/ftp/python/3.8" in bs_search["href"] and "Windows installer (%s)" % arch in bs_search.string:
                version = bs_search["href"].split("/")[-2]
                latest_bin = bs_search["href"].split("/")[-1]
                download_url = bs_search["href"]
                break

    print("Latest %s version is: %s" % (app_name, version))
    print("Download URL is: %s" % download_url)

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

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin, "ProductName").split(" (")[0].split(" ")[-1]
        if Version(version) != Version(version_from_file) and version_from_file != "":
            print("Changing version to the version number of the binary (from: %s to: %s)" % (version, version_from_file))
            os.rename(latest_bin, bin_contains + version_from_file + latest_bin.split(version)[-1])
            version = version_from_file

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
    # control.set_software_version(version)
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version)

    # Validating or not update-package-sources
    return result

b5fda7007822f4d6fb4766d04ab7ee9a3b2c6948d654a2fa370936a80bc9b513 : setup.py
1d6e1ca7bba628300b53c3d17f85ed7fd1eb0a3847fa2fa77a07e719cb7e806b : update_package.py
ad07633a1f0cd795f3bf9da33729f662281df196b4567fa795829f3bb38a30ac : python-3.8.10.exe
b55b23fa81945c6cd4c2f4f114188aa9f8f3d0c3cbb9fb353b2803ffbb67b43b : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
6c1c5ab4b1d1504a40e990393e087d9b4f35e6bdf17e871cee67a0527f59ebee : luti.json
7e50440b8bc370cf6942974cd923491a7f2179574660ae1e43f39ca493edb605 : WAPT/control