tis-vscode-remote-ssh

0.115.2024091015-6
The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container with a running SSH server and take full advantage of VS Code's feature set. Once connected to a server, you can interact with files and folders anywhere on the remote filesystem
13623 downloads
Download
See build result See VirusTotal scan
tis-vscode-remote-ssh icon
  • package : tis-vscode-remote-ssh
  • name : Remote - SSH
  • version : 0.115.2024091015-6
  • categories : Extension
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ,Pierre COSSON
  • editor : Microsoft
  • licence : Creative Commons Attribution 4.0 International Public License
  • locale : all
  • target_os : windows(>=10.0),mac,centos,debian(>=10),ubuntu(>=18)
  • impacted_process :
  • architecture : all
  • signature_date : 2024-09-16 02:31
  • size : 472.61 Ko
  • installed_size : 2.79 Mo
  • homepage : https://github.com/Microsoft/vscode-remote-release
package           : tis-vscode-remote-ssh
version           : 0.115.2024091015-6
architecture      : all
section           : base
priority          : optional
name              : Remote - SSH
categories        : Extension
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ,Pierre COSSON
description       : The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container with a running SSH server and take full advantage of VS Code's feature set. Once connected to a server, you can interact with files and folders anywhere on the remote filesystem
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows(>=10.0),mac,centos,debian(>=10),ubuntu(>=18)
min_wapt_version  : 2.3
sources           : https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh
installed_size    : 2788732
impacted_process  : 
description_fr    : L'extension Visual Studio Code Remote - SSH vous permet d'ouvrir un dossier distant sur n'importe quelle machine distante, machine virtuelle ou conteneur avec un serveur SSH en cours d'exécution et de profiter pleinement de l'ensemble des fonctionnalités de VS Code. Une fois connecté à un serveur, vous pouvez interagir avec des fichiers et des dossiers n'importe où sur le système de fichiers distant
description_pl    : Rozszerzenie Visual Studio Code Remote - SSH pozwala otworzyć zdalny folder na dowolnej zdalnej maszynie, maszynie wirtualnej lub kontenerze z działającym serwerem SSH i w pełni wykorzystać zestaw funkcji VS Code. Po podłączeniu do serwera, można oddziaływać na pliki i foldery w dowolnym miejscu zdalnego systemu plików
description_de    : Die Visual Studio Code Remote - SSH-Erweiterung ermöglicht es Ihnen, einen Remote-Ordner auf einem beliebigen Remote-Rechner, einer virtuellen Maschine oder einem Container mit einem laufenden SSH-Server zu öffnen und den Funktionsumfang von VS Code voll auszuschöpfen. Sobald Sie mit einem Server verbunden sind, können Sie mit Dateien und Ordnern überall auf dem entfernten Dateisystem interagieren
description_es    : La extensión Visual Studio Code Remote - SSH le permite abrir una carpeta remota en cualquier máquina remota, máquina virtual o contenedor con un servidor SSH en funcionamiento y aprovechar al máximo el conjunto de características de VS Code. Una vez conectado a un servidor, puede interactuar con archivos y carpetas en cualquier lugar del sistema de archivos remoto
description_pt    : A extensão Visual Studio Code Remote - SSH permite-lhe abrir uma pasta remota em qualquer máquina remota, máquina virtual, ou contentor com um servidor SSH em execução e tirar o máximo partido do conjunto de características do VS Code. Uma vez ligado a um servidor, pode interagir com ficheiros e pastas em qualquer lugar do sistema de ficheiros remoto
description_it    : L'estensione Visual Studio Code Remote - SSH consente di aprire una cartella remota su qualsiasi macchina remota, macchina virtuale o container con un server SSH funzionante e di sfruttare appieno le funzionalità di VS Code. Una volta connessi a un server, è possibile interagire con file e cartelle in qualsiasi punto del filesystem remoto
description_nl    : Met de Visual Studio Code Remote - SSH-extensie kunt u een externe map openen op elke externe machine, virtuele machine of container met een actieve SSH-server en de mogelijkheden van VS Code ten volle benutten. Zodra u met een server verbonden bent, kunt u overal op het bestandssysteem op afstand met bestanden en mappen werken
description_ru    : Расширение Visual Studio Code Remote - SSH позволяет вам открыть удаленную папку на любой удаленной машине, виртуальной машине или контейнере с запущенным SSH-сервером и использовать все преимущества набора функций VS Code. После подключения к серверу вы можете взаимодействовать с файлами и папками в любом месте удаленной файловой системы
audit_schedule    : 
editor            : Microsoft
keywords          : visual,studio,code,remote,development,vscode,vsix,ext,extension,remote-ssh,ssh
licence           : Creative Commons Attribution 4.0 International Public License
homepage          : https://github.com/Microsoft/vscode-remote-release
package_uuid      : 0a7b4281-cf8a-486b-b3d7-0f56916d7352
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/microsoft/vscode-docs/tree/main/remote-release-notes
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 62d6993fe7ee575cb26b54363d23a7488114d9ccf79b1cf2f4435e88bffa10d1
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-09-16T02:31:47.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         : aLVTHg22TqQzjnC7jXEUPpoyhy9fMagpIAjU3tdIzPQXTek/b3iqb/BZ/IIOgkSWLEfEwxNrmTl4bi/QcZ4hAXJ8icW+wUoy2N9JEWWN9/2JKmuLV90MXMxsXfYpAbiBesidYayXZIctTtO+Hs9EUjnlPntoJ0wqx7PsWRW+LTASnUd6/jnfovcdojiVQj9vDIcegSKtEofetl+63M7rpDEJnJbZf/PgEbPTlX1Iql9iOZwthFNZUGSCD1TLdXQzRWqkR76BjSFMB6JCg2BRnLLbQIK05KwsiJRbitTFuFmrMjJ8I1rBUDzMcZHCOa1ngtjQO7NJh9brH/BuXubEHQ==
# -*- coding: utf-8 -*-
from setuphelpers import *


