tis-dotnet8 icon

.NET Runtime 8

Paquet d'installation silencieuse pour .NET Runtime 8

8.0.33-1
Dependency
Dependency

  • package: tis-dotnet8
  • name: .NET Runtime 8
  • version: 8.0.33-1
  • categories: Dependency
  • maintainer: WAPT Team,Tranquil IT,Stan SALOMON
  • editor: Microsoft
  • licence: opensource_free,cpe:/a:mit:x11_license,wapt_public
  • locale: all
  • target_os: debian(>=11),ubuntu(>=20),redhat_based(>=8)
  • architecture: x64
  • signature_date:
  • size: 31.33 Mo
  • homepage : https://github.com/dotnet/runtime

package           : tis-dotnet8
version           : 8.0.33-1
architecture      : x64
section           : base
priority          : optional
name              : .NET Runtime 8
categories        : Dependency
maintainer        : WAPT Team,Tranquil IT,Stan SALOMON
description       : .NET Runtime is the free, cross-platform and open-source runtime from Microsoft required to run console applications, services and libraries built with .NET
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : debian(>=11),ubuntu(>=20),redhat_based(>=8)
min_wapt_version  : 2.5
sources           : https://github.com/dotnet/runtime
installed_size    : 
impacted_process  : 
description_fr    : .NET Runtime est l'environnement d'exécution gratuit, multiplateforme et open source de Microsoft, nécessaire pour faire fonctionner les applications console, services et bibliothèques développés en .NET
description_pl    : .NET Runtime to darmowe, wieloplatformowe środowisko uruchomieniowe firmy Microsoft o otwartym kodzie źródłowym, wymagane do uruchamiania aplikacji konsolowych, usług i bibliotek utworzonych w .NET
description_de    : .NET Runtime ist die kostenlose, plattformübergreifende Open-Source-Laufzeitumgebung von Microsoft, die zum Ausführen von mit .NET erstellten Konsolenanwendungen, Diensten und Bibliotheken erforderlich ist
description_es    : .NET Runtime es el entorno de ejecución gratuito, multiplataforma y de código abierto de Microsoft, necesario para ejecutar aplicaciones de consola, servicios y bibliotecas desarrollados con .NET
description_pt    : O .NET Runtime é o ambiente de execução gratuito, multiplataforma e de código aberto da Microsoft, necessário para executar aplicações de consola, serviços e bibliotecas desenvolvidos com .NET
description_it    : .NET Runtime è l'ambiente di esecuzione gratuito, multipiattaforma e open source di Microsoft, necessario per eseguire applicazioni console, servizi e librerie sviluppati con .NET
description_nl    : .NET Runtime is de gratis, platformonafhankelijke en open-source runtime van Microsoft die nodig is om met .NET gebouwde consoletoepassingen, services en bibliotheken uit te voeren
description_ru    : .NET Runtime — это бесплатная кроссплатформенная среда выполнения Microsoft с открытым исходным кодом, необходимая для запуска консольных приложений, служб и библиотек, созданных на .NET
audit_schedule    : 
editor            : Microsoft
keywords          : .net,desktop,windows,windowsdesktop,il,msil,clr,jit,fc,bcl,runtime,wpf,winforms,windows forms,Microsoft,net
licence           : opensource_free,cpe:/a:mit:x11_license,wapt_public
homepage          : https://github.com/dotnet/runtime
package_uuid      : d9123541-4fec-4e9b-9b4f-d9b15c8c0b3e
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/dotnet/core/tree/main/release-notes/8.0
min_os_version    : 
max_os_version    : 
icon_sha256sum    : c13943b8f92a4717f46bad189c0b91d9003d76a0127a41459ec91693b263830c
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2026-11-15T10:21:20.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         : NA0HAkj4snAUYbqS678P966RkeQvsvNKKrHxzZzH2XqGJIT3XDizswSV5XB5WSzOXNcQfJJ+n6sK7saYLzrH0E5uKZvFMEhQMUk9hcemth8D/4f9VtZpySy03EGwls0XFvReWPB0RE39TKs7nVGgkphwxYzq1DfZ616wM7nxBLaC8vQpKYJ8m17TZzyZxLWUrq5lpcLyfyW7HEXWyBfLNsJooI1LoF+hq0HGRQ7GTLXAD/sPVAj5aHsPfFsY3j/opwhXC+yLi6WJYnqMyBPGfFC1vV+ExLW4TWufWOoyz4ZCusN154B1fR/TzsS5XeVeTETNbQrk+Dq8yQKp4zrYWQ==

