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

uninstallkey = []

def install():
    soft='Autodesk 3ds Max 2019'
    check_installed_out = installed_softwares(soft)
    if not check_installed_out:
        print('installing waptiut-3dsmax')
        run(r'"3dsMax\Img\Setup.exe" /W /Q /I 3dsMax\Img\3ds2019.ini /language fr-fr',timeout=3600)
    else:
        print('3DS Max est deja présent')

def uninstall():
    print('Désinstallation de Autodesk Material Library 2018')
    run(r'"Msiexec.exe" /X {7847611E-92E9-4917-B395-71C91D523104} /passive ')

    print('Désinstallation de Autodesk Material Library Base Resolution Image Library 2018')
    run(r'"Msiexec.exe" /X {FCDED119-A969-4E48-8A32-D21AD6B03253} /passive '  )

    print('Désinstallation de Library Medium Resolution Image Library 2018')
    run(r'"Msiexec.exe" /X {6EC5DA32-D02D-47D4-A3C4-988C1BC1A5FE} /passive '  )

    print('Désinstallation Autodesk Advanced Material Library Image Library 2018')
    run(r'"Msiexec.exe" /X {177AD7F6-9C77-4E50-BA53-B7259C5F282D} /passive '  )

    print('Désinstallation Autodesk Certificate Package  (x64) - 5.1.4')
    run(r'"Msiexec.exe" /X {79D5E475-5EAB-4474-84F5-BD612337A175} /passive '  )

    print('Désinstallation Autodesk License Service (x64) - 5.1.4')
    run(r'"Msiexec.exe" /X {3609A8D9-FC0C-4C9B-9F58-0B1D1A4FE556} /passive '  )

    print('Désinstallation 3ds Max 2018')
    run(r'"Msiexec.exe" /X {52B37EC7-D836-0410-0764-3C24BCED2010} /passive '  )

    print('Désinstallation MAXtoA for 3ds Max 2018')
    run(r'"Msiexec.exe" /X {471069C7-09E2-4289-8EB7-852237FD867E} /passive '  )

    print('Désinstallation Autodesk Backburner 2018.0')
    run(r'"Msiexec.exe" /X {0038F5AA-8482-4BB2-8A28-3FEA1D58D78A} /passive '  )

    print('Desinstallation Autodesk Inventor Server Engine for 3ds Max 2018')
    run(r'"Msiexec.exe" /X {1984E20A-184B-4073-87F4-6755F3EE5769} /passive '  )

    print('Desinstallation Autodesk Revit Interoperability for 3ds Max 2018')
    run(r'"Msiexec.exe" /X {0BB716E0-1800-0610-0000-097DC2F354DF} /passive '  )

    print('Desinstallation Autodesk Civil View for 3ds Max 2018 64-bit')
    run(r'"Msiexec.exe" /X {51C8EDF7-FFDA-430A-8B5E-1895FF14ACB7} /passive '  )