ext_uid_name = "ms-vscode-remote.remote-ssh"
vscode_audit_file_sub = f'%s_{ext_uid_name.replace(".", "-")}_vscode_audit.txt'
vscodium_audit_file_sub = f'%s_{ext_uid_name.replace(".", "-")}_vscodium_audit.txt'


def install():
    # Initializing variables
    ext_file_name = glob.glob("*%s*.vsix" % ext_uid_name)[0]
    vscode_dir, vscode_bin_path = get_vscode_path()
    vscodium_dir, vscodium_bin_path = get_vscodium_path()

    # VSCode extension install
    if isfile(vscode_bin_path):
        # Removing old extensions from app_dir
        for ext in glob.glob(makepath(vscode_dir, "%s*.vsix" % ext_uid_name)):
            print("Removing: %s" % ext)
            remove_file(ext)

        print("Copying: %s to: %s" % (ext_file_name, vscode_dir))
        filecopyto(ext_file_name, vscode_dir)

    # VSCodium extension install
    if isfile(vscodium_bin_path):
        # Removing old extensions from app_dir
        for ext in glob.glob(makepath(vscodium_dir, "%s*.vsix" % ext_uid_name)):
            print("Removing: %s" % ext)
            remove_file(ext)

        print("Copying: %s to: %s" % (ext_file_name, vscodium_dir))
        filecopyto(ext_file_name, vscodium_dir)


def session_setup():
    # Initializing variables
    vscode_dir, vscode_bin_path = get_vscode_path()
    vscodium_dir, vscodium_bin_path = get_vscodium_path()

    # VSCode extension install
    user_name = user_home_directory().rstrip(os.path.sep).split(os.path.sep)[-1]
    if isfile(vscode_bin_path):
        install_vscod_ext_if_needed(
            vscode_dir,
            vscode_bin_path,
            ext_uid_name,
            control.get_software_version(),
            makepath(get_temp_dir(), vscode_audit_file_sub % user_name),
            force_install=force,
        )

    # VSCodium extension install
    if isfile(vscodium_bin_path):
        install_vscod_ext_if_needed(
            vscodium_dir,
            vscodium_bin_path,
            ext_uid_name,
            control.get_software_version(),
            makepath(get_temp_dir(), vscodium_audit_file_sub % user_name),
            force_install=force,
        )


