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

app_uninstallkey = "7008-5171-7013-3819"

uninstall_path = makepath(programfiles, "OpenAudible", "uninstall.exe")


def install():
    bin_name = glob.glob("OpenAudible_*_x86_64.exe")[0]
    install_exe_if_needed(bin_name, silentflags="/allusers -q", key=app_uninstallkey, min_version=control.get_software_version())

    # Adding QuietUninstallString
    quiet_uninstall_string = installed_softwares(uninstallkey=app_uninstallkey)[0]["uninstall_string"] + " -q"
    register_uninstall(app_uninstallkey, quiet_uninstall_string=quiet_uninstall_string)