from setuphelpers import *
import tarfile

bin_path = "/usr/bin/dotnet"
app_path = "/usr/share/dotnet"
major = "8"

def extract_tar_gz(filename, path="."):
    with tarfile.open(filename, "r:gz") as tar:
        tar.extractall(path)

def version_folders():
    return glob.glob(f"{app_path}/shared/*/{major}.*") + glob.glob(f"{app_path}/host/fxr/{major}.*")


def find_apt_package(pattern):
    out = run(f"apt-cache search --names-only '{pattern}' | cut -d' ' -f1 | sort -V").strip()
    if not out:
        print(f"No apt package matching {pattern}")
        return None
    return out.splitlines()[-1]


def install():
    if type_debian(): # Will not work for Ubuntu 26.10, because they removed the /etc/debian_version file. 
        libicu = find_apt_package("^libicu[0-9]+$")
        libssl = find_apt_package("^libssl(3t64|3|1\\.1)$")
        install_apt(
            "ca-certificates "
            "libc6 "
            "libgcc-s1 "
            "libgssapi-krb5-2 "
            "libstdc++6 "
            "zlib1g "
            f"{libicu} "
            f"{libssl}"
        )
    elif type_redhat():
        install_yum(
            "ca-certificates "
            "glibc "
            "libgcc "
            "krb5-libs "
            "libstdc++ "
            "zlib "
            "libicu "
            "openssl-libs"
        )
    else:
        print("Unsupported Linux distribution")
        return "ERROR"


    archive_file = glob.glob("dotnet-runtime-*.tar.gz")[0]
 
    for folder in version_folders():
        print(f"Removing older version: {folder}")
        remove_tree(folder)
 
    mkdirs(app_path)
    extract_tar_gz(archive_file, path=app_path)
 
    if not (os.path.islink(bin_path) and os.readlink(bin_path) == f"{app_path}/dotnet"):
        if isfile(bin_path) or os.path.islink(bin_path):
            print("Removing existing symlink")
            remove_file(bin_path)
        print(f"Creating dotnet alias in path")
        os.symlink(f"{app_path}/dotnet", bin_path)


def audit():
    version = control.get_software_version()
    audit_status = "OK"
 
    for folder in (f"{app_path}/shared/Microsoft.NETCore.App/{version}", f"{app_path}/host/fxr/{version}"):
        if not isdir(folder):
            print(f"Missing folder: {folder}")
            audit_status = "ERROR"
 
    if not isfile(f"{app_path}/dotnet"):
        print(f"Missing executable: {app_path}/dotnet")
        audit_status = "ERROR"
    if not (os.path.islink(bin_path) and os.readlink(bin_path) == f"{app_path}/dotnet"):
        print(f"Missing or wrong symlink: {bin_path}")
        audit_status = "ERROR"
 
    if audit_status == "OK":
        try:
            runtimes = run(f"{bin_path} --list-runtimes")
        except Exception as e:
            print(f"dotnet does not start: {e}")
            return "ERROR"
        if f"Microsoft.NETCore.App {version}" not in runtimes:
            print(f"Microsoft.NETCore.App {version} not listed by dotnet --list-runtimes")
            return "ERROR"
        print(runtimes)
 
    return audit_status

