- copy office CD to folder
- run setup.exe /admin within office folder
- create template "wapt-get make-template setup.exe"
- i replace contents of setup.py from newly created wapt-package folder
- i copy contents of office folder to root of wapt-package folder
- build and upload: " Wapt-get build-upload <wapt-package folder>"
when i add it to a host, it fails everytime with a not very helpful :
"error during install of <package>: errors in packages <package>"
can you provide some help? thank you
setup.py:
Code : Tout sélectionner
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
def uninstall_office_modules():
print('Suppression des anciens modules office..')
check_installed_soft = installed_softwares('Microsoft Office System')
if check_installed_soft:
for uninstall in check_installed_soft:
key=uninstall['key']
if installed_softwares(uninstallkey=key):
cmd = WAPT.uninstall_cmd(uninstall['key'])
run(cmd)
def uninstall_office365():
print('Suppression Office 365')
check_installed_soft = installed_softwares('office 365')
if check_installed_soft:
for uninstall in check_installed_soft:
key=uninstall['key']
if installed_softwares(uninstallkey=key):
cmd = WAPT.uninstall_cmd(uninstall['key'])
run(cmd)
def killsoft():
for soft in ('WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'):
if isrunning(soft):
print ("closing %s" % soft)
killalltasks(soft)
softname = 'Microsoft Office Professionnel Plus 2016'
check_installed_out = installed_softwares(softname)
print('installing Office 2016')
if not check_installed_out:
cmd = '"setup.exe" /adminfile "silent.msp"'
else:
cmd = 'msiexec.exe /p silent.msp'
killsoft()
uninstall_office_modules()
uninstall_office365()
run(cmd,timeout=1200,accept_returncodes=[1641,3010,0])
check_installed_out = installed_softwares(softname)
if not check_installed_out:
error('End audit did not find the software.')
def uninstall():
fichier = open("%s\silent.xml" % programfiles32, "w" )
fichier.write('<Configuration Product="ProPlus"> \n')
fichier.write('<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" /> \n')
fichier.write(' <Setting Id="SETUP_REBOOT" Value="NEVER" /> \n')
fichier.write('</Configuration> \n')
fichier.close()
run('"%s\Common Files\microsoft shared\OFFICE16\Office Setup Controller\Setup.exe" /uninstall ProPlus /config "%s\silent.xml"' % (programfiles32,programfiles32),timeout=1200)
remove_file(r'%s\silent.xml'% programfiles32)