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

#app_uninstallkey = "{550C9276-ABA6-4F67-BA0F-BABCA4CF289C}"
#app_uninstallkey = "{BD0079CD-FE66-4AC9-914F-1C09565A59CF}"
# app_uninstallkey = "{B7AAEFB2-910F-4B0B-AB29-172C4D83FAAA}"

def install():
    last_package_version = control.get_software_version()

    os_dict = {
        "windows": ".msi",
        "redhat_based": ".rpm"
    }

    arch_dict = {
        "x64": "x64"
    }

    # Correct OS suffix
    suffix = f"{os_dict.get(control.target_os)}"
    bin_name = glob.glob(f"ibm-semeru*{suffix}")[0]
    install_msi_if_needed(
        bin_name,
        min_version=control.get_software_version(),
        time_wait_uninstallkey_present=500
)