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


def get_version(app_registry_dict):
    return app_registry_dict['version'].split(' ', 1)[0]


def add_leading_zero(version):
    return '.'.join([i.zfill(2) for i in version.split('.')])


def install():
    bin_name = glob.glob("dosbox-x-*.exe")[0]
    bin_version = get_version_from_binary(bin_name)

    install_exe_if_needed(
        bin_name,
        key="{63E5D76D-0092-415C-B97C-E0D2F4F6D2EC}_is1",
        silentflags="/VERYSILENT /SP- /SUPPRESSMSGBOXES",
        min_version=control.get_software_version(),
        get_version=get_version
    )