tis-dotnet7 icon

.NET Runtime 7

Paquet d’installation silencieuse pour .NET Runtime 7

7.0.20-13
Dependency
Dependency

Les paquets PREPROD sont des paquets construits via LUTI. Ils restent généralement 5 jours en PREPROD, après quoi un deuxième scan VirusTotal est effectué pour vérifier que le status n'a pas changé.
Si le paquet réussit ce dernier contrôle, il est promu en PROD et publié sur le store.

  • package: tis-dotnet7
  • name: .NET Runtime 7
  • version: 7.0.20-13
  • categories: Dependency
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: Microsoft
  • licence: opensource_free,cpe:/a:mit:x11_license,wapt_public
  • locale: all
  • target_os: windows
  • architecture: arm64
  • signature_date:
  • size: 163.96 Mo
  • installed_size: 193.11 Mo
  • homepage : https://github.com/dotnet/runtime

package           : tis-dotnet7
version           : 7.0.20-13
architecture      : arm64
section           : base
priority          : optional
name              : .NET Runtime 7
categories        : Dependency
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : The .NET Desktop Runtime enables you to run existing Windows desktop applications. This release includes the .NET Runtime; you don't need to install it separately
depends           : 
conflicts         : 
maturity          : PREPROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : https://github.com/dotnet/runtime
installed_size    : 193107342
impacted_process  : 
description_fr    : Le moteur d'exécution .NET Desktop Runtime vous permet d'exécuter des applications de bureau Windows existantes. Cette version inclut le Runtime .NET ; vous n'avez pas besoin de l'installer séparément
description_pl    : Środowisko uruchomieniowe .NET Desktop Runtime umożliwia uruchamianie istniejących aplikacji pulpitu systemu Windows. Ta wersja zawiera środowisko uruchomieniowe .NET; nie trzeba go instalować osobno
description_de    : Mit der .NET Desktop Runtime können Sie vorhandene Windows-Desktop-Anwendungen ausführen. Diese Version enthält die .NET Runtime; Sie brauchen sie nicht separat zu installieren
description_es    : .NET Desktop Runtime le permite ejecutar las aplicaciones de escritorio de Windows existentes. Esta versión incluye .NET Runtime; no es necesario instalarlo por separado
description_pt    : O .NET Desktop Runtime permite-lhe executar aplicações existentes do ambiente de trabalho do Windows. Esta versão inclui o .NET Runtime; não é necessário instalá-lo separadamente
description_it    : Il .NET Desktop Runtime consente di eseguire le applicazioni desktop di Windows esistenti. Questa versione include il .NET Runtime; non è necessario installarlo separatamente
description_nl    : Met de .NET Desktop Runtime kun je bestaande Windows desktopapplicaties uitvoeren. Deze release bevat de .NET Runtime; je hoeft deze niet apart te installeren
description_ru    : .NET Desktop Runtime позволяет запускать существующие приложения для настольных систем Windows. Данный выпуск включает в себя .NET Runtime; устанавливать его отдельно не требуется
audit_schedule    : 
editor            : Microsoft
keywords          : 
licence           : opensource_free,cpe:/a:mit:x11_license,wapt_public
homepage          : https://github.com/dotnet/runtime
package_uuid      : b1f3da9a-5257-4500-ab9f-d8072bc0ad23
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/dotnet/core/tree/main/release-notes/7.0
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : 1460db9c3885967269ebbc71d898181ab7d1506f3212bafc2df3acc648d43db0
signer            : test
signer_fingerprint: b82fc8ef4a4475c0f69ac168176c2bfc58f572eb716c4eadd65e4785c155dd8e
signature_date    : 2026-01-28T14:20:43.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         : cIrsP7pEr5GkHAghwsK5gos5OPvk/FAw6SE3IAhqlnK+ydVkdkX3hSf5sBbIyZxElSI9bi+28N21POCD9zmlgfXzY1/n7aQ11EzXfvIkkC8q0fTIez43IpEKkfJx5Y32KrrIOJ9VNjIFkGyrPo0fTk6D1YTZQBm7awxm0s6xR+l6jse+6nGCZ2jzXnq7xcid5OwU+AJJkGMoQW6OJPnIJPo9ZTy85anHXSR+GY/nhy3mlYAyteb1qKr4ca661C8VHSiad4wT9JEERvxjyNL9EAuTAIBJjyxZGg9J2TpGgDivwYIpwj3ATovE57+x9sCtUzbbmmPlHm7crFqnIDY7cA==

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

