tis-wsl2 icon

WSL 2

Paquet d'installation silencieuse pour WSL 2

2.7.10.0-17
System and network
System and network

  • package: tis-wsl2
  • name: WSL 2
  • version: 2.7.10.0-17
  • categories: System and network
  • maintainer: WAPT Team,Tranquil IT,Joffrey Le Piquet
  • locale: all
  • target_os: windows
  • architecture: x64
  • signature_date:
  • size: 258.62 Mo
  • homepage : https://docs.microsoft.com/windows/wsl/

package           : tis-wsl2
version           : 2.7.10.0-17
architecture      : x64
section           : base
priority          : optional
name              : WSL 2
categories        : System and network
maintainer        : WAPT Team,Tranquil IT,Joffrey Le Piquet
description       : WSL 2 - Windows Subsystem for Linux 2
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
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          : https://docs.microsoft.com/windows/wsl/
package_uuid      : cb84a550-b476-49a7-9d87-a461a01e6e19
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://docs.microsoft.com/windows/wsl/release-notes
min_os_version    : 10.0.18362
max_os_version    : 
icon_sha256sum    : 53955eb1cfa27f50eed20f11ea58e83c0e3b9349db59ce21120681cf4a5ad34c
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2026-07-22T13:13:29.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         : H4UKjdBeg3LH/pU8TXZ44wj4ViW/Ccq1rHTjz3Zh0l+ngJQcA23KA3pTNBjGtSG9AaF6341ko8AxqOZvCd5WW1dX+vSWY34b/GyjuNLCyPbxJYSxJxTD5XY/Sn0smMiqGhtigzNryJc3TIjr3xtYGDS6m1TyNfH8Z3USYRePtPqtI+aDlnFa1uLERFWR9f5/J2dBMtVAuCQS3FM+WjRoOcfvn075XkKgUSnsJRJB3R3sFcvhTwQBhD71noEeLis8LNr5+doYgB+IKe18wBX4gvCyXws8sDBMTu5yRFCJFVKRxYserOOICwDBXXK8gck9tA8ZglsMibI1oJWBZlwxMw==

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

Installation procedure: https://docs.microsoft.com/windows/wsl/install-win10
Troobleshooting installation: https://docs.microsoft.com/windows/wsl/troubleshooting
Kernel Installation procedure: https://aka.ms/wsl2kernel
WSL2: https://aka.ms/wsl2-install

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_name = glob.glob("*.msi")[0]


def install():
    # Specific app values
    app_name = control.name

    # Installing the package
    if windows_version() >= WindowsVersions.Windows10v1903:
        with EnsureWUAUServRunning():

            # Get previous state of WSL
            wsl = run_powershell("Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux")
            wsl_status = wsl.get("State") # State: Disable = 0, Enable = 2

            if wsl_status == 0:
                print("Enabling Windows Feature: Microsoft-Windows-Subsystem-Linux")
                run_powershell("Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart -All",output_format="text")

        # Updating WSL to WSL2
            # Installing the Kernel WSL Update if needed
            try:
                install_msi_if_needed(bin_name)
            except:
                print("INFO: A reboot is required to install %s" % bin_name)
                return

            try:
                print("Enabling Windows Feature: VirtualMachinePlatform")
                run_powershell("Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart -All",output_format="text")
            except:
                print("Unable to install %s, please reboot and make sure that virtualization is enabled in the BIOS" % app_name)

            try:
                print("Configuring %s as default" % app_name)
                run_powershell("wsl --set-default-version 2")
            except:
                print("Unable to configure %s as default" % app_name)

    else:
        print("You need Windows 10 version 1903 minimum for installing WSL 2")

    print("INFO: A reboot is required to use %s" % app_name)


def uninstall():
    # Uninstalling the package
    if windows_version() >= WindowsVersions.Windows10v1709:
        with EnsureWUAUServRunning():
            print("Disabling Windows Feature: Microsoft-Windows-Subsystem-Linux")
            run_powershell("Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart")
            if windows_version() >= "10.0.19041":
                print("Disabling Windows Feature: VirtualMachinePlatform")
                run_powershell("Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart")

# -*- coding: utf-8 -*-
##################################################
# This file is part of WAPT Enterprise
# All right reserved, (c) Tranquil IT Systems 2024
# For more information please refer to
# https://wapt.tranquil.it/store/licences.html
##################################################
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/microsoft/WSL/releases/latest"

    # Getting latest version information from official sources
    print(f"API used is: {api_url}")
    json_load = json.loads(wgets(api_url, proxies=proxies))
    for asset in json_load["assets"]:
        if asset["name"].endswith("x64.msi"):
            download_url = asset["browser_download_url"]
            version = json_load["tag_name"]
            latest_bin = asset["name"]
            break

    print(f"Latest version of {control.name} is: {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)
    else:
        print("Binary is present: %s" % latest_bin)

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")

    # Deleting binaries
    for f in glob.glob("*.msi"):
        if f != latest_bin:
            remove_file(f)

    version = get_version_from_binary(latest_bin)
    control.set_software_version(version)
    control.save_control_to_wapt()
    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
7c7ad468fbf030a558dbe9c208587a05d0250d4f84145bd5ca5c30be68f805ff : WAPT/control
53955eb1cfa27f50eed20f11ea58e83c0e3b9349db59ce21120681cf4a5ad34c : WAPT/icon.png
0644fc8f29e790d97532b932f9ac56e1d27deb2a077b846cf558bb7efda50459 : luti.json
6eaf2e7b66c3f8ff99409150fc83fe3b1cc08b8000e6095f2bc06f9df751ff9b : setup.py
0d6bbd52e1ba1869fa105e4fd4f57b96f7fe524b7d45c6c6ef5feb99d1ae4cbe : update_package.py
1a62f90a43c03cc5bda47dfd0b6faf496ac70fd4389190518120a4f84fc895cf : wsl.2.7.10.0.x64.msi