def uninstall():
    for folder in version_folders():
        remove_tree(folder)
 
    remaining = glob.glob(f"{app_path}/shared/Microsoft.NETCore.App/*")
    if remaining:
        print(f"Other .NET versions still installed: {', '.join(os.path.basename(r) for r in remaining)}")
        return
 
    if isfile(bin_path) or os.path.islink(bin_path):
        remove_file(bin_path)
 
    if isdir(app_path):
        remove_tree(app_path)

from setuphelpers import *
from setupdevhelpers import *

"""

https://builds.dotnet.microsoft.com/dotnet/release-metadata/{version}/releases.json

"""

dotnet_version = "8.0"

def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()

    os_dict = {
        "windows-x64": "win-x64",
        "windows-x86": "win-x86",
        "windows-arm64": "win-arm64",
        "debian(>=11),ubuntu(>=20),redhat_based(>=8)-x64": "linux-x64",
        "debian(>=11),ubuntu(>=20),redhat_based(>=8)-arm64": "linux-arm64",
        "darwin-x64": "osx-x64",
        "darwin-arm": "osx-arm64"
    }

    os_type = control.target_os + "-" + ensure_list(control.architecture)[0]

    if not proxies:
        proxies = get_proxies_from_wapt_console()

    data = wgets(f"https://builds.dotnet.microsoft.com/dotnet/release-metadata/{dotnet_version}/releases.json", proxies=proxies, as_json=True)
    runtime = data["releases"][0]["windowsdesktop"] if "windows" in control.target_os else data["releases"][0]["runtime"]
    version = runtime["version"]
    download_url = []
    for asset in runtime["files"]:
        if control.target_os == "windows":
            if asset["name"].endswith(".exe"):
                print("Found %s " % (asset["name"]))
                download_url.append({
                    "url": asset["url"],
                    "latest_bin": asset["url"].split("/")[-1]
                })
                # No need to break here, because we want to download all the runtimes for the different architectures (x86, x64, arm64)
        elif control.target_os == "darwin":
            if asset["rid"] == os_dict[os_type] and asset["name"].endswith(".pkg"):
                download_url = asset["url"]
                latest_bin = download_url.split("/")[-1]
                break
        elif control.target_os == "debian(>=11),ubuntu(>=20),redhat_based(>=8)" and asset["rid"] == os_dict[os_type]:
                download_url = asset["url"]
                latest_bin = download_url.split("/")[-1]
                break

    arch = ensure_list(control.architecture)
    print(arch)
    if "arm64" in arch:
        archs = ["arm64", "x64", "x86"]
    if "x64" in arch:
        archs = ["x64", "x86"]
    if "x86" in arch:
        archs = ["x86"]
    # Checking version from file
    if control.target_os == "windows":
        print(archs)
        print(download_url)
        for dl_info in download_url:
            if dl_info["latest_bin"].split("-")[-1].split(".exe")[0] in archs:
                print("Latest %s version is: %s" % (control.name, version))
                print("Download URL is: %s" % dl_info["url"])
                if not isfile(dl_info["latest_bin"]):
                    print("Downloading: %s" % dl_info["latest_bin"])
                    wget(dl_info["url"], dl_info["latest_bin"], proxies=proxies)
    else:
        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)

    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

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
5687b2bc858b37d477196bd2559db300be6165618b7aa6a1c5d55f0e338ad768 : WAPT/control
c13943b8f92a4717f46bad189c0b91d9003d76a0127a41459ec91693b263830c : WAPT/icon.png
73e6b84de92cc8442229ea991e677cc1376a0a05e3e39f878cf98ebd756861b6 : dotnet-runtime-8.0.33-linux-x64.tar.gz
6e96c4b6c5bbf0802eca8380b755d1f8085510d05390b505ca9a95472b881359 : luti.json
ad6552ba85c08151bf9a4e2b5b7f33e558eac1a582c0c78f4137abcb04803443 : setup.py
e32e9eb5cb87b0ce17ccb85f57db3bcd7a2ee368ab1e0ae80fb25a14e48e720d : update_package.py