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

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    # Declaring local variables
    bin_name = glob.glob("*.exe")[0]

    for i in installed_softwares("zim desktop wiki"):
        run(uninstall_cmd(i["key"]))
        wait_uninstallkey_absent(i["key"])

    # Installing the software
    print("Installing: %s" % bin_name)
    install_exe_if_needed(
        bin_name,
        silentflags="/S",
        # key="404fbece-3a0a-4f4f-b1f1-82ce46af9696",
        name="Zim Desktop Wiki",
        min_version="",
    )