def audit():
    # Initializing variables
    vscode_dir, vscode_bin_path = get_vscode_path()
    vscodium_dir, vscodium_bin_path = get_vscodium_path()
    audit_status = "OK"

    # VSCode extension audit
    if isfile(vscode_bin_path):
        try:
            ext_path = glob.glob(makepath(vscode_dir, "%s*.vsix" % ext_uid_name))[0]
            print("OK: %s extension file present in %s" % (ext_uid_name, vscode_dir))
        except:
            print("ERROR: %s extension file absent of %s" % (ext_uid_name, vscode_dir))
            audit_status = "ERROR"

    # VSCodium extension audit
    if isfile(vscodium_bin_path):
        try:
            ext_path = glob.glob(makepath(vscodium_dir, "%s*.vsix" % ext_uid_name))[0]
            print("OK: %s extension file present in %s\n" % (ext_uid_name, vscodium_dir))
        except:
            print("ERROR: %s extension file absent of %s\n" % (ext_uid_name, vscodium_dir))
            audit_status = "ERROR"

    # Checking if extension is installed in all users
    vscod_ext_dict = users_installed_vscod_ext_to_dict(ext_uid_name, vscode_audit_file_sub, vscodium_audit_file_sub, ignored_users=[])
    for key in vscod_ext_dict.keys():
        if type(vscod_ext_dict[key]) != dict:
            continue
        if vscod_ext_dict[key]["VSCode"] or vscod_ext_dict[key]["VSCodium"]:
            print(f'"{ext_uid_name}" extension for user "{key}" installed version(s): {vscod_ext_dict[key]}')
        else:
            print(f'"{ext_uid_name}" extension for user "{key}" is not installed')
    WAPT.write_audit_data_if_changed(
        control.package.split("-", 1)[-1], control.package.split("-", 1)[-1], vscod_ext_dict, max_count=10, keep_days=100
    )

    return audit_status


def uninstall():
    # Initializing variables
    vscode_dir, vscode_bin_path = get_vscode_path()
    vscodium_dir, vscodium_bin_path = get_vscodium_path()

    # Removing extensions from vscode_dir
    for ext in glob.glob(makepath(vscode_dir, "*%s*.vsix" % ext_uid_name)):
        print("Removing: %s" % ext)
        remove_file(ext)

    # Removing extensions from vscodium_dir
    for ext in glob.glob(makepath(vscodium_dir, "*%s*.vsix" % ext_uid_name)):
        print("Removing: %s" % ext)
        remove_file(ext)

    # Removing extension from user profiles
    killalltasks(["Code", "code"])
    print(remove_tree_for_all_users(makepath(".vscode", "extensions", "%s*" % ext_uid_name)))
    killalltasks(["VSCodium", "codium"])
    print(remove_tree_for_all_users(makepath(".vscode-oss", "extensions", "%s*" % ext_uid_name)))


def users_installed_vscod_ext_to_dict(ext_uid_name, vscode_audit_file_sub, vscodium_audit_file_sub, ignored_users=None, ignore_system_users=True):
    """Return a dict of dict of the installed extensions version for all users

    Args:
        ext_uid_name (str): VSCode and VSCodium extension identifier
        vscode_audit_file_sub (str): name of file in Temp user folder containing VSCode extension version
        vscodium_audit_file_sub (str): name of file in Temp user folder containing VSCodium extension version

    Returns:
        users_ext_version_dict: Dict of user and the corresponding version in this format:
            {
                "user1": {'VSCode': '0.81.8', 'VSCodium': '0.81.8'},
                "user2": {'VSCode': '', 'VSCodium': '0.81.8'},
                "user3": {'VSCode': '', 'VSCodium': ''},
            }
    """
    skipped_users = get_skipped_users_list(ignored_users, ignore_system_users)

    if get_os_name() == "Windows":
        users_dir = makepath(systemdrive, "Users")
    elif get_os_name() == "Linux":
        users_dir = "/home"
    elif get_os_name() == "Darwin":
        users_dir = "/Users"

    # Getting a dict of all users installed extension version
    users_ext_version_dict = {}
    higher_version = "0.0"
    for user_profile in glob.glob("%s/*/" % users_dir):
        skip = False
        user_name = user_profile.rstrip(os.path.sep).split(os.path.sep)[-1]
        for skipped_user in skipped_users:
            if user_name == skipped_user:
                skip = True
                break

        if not skip:
            # Declaring user based variable
            vscode_audit_file_path = makepath(get_temp_dir(), vscode_audit_file_sub % user_name)
            vscodium_audit_file_path = makepath(get_temp_dir(), vscodium_audit_file_sub % user_name)
            user_profile_ext_version_dict = {
                "VSCode": None,
                "VSCodium": None,
            }

            # Getting the version from the files in user Temp directory
            if isfile(vscode_audit_file_path):
                with open(vscode_audit_file_path, "r") as f:
                    user_profile_ext_version_dict["VSCode"] = f.readline()
                    if Version(higher_version) < Version(user_profile_ext_version_dict["VSCode"]):
                        higher_version = user_profile_ext_version_dict["VSCode"]
            if isfile(vscodium_audit_file_path):
                with open(vscodium_audit_file_path, "r") as f:
                    user_profile_ext_version_dict["VSCodium"] = f.readline()
                    if Version(higher_version) < Version(user_profile_ext_version_dict["VSCodium"]):
                        higher_version = user_profile_ext_version_dict["VSCodium"]

            # Attributing user's version dict to global dict
            if not user_profile_ext_version_dict:
                user_profile_ext_version_dict = None
            users_ext_version_dict[user_name] = user_profile_ext_version_dict
    users_ext_version_dict["higher_version"] = higher_version
    users_ext_version_dict["version"] = control.get_software_version()

    return users_ext_version_dict


