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


def install():
    install_exe_if_needed(
        glob.glob("flamerobin*.exe")[0],
        silentflags="/verysilent",
        name="FlameRobin",
        min_version=control.get_software_version(),
        get_version=get_app_path_version,
    )


def get_app_path_version(key):
    app_path = makepath(key["install_location"] + "flamerobin.exe")
    return get_file_properties(app_path)["FileVersion"]
