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

uninstallkey = []

def install():
    if isdir(r'C:\TDM-GCC-32'):
        remove_tree(r'C:\TDM-GCC-32')
    print('Copie des fichiers')
    os.mkdir('C:\TDM-GCC-32')
    copytree2(r'TDM-GCC-32',r'C:\TDM-GCC-32')
    print('ajout de la variable')
    run(r'setx Path "C:\TDM-GCC-32\bin" /m')

    print('installing waptmmi-geany')
    install_exe_if_needed("geany-1.29_setup.exe",'/S',key='',min_version='1.29')

def session_setup():
    print('ajout de la variable')
    run(r'setx Path "C:\TDM-GCC-32\bin" /m')


def uninstall():
    print('Uninstall waptmmi-geany')
    run(r'"C:\Program Files (x86)\Geany\uninst.exe" /S')
    if isdir(r'C:\TDM-GCC-32'):
        remove_tree(r'C:\TDM-GCC-32')