"""
[
    {
        "key": "{33ED69D3-7E88-4885-9875-6C0711368017}",
        "name": "Microsoft Windows Desktop Runtime - 7.0.14 (x64)",
        "version": "56.56.4039",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{33ED69D3-7E88-4885-9875-6C0711368017}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": true,
    },
    {
        "key": "{9C583D0D-D10B-4E33-A3A8-CD07B6DB9E2D}",
        "name": "Microsoft .NET Runtime - 7.0.14 (x64)",
        "version": "56.56.4026",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{9C583D0D-D10B-4E33-A3A8-CD07B6DB9E2D}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": true,
    },
    {
        "key": "{9C80B2AB-2F2D-45B3-A287-DDA827E3A561}",
        "name": "Microsoft .NET Host - 7.0.14 (x64)",
        "version": "56.56.4026",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{9C80B2AB-2F2D-45B3-A287-DDA827E3A561}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": true,
    },
    {
        "key": "{D8110067-D041-4061-84F4-DAB281E54EAC}",
        "name": "Microsoft .NET Host FX Resolver - 7.0.14 (x64)",
        "version": "56.56.4026",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{D8110067-D041-4061-84F4-DAB281E54EAC}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": true,
    },
    {
        "key": "{2C1104B0-76A8-44BE-B5EE-513B3E453916}",
        "name": "Microsoft Windows Desktop Runtime - 7.0.14 (x86)",
        "version": "56.56.4039",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{2C1104B0-76A8-44BE-B5EE-513B3E453916}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": false,
    },
    {
        "key": "{2D709657-8E73-4DC2-BDB1-C12701D8A425}",
        "name": "Microsoft .NET Runtime - 7.0.14 (x86)",
        "version": "56.56.4026",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{2D709657-8E73-4DC2-BDB1-C12701D8A425}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": false,
    },
    {
        "key": "{65668C8B-8364-423C-8BD4-E17906EFE5D7}",
        "name": "Microsoft .NET Host FX Resolver - 7.0.14 (x86)",
        "version": "56.56.4026",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{65668C8B-8364-423C-8BD4-E17906EFE5D7}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": false,
    },
    {
        "key": "{7a903a43-d7fc-4538-8168-3a6ab10d06bb}",
        "name": "Microsoft Windows Desktop Runtime - 7.0.14 (x86)",
        "version": "7.0.14.33020",
        "install_date": "",
        "install_location": "",
        "uninstall_string": '"C:\\ProgramData\\Package Cache\\{7a903a43-d7fc-4538-8168-3a6ab10d06bb}\\windowsdesktop-runtime-7.0.14-win-x86.exe"  /uninstall',
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": false,
    },
    {
        "key": "{7f2c8be3-7757-4594-aead-09a5112e7725}",
        "name": "Microsoft Windows Desktop Runtime - 7.0.14 (x64)",
        "version": "7.0.14.33020",
        "install_date": "",
        "install_location": "",
        "uninstall_string": '"C:\\ProgramData\\Package Cache\\{7f2c8be3-7757-4594-aead-09a5112e7725}\\windowsdesktop-runtime-7.0.14-win-x64.exe"  /uninstall',
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": false,
    },
    {
        "key": "{8FAFE5CB-ED93-44CB-83E3-497E87DE8673}",
        "name": "Microsoft .NET Host - 7.0.14 (x86)",
        "version": "56.56.4026",
        "install_date": "2023-11-27 00:00:00",
        "install_location": "",
        "uninstall_string": "MsiExec.exe /X{8FAFE5CB-ED93-44CB-83E3-497E87DE8673}",
        "publisher": "Microsoft Corporation",
        "system_component": 0,
        "win64": false,
    },
]


"""


def install():
    dotnet_version = control.get_software_version().split(".")[0]

    # Installing the software
    silentflags = "/install /quiet /norestart"

    install_exe_if_needed(
        glob.glob("windowsdesktop-runtime-*x86.exe")[0],
        silentflags=silentflags,
        name=f"Microsoft Windows Desktop Runtime - {dotnet_version}.*(x86)",
        min_version="",
        force=True,  # force option, since the version is not easy to check, and the installer will take care of it.
    )
    
    if iswin64() or iswinarm():
        install_exe_if_needed(
            glob.glob("windowsdesktop-runtime-*x64.exe")[0],
            silentflags=silentflags,
            name=f"Microsoft Windows Desktop Runtime - {dotnet_version}.*(x64)",
            min_version="",
            force=True,  # force option, since the version is not easy to check, and the installer will take care of it.
        )

    if iswinarm():
        install_exe_if_needed(
            glob.glob("windowsdesktop-runtime-*arm64.exe")[0],
            silentflags=silentflags,
            name=f"Microsoft Windows Desktop Runtime - {dotnet_version}.*(arm64)",
            min_version="",
            force=True,  # force option, since the version is not easy to check, and the installer will take care of it.
        )


    # Clear uninstallkey to avoid the no-code audit and uninstall
    uninstallkey.clear()


