tis-gvim icon

Gvim

Paquet d’installation silencieuse pour Gvim

9.0-4

  • package: tis-gvim
  • name: Gvim
  • version: 9.0-4
  • categories: Development
  • maintainer: WAPT Team,Tranquil IT,Pierre COSSON
  • licence: Vim License
  • locale: all
  • target_os: windows
  • impacted_process: vim,gvim
  • architecture: x64
  • signature_date:
  • size: 10.42 Mo
  • installed_size: 49.19 Mo
  • homepage : https://github.com/vim/vim

package           : tis-gvim
version           : 9.0-4
architecture      : x64
section           : base
priority          : optional
name              : Gvim
categories        : Development
maintainer        : WAPT Team,Tranquil IT,Pierre COSSON
description       : Vim is an improved version Vi. including new features like multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, script language, etc.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://github.com/vim/vim-win32-installer/releases
installed_size    : 49192960
impacted_process  : vim,gvim
description_fr    : Vim est une version améliorée de Vi. comprenant de nouvelles fonctionnalités telles que l'annulation multi-niveaux, la coloration syntaxique, l'historique de la ligne de commande, l'aide en ligne, la vérification orthographique, la complétion de nom de fichier, les opérations de bloc, le langage script, etc.
description_pl    : Vim jest ulepszoną wersją programu Vi. Zawiera nowe funkcje, takie jak wielopoziomowe cofanie, kolorowanie składni, historia wiersza poleceń, pomoc on-line, sprawdzanie pisowni, uzupełnianie nazw plików, operacje blokowe, język skryptowy itp.
description_de    : Vim ist eine verbesserte Version von Vi, die neue Funktionen wie mehrstufiges Rückgängigmachen, Syntaxhervorhebung, Befehlszeilenverlauf, Online-Hilfe, Rechtschreibprüfung, Dateinamensvervollständigung, Blockoperationen, Skriptsprache usw. enthält.
description_es    : Vim es una versión mejorada de Vi. que incluye nuevas funciones como deshacer en varios niveles, resaltado de sintaxis, historial de la línea de comandos, ayuda en línea, corrección ortográfica, finalización de nombres de archivos, operaciones en bloque, lenguaje de scripts, etc.
description_pt    : Vim é uma versão melhorada Vi. incluindo novos recursos como desfazer multi-níveis, destaque de sintaxe, histórico de linha de comando, ajuda on-line, verificação ortográfica, preenchimento de nomes de arquivos, operações em bloco, linguagem de script, etc.
description_it    : Vim è una versione migliorata di Vi. che include nuove caratteristiche come annullamento multilivello, evidenziazione della sintassi, cronologia della linea di comando, aiuto in linea, controllo ortografico, completamento dei nomi dei file, operazioni a blocchi, linguaggio di script, ecc.
description_nl    : Vim is een verbeterde versie van Vi. met nieuwe mogelijkheden zoals multi-level undo, syntax highlighting, command line history, on-line help, spellingscontrole, bestandsnaam completering, blok operaties, script taal, etc.
description_ru    : Vim - это улучшенная версия Vi. включающая такие новые возможности, как многоуровневая отмена, подсветка синтаксиса, история командной строки, интерактивная справка, проверка орфографии, завершение имени файла, операции с блоками, язык сценариев и т.д.
audit_schedule    : 
editor            : 
keywords          : vi
licence           : Vim License
homepage          : https://github.com/vim/vim
package_uuid      : bc2e67b8-c0ea-4c12-b2f2-4227b45c67f7
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/vim/vim-win32-installer/releases
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 851fa72b363b2e1cecdce5f23dc8c223154e1e234892a6d27806f548cc633ed4
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : VBHddq66/pNbA9dvLpUTvdLfkYi0r7TzjExZPK35Yh+/oUR1OLubmttvTCeHfkrJrCmOYZTyaRmAURbkwyPbJeeYwcF5LS9EAroeAbeAQ2/qUx1outg1cAAq+eInY2+VvcQw7VE5JAz3ebGhwjKqSaGQlwxTKTm/Nefhar8TT/5yWrYQNvpJUA/FtrKPoOAtYAxMwG4cvzgXX0/pix17MwDMOrRmEB9pm8fQ+9FIP+XXzSVJ8lLmuXgnHk9KZHNu0k67BJIvMycBVEvLs4nGVqq8p5ctmJtQ484LjptO0Wbf2a0zVKn6e/sKXExv+sl+YSafFh3ek5kOsLcGEMA42w==
signature_date    : 2022-08-13T09:00:18.450949
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

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


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

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_contains = "gvim"
silentflags = "/S"


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    bin_name = glob.glob("*%s*.exe" % bin_contains)[0]

    # Uninstalling older versions of the software
    for to_uninstall in installed_softwares(name=r"Vim "):
        if Version(to_uninstall["version"]) < Version(package_version) or force:
            print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
            killalltasks(control.impacted_process.split(","))
            run(uninstall_cmd(to_uninstall["key"]))
            wait_uninstallkey_absent(to_uninstall["key"])
            package_version = control.get_software_version()
            # removing old version from system path
            path_dir = makepath(programfiles32, "Vim", "vim%s" % to_uninstall["version"].replace(".", ""))
            remove_from_system_path(path_dir)

    # Installing the software
    print("Installing: %s" % bin_name)

    install_exe_if_needed(
        bin_name,
        silentflags=silentflags,
        name="Vim %s" % package_version.rsplit(".", 1)[0],
        min_version=package_version,
    )
    # adding to system path
    destdir = makepath(programfiles32, "Vim", "vim%s" % package_version.rsplit(".", 1)[0].replace(".", ""))
    print("adding to system path : %s " % destdir)
    add_to_system_path(destdir)


