Page 1 of 1

[SOLVED] Microsoft Office Pro 2016 Package

Published: October 8, 2021 - 4:01 PM
by olaplanche
Good morning,

I'm sharing my Office Pro 2016 package.

Prerequisites:

Run the command "setup.exe /admin" to generate an MSP file to save in the updates folder of the setup folder containing all the installation files. The setup folder must be copied into the package.

Code: Select all

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

uninstallkey = ['Office16.PROPLUS']

def install():
    print('installing wapt-office2016pro')
    install_exe_if_needed("%s\setup\setup.exe" % basedir,silentflags='',key='Office16.PROPLUS',min_version='16.0.4266.1001',timeout=1200)
    uninstallkey.remove('Office16.PROPLUS')

def uninstall():
    print('uninstalling wapt-office2016pro')
    import tempfile
    pathuninstallfile = makepath(tempfile.gettempdir(),'SilentUninstall.xml')
    data = r"""<Configuration Product="ProPlus"><Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" /></Configuration>"""
    fichier = open(pathuninstallfile, "w")
    fichier.write(data)
    fichier.close()
    run(r'"%s\Common Files\Microsoft Shared\OFFICE16\Office Setup Controller\setup.exe" /uninstall ProPlus /config %s' % (programfiles32,pathuninstallfile))
    remove_file(pathuninstallfile)

Re: [SOLVED] Microsoft Office Pro 2016 Package

Published: October 14, 2021 - 3:01 PM
by dcardon
Thanks for sharing, olaplanche!
Denis

Re: [SOLVED] Microsoft Office Pro 2016 Package

Published: October 28, 2021 - 11:50 AM
by olaplanche
My pleasure.

Code modified to be compatible with Python 3:

The line:

Code: Select all

data = ur"""<Configuration Product="ProPlus"><Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" /></Configuration>"""
becomes :

Code: Select all

data = r"""<Configuration Product="ProPlus"><Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" /></Configuration>"""