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

app_name = "SCENARIclient 6"

def install():
    for to_uninstall in installed_softwares("SCclient"):
        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"])

    print("installing tis-scenariclient")
    run(r'"SCENARIclient6.4.5_fr-FR_202601281209_win_x64.exe" /S')


def uninstall():
    for to_uninstall in installed_softwares(app_name):
        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"])