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

#app_uninstallkey = "{550C9276-ABA6-4F67-BA0F-BABCA4CF289C}"
app_uninstallkey = "{BD0079CD-FE66-4AC9-914F-1C09565A59CF}"

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,
        key=app_uninstallkey,
        min_version=control.get_software_version()
)