def audit():
    # Declaring local variables
    audit_result = "OK"
    dotnet_version = control.get_software_version().split(".")[0]
    app_check = installed_softwares(name=f"Microsoft Windows Desktop Runtime - {dotnet_version}.*")
    audit_version = True

    # Auditing software
    if not app_check:
        print("%s is not installed" % control.package.split("-", 1)[-1].replace("-", " ").title())
        audit_result = "ERROR"
    elif audit_version:
        for to_audit in app_check:
            if r"ProgramData\Package Cache" in to_audit["uninstall_string"]:
                if Version(to_audit["version"]) < Version(control.get_software_version()):
                    print(f'{to_audit["name"]} is installed in version: {to_audit["version"]} instead of: {control.get_software_version()}.')
                    audit_result = "WARNING"
                else:
                    print("%s is installed and up-to-date." % to_audit["name"])

    return audit_result


def uninstall():
    # Declaring local variables
    dotnet_version = control.get_software_version().split(".")[0]

    for to_uninstall in installed_softwares(name=f"Microsoft Windows Desktop Runtime - {dotnet_version}.*"):
        if r"ProgramData\Package Cache" in to_uninstall["uninstall_string"]:
            print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
            killalltasks(ensure_list(control.impacted_process))
            run(uninstall_cmd(to_uninstall["key"]) + " /norestart")
            wait_uninstallkey_absent(to_uninstall["key"])
            if isdir(to_uninstall["install_location"]):
                remove_tree(to_uninstall["install_location"])


def iswinarm():
    return platform.machine() =='ARM64'

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


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    dotnet_version = ".".join(control.get_software_version().split(".")[:2])

    architecture = ensure_list(control.architecture)
    if "arm64" in architecture:
        archs = ["x86", "x64", "arm64"]
    elif "x64" in architecture:
        archs = ["x86", "x64"]
    else:
        archs = ["x86"]
        
    url = "https://dotnet.microsoft.com/en-us/download/dotnet/%s" % dotnet_version

    for arch in archs:
        # Getting latest version from official sources
        print("URL used is: %s" % url)
        for bs_search in bs_find_all(url, "a", "data-bi-dlnm", ".NET Release Table Download", proxies=proxies, timeout=10):
            if "runtime-desktop-" in bs_search.get("href", "") and arch in bs_search.get("href", ""):
                download_url_page = "https://dotnet.microsoft.com" + bs_search["href"]
                version = download_url_page.split("/")[-1].split("-")[2]
                break

        for bs_search in bs_find_all(download_url_page, "a", "onclick", "recordManualDownload()"):
            if version in bs_search.get("href", "") and "windowsdesktop-runtime" in bs_search.get("href", ""):
                download_url = bs_search["href"]
                latest_bin = download_url.split("/")[-1]
                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)

        # 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, 3) == Version(version, 3):
                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})")

    # Deleting outdated binaries
    remove_outdated_binaries(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 or not update-package-sources
    return package_updated

01ca7fe94636e5a08fcb73849d3b5df25d51e2c82f4dd1a08f01798b25899819 : WAPT/certificate.crt
db7bae4df1547694264cfbb8db383227038b1cf90a126a4864f9ddc1079c8cea : WAPT/changelog.txt
1e9f66340e061e14ffa01c685d525a3eadfbc1a1e7e047745e6a0cb9807e34aa : WAPT/control
1460db9c3885967269ebbc71d898181ab7d1506f3212bafc2df3acc648d43db0 : WAPT/icon.png
095e1aae288f57f4214f679714b56c747f86fca87b0ae1e87b8e1e4280365e0c : luti.json
c1bf2757877a3f3104a3dc2d60a30b8c55cd69079cb32f1316f6529453f3cc00 : setup.py
4948c13878fae61d411f3a4807c649a366c7eff00ec56f81272573f857338ea5 : update_package.py
93df5c5d93d3dec06b49b555909a751122edbb3f121d52577578cb9b24ffe4f2 : windowsdesktop-runtime-7.0.20-win-arm64.exe
57e7c16e7226c9a29dbc3faedd9e5876cec494c7660528052f52160521e7b714 : windowsdesktop-runtime-7.0.20-win-x64.exe
58d32d9857bda5da99afc217669aedacdffb20aed61f15315718eeb3a455b273 : windowsdesktop-runtime-7.0.20-win-x86.exe

https://github.com/dotnet/core/tree/main/release-notes/7.0
0-12
===
changed to official microsoft sources
x64 will now always install x86 too


0-10
===
handle arch swapping
global code improvement