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

"""{
   "key":"Everything",
   "name":"Everything 1.4.1.1024 (x64)",
   "version":"1.4.1.1024",
   "install_date":"",
   "install_location":"C:\\Program Files\\Everything",
   "uninstall_string":"C:\\Program Files\\Everything\\Uninstall.exe",
   "publisher":"voidtools",
   "system_component":0,
   "win64":true
  },
  {
   "key":"{A63AA9C9-279A-4486-8744-62E7F4E92A06}",
   "name":"Everything 1.4.1.1024 (x64)",
   "version":"1.4.1.1024",
   "install_date":"2024-04-19 00:00:00",
   "install_location":"",
   "uninstall_string":"MsiExec.exe /X{A63AA9C9-279A-4486-8744-62E7F4E92A06}",
   "publisher":"voidtools",
   "system_component":0,
   "win64":true
  },
  {
   "key":"Everything",
   "name":"Everything 1.4.1.1024 (x86)",
   "version":"1.4.1.1024",
   "install_date":"",
   "install_location":"C:\\Program Files (x86)\\Everything",
   "uninstall_string":"C:\\Program Files (x86)\\Everything\\Uninstall.exe",
   "publisher":"voidtools",
   "system_component":0,
   "win64":false
  },
  {
   "key":"{A6962497-95B5-4EC1-AF6F-B7DEA1602AC6}",
   "name":"Everything 1.4.1.1024 (x86)",
   "version":"1.4.1.1024",
   "install_date":"2024-04-19 00:00:00",
   "install_location":"",
   "uninstall_string":"MsiExec.exe /X{A6962497-95B5-4EC1-AF6F-B7DEA1602AC6}",
   "publisher":"voidtools",
   "system_component":0,
   "win64":false
  }"""


def install():
    bin_name = glob.glob("Everything-*-Setup.exe")[0]
    install_exe_if_needed(
        bin_name,
        silentflags="/S",
        key="Everything",
        min_version=control.get_software_version(),
    )
