# -*- coding: utf-8 -*- from setuphelpers import * # Empty package, you have to include offline downloaded files # You can use the following tool to help creating Configuration.xml and download necessary files : # https://github.com/YerongAI/Office-Tool # # You should also check for the uninstall string for uninstall_args by using : wapt-get list-registry Office uninstallkey = [ ] softname = "Microsoft Office Professional Plus 2019 - fr-fr" pgmsoffice = programfiles uninstall_args = r'scenario=install scenariosubtype=ARP sourcetype=None productstoremove=ProPlus2019Volume.16_fr-fr_x-none culture=fr-fr version.16=16.0 DisplayLevel=False' kill_list = ['winword.exe','powerpnt.exe','excel.exe','mspub.exe','msaccess.exe','infopath.exe','lync.exe','onenote.exe','outlook.exe','onenotem.exe','msosync.exe','groove.exe','OfficeClicktoRun.exe'] def install(): print('installing %s'.format(control.asrequirement())) office_installed = installed_softwares(softname) cmd = '"setup.exe" /configure "ProPlus2019.xml"' if not office_installed: print('Installing {}'.format(softname)) run(cmd,timeout=1200,accept_returncodes=[1641,3010,0]) else: if Version(office_installed[0]['version']) < Version(control.version.split('-',1)[0]): run(cmd,timeout=1200,accept_returncodes=[1641,3010,0]) else: print('{} already up to date or newer : {}'.format(softname,office_installed[0]['version'])) if not installed_softwares(softname): error(' {} has been installed but the uninstall key can not be found'.format(softname)) def uninstall(): print('Removing {}'.format(softname)) for soft in kill_list: killalltasks(soft) run('"%s" %s' % (makepath(pgmsoffice,'Common Files','microsoft shared','ClickToRun','OfficeClickToRun.exe'),uninstall_args),timeout=1200)