tis-wsl2 icon

WSL 2

Silent install package for WSL 2

2.7.12.0-18
System and network
System and network

Preprod packages are packages built on LUTI. They remain in PREPROD usually for 5 days, after which a second VirusTotal scan is performed to verify that the status has not changed.
If the package passes this last check, it is promoted to PROD and published on the store.

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

package           : tis-wsl2
version           : 2.7.12.0-18
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          : PREPROD
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      : d410baef-2013-4cf4-a863-cf5566bab5af
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            : test
signer_fingerprint: b82fc8ef4a4475c0f69ac168176c2bfc58f572eb716c4eadd65e4785c155dd8e
signature_date    : 2026-09-02T07:48:40.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         : lXHz4mlI/S+mZQ3ainlw1B/7zJhmNiK0In86AEABKoabh2PaHMBZQi8AYRP1vinyzqg/o5Lps1g2mG/edHVUKPuuEMH8AUURdXH5THI5IBBq8+PIpAC1jEc2mASpNGkQPZgcYrrEtMyxXYaXjO/27VSHgwQ5oaS41kcneWn59iVVSnBVdaK51NmqCJQKlsDl/xFKW0F65LwZcSVMNXVGTgiirxe/7hB+lk10eX78qw4tQwfJfJmZg0A0p4hJY7+OQJOH+OMy8lUbEpiyxWNxR7TpTflncitoPXrvK2ZiIaWWeOFWxPSif02e+9s4fDGYz4n8OujIE2GksNlNS9uDmg==

# -*- 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

"""

def install():
    # Specific app values
    app_name = control.name
    bin_name = glob.glob("*.msi")[0]

    # 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

01ca7fe94636e5a08fcb73849d3b5df25d51e2c82f4dd1a08f01798b25899819 : WAPT/certificate.crt
82e0e464d7a2436edc4ec2e2394f071d14b59f959dc31720ed43cf90ceb1aac3 : WAPT/control
53955eb1cfa27f50eed20f11ea58e83c0e3b9349db59ce21120681cf4a5ad34c : WAPT/icon.png
bc73e7e53f64da38fb01dc17c7e2ae432011c96fc0f8160b62254ef111300bc3 : luti.json
66e16e2db3871df94d16776c3acb06f93ec5d60e15dfd78fbc9c56a6a8e0fae0 : setup.py
0d6bbd52e1ba1869fa105e4fd4f57b96f7fe524b7d45c6c6ef5feb99d1ae4cbe : update_package.py
a460d4560215f2efe003c136244b78ea3415d773824d7a688ea9ded36dbe9145 : wsl.2.7.12.0.x64.msi