def uninstall():
    # Declaring local variables
    package_version = control.get_software_version()
    # removing from system path
    destdir = makepath(programfiles32, "Vim", "vim%s" % package_version.rsplit(".", 1)[0].replace(".", ""))
    remove_from_system_path(destdir)


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    # Getting latest version information from official sources
    url = "https://www.vim.org/download.php"
    dl_url = wgets(url, proxies=proxies).split("The current stable version is")[1].split('href="')[1].split('">')[0]
    if control.architecture == "x64":
        dl_url = dl_url.replace("x86", "x64")
    version = dl_url.split("/")[-2].replace("v", "")
    latest_bin = dl_url.split("/")[-1]

    print("Latest %s version is: %s" % (app_name, version))
    print("Download URL is: %s" % dl_url)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(dl_url, latest_bin, proxies=proxies)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if version_from_file.endswith(".0"):
            version_from_file = version_from_file.rsplit(".", 1)[0]
        # if not version_from_file.startswith(version) and version_from_file != '':
        if Version(version_from_file) != Version(version) and version_from_file != "":
            print("Changing version to the version number of the binary")
            os.rename(latest_bin, bin_contains + version_from_file + ".exe")
            version = version_from_file
        else:
            print("Binary file version corresponds to online version")

    version = ".".join(version.split(".")[:2])
    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
    # control.set_software_version(version)
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version)

    # Validating update-package-sources
    return result


def remove_outdated_binaries(version, list_extensions=["exe", "msi", "deb", "rpm", "dmg", "pkg"], filename_contains=None):
    r"""Remove files based on the version contained in his filename, failing over on file version on compatible OSes

    Args:
        version (str): version number of keeped files
        list_extensions (str or list of str): file extensions of compared files
        filename_contains (str or list of str): Part of the filename that must be contained (useful for distinguishing architecture and os)

    Returns:
        list: list of deleted files

    .. versionadded:: 2.0

    .. versionchanged:: 2.2
        Now returns removed files, now checking .exe and .msi file versions

    """
    files = []
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if filename_contains:
        if type(filename_contains) != list:
            filename_contains = [filename_contains]
    list_extensions = ["." + ext for ext in list_extensions if ext[0] != "."]
    for file_ext in list_extensions:
        for bin_in_dir in glob.glob("*%s" % file_ext):
            if not version in bin_in_dir:
                if platform.system() == "Windows":
                    if file_ext == ".exe" or file_ext == ".msi":
                        if Version(version) == Version(get_version_from_binary(bin_in_dir, "FileVersion")) or Version(version) == Version(
                            get_version_from_binary(bin_in_dir, "ProductVersion")
                        ):
                            print("%s file or product version is correct (%s)" % (bin_in_dir, version))
                            continue
                remove_file(bin_in_dir)
                files.append(bin_in_dir)
            if filename_contains:
                for filename_contain in filename_contains:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)
                        files.append(bin_in_dir)
    return [fn for fn in files]

5e0c564482b5e73e5db2b821c37aafabdb129b24fc32ede17b919449044640ac : setup.py
9e1e215e66ecb8f4789b79ab6a84948841487d75e44bcd0a4da3784b7d3a1141 : gvim_9.0.0000_x64_signed.exe
851fa72b363b2e1cecdce5f23dc8c223154e1e234892a6d27806f548cc633ed4 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
ca8ebebce7d27b7fe76332697f7047f688f74af2fb87131cb66a523d64d87e03 : luti.json
631f0d97314bfb38722cd14d434ef0958d7125997c61edf8733ad423cd763f16 : WAPT/control