def get_installed_vscod_ext_version(app_bin_path, ext_uid_name):
    installed_exts = run(f'"{app_bin_path}" --list-extensions --show-versions').splitlines()
    installed_ext_version = None

    for ext in installed_exts:
        if ext_uid_name in ext:
            installed_ext_version = ext.split("@")[-1]
    return installed_ext_version


def install_vscod_ext_if_needed(app_dir, app_bin_path, ext_uid_name, min_version, audit_file, force_install=False):
    """Will check installed version and install if needed

    Args:
        app_dir (str): path to VSCode or VSCodium directory
        app_bin_path (str): path to VSCode or VSCodium binary
        ext_uid_name (str): VSCode and VSCodium extension identifier
        min_version (str): min_version needed to be installed
        audit_file (str): name of file in Temp user folder containing VSCodium extension version
        force_install (str): option to force extension installation

    """
    installed_ext_version = get_installed_vscod_ext_version(app_bin_path, ext_uid_name)

    # Checking if a potential installed extension is up-to-date
    print(f"Installing {ext_uid_name} for {app_dir.split(os.path.sep)[-1]}")
    if installed_ext_version is not None:
        if Version(installed_ext_version, 4) >= Version(min_version, 4):
            print(f"INFO: Installed extension {ext_uid_name}({installed_ext_version}) is up-to-date")
            # Creating file for audit
            with open(audit_file, "w") as f:
                f.write(installed_ext_version)
            return
        else:
            force_install = True

    ext_path = glob.glob(makepath(app_dir, "%s*.vsix" % ext_uid_name))[0]

    # Installing extension in user env
    print("Installing: %s extension in user env" % (ext_path))
    vsix_cmd = f'"{app_bin_path}" --install-extension "{ext_path}"'
    if force_install:
        vsix_cmd += " --force"
    result = run(vsix_cmd)
    print(result)

    # Checking if vscode version is too old
    if "as it is not compatible with VS Code" in result:  # Error message with "VS Code" same for VSCode and VSCodium
        vscode_version = result.split("as it is not compatible with VS Code")[1].split("'")[1]
        error(f"ERROR: Try updating your current VSCode ({vscode_version})")
    # Checking if extension installation failed
    if "Failed Installing Extensions" in result:
        error("ERROR: Unable to install extension with: %s" % ext_path)

    # Creating file for audit
    with open(audit_file, "w") as f:
        f.write(get_installed_vscod_ext_version(app_bin_path, ext_uid_name))


def get_temp_dir():
    if get_os_name() == "Windows":
        temp_dir_path = makepath("C:", "Windows", "Temp")
    else:
        temp_dir_path = "/var/tmp"

    return temp_dir_path


