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

uninstallkey = []

def install():
    print('Copie des fichiers')
    if isdir(r'C:\Program Files\Codeblocks'):
        remove_tree(r'C:\Program Files\Codeblocks')
    if isdir(r'C:\ProgramData\Microsoft\Start Menu\Programs\Codeblocks'):
        remove_tree(r'C:\ProgramData\Microsoft\Start Menu\Programs\Codeblocks')
    print('Copie des fichiers')
    os.mkdir('C:\Program Files\Codeblocks')
    copytree2(r'Codeblocks',r'C:\Program Files\Codeblocks')
    print('On ajoute licone au bureau')
    create_desktop_shortcut(r'Codeblocks 17.12',target=r'C:\Program Files\Codeblocks\codeblocks.exe')


def uninstall():
    print('installing waptiut-codeblock')
    if isdir(r'C:\Program Files\Codeblock'):
        remove_tree(r'C:\Program Files\Codeblock')
    print('Suppression de licone')
    remove_desktop_shortcut(r'Codeblocks 17.12')