tis-cleanup-unins

1.0-4
Nettoyage unins00X residuels dans WAPT
0 downloads
Download
View on luti logo
tis-cleanup-unins icon

  Description 

  • package : tis-cleanup-unins
  • version : 1.0-4
  • architecture : all
  • categories : tools
  • maintainer : Alexandre Gauvrit
  • description : Nettoyage unins00X residuels dans WAPT
  • locale : all
  • target_os : windows
  • min_wapt_version : 2.0
  • sources :
  • installed_size : 5000
  • impacted_process :
  • description_fr : Nettoyage unins00X residuels dans WAPT
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Tranquil IT
  • licence :
  • signature_date : 2022-07-31T04:34:39.316722

  Setup.py 

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

def install():
    print("installing %s" % control.asrequirement())
    clean_uninst()


def audit():
    test_vers = clean_uninst()
    if test_vers[0] != "000":
        return "ERROR"
    else:
        return "OK"


def clean_uninst():
    print("Nettoyage unins00X.exe/unins00X.dat")
    list_ex = ["unins000.dat", "unins000.exe"]
    pattern = re.compile("[0-9]+(?=\.[^.]*$)")

    unins_exe = makepath(install_location("WAPT_is1"), "unins000.exe")
    unins_dat = makepath(install_location("WAPT_is1"), "unins000.dat")
    wapt_unins = makepath(install_location("WAPT_is1"), "unins*.*")

    all_unins = []
    for item in glob.glob(wapt_unins):
        all_unins.append(item.split("\\")[-1])

    bestvers = pattern.findall("".join(sorted(all_unins)))

    print("La version maximum est : {}".format(bestvers[0]))

    if bestvers[0] != "000":
        print(r"Restauration en unins000.exe et unins000.dat de la dernière version")
        try:
            filecopyto(makepath(install_location("WAPT_is1"), "unins{}.exe".format(bestvers[0])), unins_exe)
            filecopyto(makepath(install_location("WAPT_is1"), "unins{}.dat".format(bestvers[0])), unins_dat)
        except:
            pass

    for item_path in all_unins:
        if item_path in list_ex:
            continue
        try:
            print("Suppression de : {}".format(makepath(install_location("WAPT_is1"), item_path)))
            remove_file(makepath(install_location("WAPT_is1"), item_path))
        except:
            pass

    return bestvers




										

  Changelog 



No changelog.txt.
									
  manifest.sha256