def get_vscode_path():
    if get_os_name() == "Windows":
        app_dir = makepath(programfiles, "Microsoft VS Code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Linux":
        app_dir = makepath("/", "usr", "share", "code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Darwin":
        app_dir = makepath("/", "Applications", "Visual Studio Code.app")
        app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")

    return app_dir, app_bin_path


def get_vscodium_path():
    if get_os_name() == "Windows":
        app_dir = makepath(programfiles, "VSCodium")
        app_bin_path = makepath(app_dir, "bin", "codium")
    elif get_os_name() == "Linux":
        app_dir = makepath("/", "usr", "share", "codium")
        app_bin_path = makepath(app_dir, "bin", "codium")
    elif get_os_name() == "Darwin":
        app_dir = makepath("/", "Applications", "VSCodium.app")
        app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "codium")

    return app_dir, app_bin_path


def remove_tree_for_all_users(user_folder_relative_path, ignored_users=None, ignore_system_users=True):
    r"""Remove a specific folder or folders for all user's profiles

    Args:
        user_folder_relative_path (str): relative path to user folder, glob patterns can be used
        ignored_users (str or list of str): ignore specified users
        ignore_system_users (bool): ignore default, public, all users, etc. True by default

    Returns:
        list: list of deleted folders

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-*")))
    ['C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-2022.2.1001817079', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-keymap-1.0.0', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-renderers-1.0.6']

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-")))
    []

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-[a-z]*")))
    ['C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-keymap-1.0.0', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-renderers-1.0.6']

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-1.0.0")))
    ['/home/username/.vscode/extensions/ms-toolsai.jupyter-keymap-1.0.0']

    .. versionadded:: 2.3

    """
    skipped_users = get_skipped_users_list(ignored_users, ignore_system_users)
    deleted_folders = []

    if get_os_name() == "Windows":
        users_dir = makepath(systemdrive, "Users")
    elif get_os_name() == "Linux":
        users_dir = "/home"
    elif get_os_name() == "Darwin":
        users_dir = "/Users"

    for user_profile in glob.glob("%s/*/" % users_dir):
        skip = False
        for skipped_user in skipped_users:
            if user_profile.rstrip(os.path.sep).split(os.path.sep)[-1] == skipped_user:
                skip = True

        if not skip:
            for user_folder_to_delete in glob.glob(makepath(user_profile, user_folder_relative_path)):
                deleted_folders.append(user_folder_to_delete)
                remove_tree(user_folder_to_delete)
    return deleted_folders


def get_skipped_users_list(ignored_users=None, ignore_system_users=True):
    system_users_list = ["All Users", "Default", "Default User", "Public", "Shared"]
    if ignored_users is None:
        ignored_users = []
    if type(ignored_users) != list:
        ignored_users = [ignored_users]

    skipped_users = []
    if ignored_users:
        skipped_users.extend(ignored_users)
    if ignore_system_users:
        skipped_users.extend(system_users_list)

    return skipped_users
# -*- coding: utf-8 -*-
from setuphelpers import *
import json
import time
import sys

sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
from setupdevhelpers import *


default_allow_prerelease = False


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

    ext_uid_name = ""
    with open("setup.py", "r", encoding="utf8") as f:
        for line in f.readlines():
            if line.startswith("ext_uid_name"):
                ext_uid_name = line.split("=")[1].split('"')[1]
                break
    old_ext_uid_name = ext_uid_name

    # Getting the extension's webpage url
    url = control.sources
    if not url:
        ext_uid_name = ask_input(
            control.package,
            "Enter the extension UID name (Ex: ms-vscode-remote.remote-wsl) or the link from the Visual Studio Marketplace (Ex: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)",
            url,
            raise_error=True,
        ).split("itemName=")[-1]
        url = "https://marketplace.visualstudio.com/items?itemName=" + ext_uid_name
    else:
        ext_uid_name = url.split("itemName=")[-1]
    ext_publisher = ext_uid_name.split(".")[0]
    control.sources = url
    control.save_control_to_wapt()

    # Getting latest data from official sources
    print("URL used is %s" % url)
    for bs_search in bs_find_all(url, "script", "type", "application/json", proxies=proxies):
        if bs_search.string.startswith("{"):
            json_data = json.loads(bs_search.string)
            break

    version = json_data["Resources"]["Version"]

    # Asking the user if a prerelease version bother him
    skip_prerelease = False
    if Version(version) > Version(control.get_software_version()) and not params.get("running_as_luti"):
        if json_data["ExtensionProperties"].get("Microsoft.VisualStudio.Code.PreRelease", "") == "true":
            if (
                ask_message(
                    ext_uid_name,
                    "The latest version of the extension is in prerelease, do you want to use it? Otherwise it will use the latest version detected by Luti.",
                    # "The latest version of the extension is in prerelease, do you want to use it? (not recommended)",
                    flags=(4 + 32),
                    raise_error=True,
                )
                == 7
            ):
                skip_prerelease = True
    if not default_allow_prerelease:
        if skip_prerelease or params.get("running_as_luti"):
            # You can manually check release version here by replacing the following code (by default it check on Luti)
            try:
                luti_package_name = "tis-vscode-%s" % (ext_uid_name.split(".", 1)[-1])
                if params.get("running_as_luti"):
                    version = wgets("https://srvluti.ad.tranquil.it/check_update_result_update.json", proxies=proxies, as_json=True)[
                        luti_package_name
                    ]
                else:
                    version = wgets("https://luti.tranquil.it/check_update_result_update.json", proxies=proxies, as_json=True)[luti_package_name]
            except:
                error(
                    f"{luti_package_name} is not monitored on: https://luti.tranquil.it - You can manually check the release version by editing this package or using the prerelease version."
                )
        else:
            print("INFO: Using latest version of this extension in prerelease.")
            # error("ERROR: The latest version of this extension is in prerelease. Please wait for it to be fully released.")

    # Creating download_url
    download_url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/%s/vsextensions/%s/%s/vspackage" % (
        ext_publisher,
        json_data["Resources"]["ExtensionName"],
        version,
    )
    latest_bin = ext_uid_name + "-%s.vsix" % version

    # 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)
        content = requests.get(download_url, stream=True)
        nb_wait = 0
        max_wait = 3600
        while str(content.status_code) == "429":
            timewait = int(content.headers["Retry-After"])
            print("Wait %s" % timewait)
            nb_wait = nb_wait + timewait
            if nb_wait > max_wait:
                error("Max wait ...")
            time.sleep(timewait)
            content = requests.get(download_url, stream=True)

        with open(latest_bin, "wb") as f:
            for chunk in content.iter_content(chunk_size=1024 * 1024):
                f.write(chunk)
    else:
        print("Binary is present: %s" % latest_bin)

    # Deleting outdated binaries
    remove_outdated_binaries(latest_bin, list_extensions=["vsix"])

    # Completing control file
    if not old_ext_uid_name or old_ext_uid_name != ext_uid_name:
        # control.name
        control_name = bs_find(url, "title", proxies=proxies).text
        control_name = control_name.split(" - Visual Studio Marketplace")[0].strip()
        control_name = complete_control_name(control, control_name, silent=params.get("running_as_luti"))

        # control.package
        package_prefix = control.package.split("-")[0]
        control_package = package_prefix + "-vscode-" + ext_uid_name.split(".", 1)[-1]
        complete_control_package(control, control_package, silent=params.get("running_as_luti"))

        # control.description
        complete_control_description(control, blank_str="update_package", silent=params.get("running_as_luti"))

        # control.categories
        control.categories = "Extension"

        # icon.png
        unzip(latest_bin)
        unzipped_dir = latest_bin.rsplit(".", 1)[0]
        new_icon_png = makepath(unzipped_dir, "extension", "icon.png")
        if isfile(new_icon_png):
            filecopyto(makepath(unzipped_dir, "extension", "icon.png"), "WAPT")

        # control.installed_size
        control.installed_size = get_size(unzipped_dir)
        control.save_control_to_wapt()
        
        remove_tree(unzipped_dir)

    # Updating setup.py ext_uid_name variable
    new_lines = []
    with open("setup.py", "r", encoding="utf8") as f:
        for line in f.readlines():
            if line.startswith("ext_uid_name"):
                line = 'ext_uid_name = "%s"\n' % ext_uid_name
            new_lines.append(line)
    with open("setup.py", "w", encoding="utf8", newline="\n") as f:
        f.writelines(new_lines)

    # 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
43a5063db58e99f082a2c3776dcdb3bff7b283754343f732acf4420be1e028c0 : WAPT/control
62d6993fe7ee575cb26b54363d23a7488114d9ccf79b1cf2f4435e88bffa10d1 : WAPT/icon.png
85b1dbba2f119414fb4320ebd38aed17008607199c7a11819d7db4309e3bf251 : luti.json
196939fbf5429fc34d038bf9c17fd48dbac97ab40decc43ca456d0444f5be50a : ms-vscode-remote.remote-ssh-0.115.2024091015.vsix
404cb11eb0288cc109442a7f8a5394f29783b14757f946787bcc35b30480eb65 : setup.py
f31bb903630e71ceeff68ce1e3058f3b120008d9beb2d9fda7491cfe67b49662 : setupdevhelpers.py
b961afdaa1d0623903c3b414455d1e020c5ec650005194e2a334895dd89cb43d : update_package.py