[SOLVED] Installing Office365

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Minus
Messages: 13
Registration: August 2, 2019 - 9:05 AM

August 2, 2019 - 09:32

Hello everyone

Well, I started using WAPT a few weeks ago after spending a few years on updateengine.

This migration has not been without some pain, but it is going well so far and I have to tackle a big task: the deployment of Office365.

So I simply used the Windows deployment tool to download the latest version of Office 365, then:

I generated my own XML file (config-installation.xml) for the installation:

Code: Select all

<Configuration>
  <Info Description="Domaine Office Customization V1" />
  <Add OfficeClientEdition="64" Channel="Monthly" ForceUpgrade="TRUE">
    <Product ID="O365BusinessRetail">
      <Language ID="fr-fr" />
      <ExcludeApp ID="Groove" />
      <ExcludeApp ID="Lync" />
    </Product>
  </Add>
  <Property Name="SharedComputerLicensing" Value="0" />
  <Property Name="PinIconsToTaskbar" Value="TRUE" />
  <Property Name="SCLCacheOverride" Value="0" />
  <Property Name="AUTOACTIVATE" Value="FALSE" />
  <Updates Enabled="TRUE" />
  <Updates Branch="Business" />
  <RemoveMSI>
    <IgnoreProduct ID="VisPro" />
    <IgnoreProduct ID="VisStd" />
  </RemoveMSI>
  <AppSettings>
    <Setup Name="Company" Value="Domaine" />
    <User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
    <User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
    <User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
  </AppSettings>
  <Display Level="None" AcceptEULA="TRUE" />
</Configuration>
Then create a batch file to launch the installation

Code: Select all

@echo off
setup.exe /configure config-installation.xml
exit
The same applies to the uninstallation process; here is the XML file (config-uninstall.xml):

Code: Select all

<Configuration>
<Display Level="None" AcceptEULA="True" />
<Property Name="FORCEAPPSHUTDOWN" Value="True" />
<Remove>
<Product ID="O365BusinessRetail">
</Product>
</Remove>
</Configuration>
and the batch file:

Code: Select all

@echo off
setup.exe /configure config-uninstall.xml
exit
When launched separately, the two batch files work perfectly and do what I ask of them

So, for Wapt, I created the following setup.py file:

Code: Select all

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

uninstallkey = []

def install():
	print('installing domaine-Office365Business')
	run('InstallOffice365.bat')

def uninstall():
	print('uninstalling domaine-Office365Business')
	run('UninstallOffice365.bat')
The installation part works perfectly when restarting or shutting down the machine, however the uninstallation part does not work at all.

For the uninstallation, here is the information I was able to extract from Windows:

Code: Select all

sofware name: Microsoft Office 365 Business - fr-fr
Uninstall key: O365BusinessRetail - fr-fr
version: 16.0.11727.20244
There are surely much simpler and cleaner ways to do it at all levels, so I'm all for it, especially if it incorporates:

an installation that can be done without requiring the machine to restart
an uninstallation that works via the WAPT console

Thank you in advance for your help, which will also allow me to learn more about WAPT

Debian 9.9 Server
WAPT 1.5.1.26
W10 Package Creation Station
Christophe0110
Messages: 53
Registration: June 11, 2019 - 12:04

August 2, 2019 - 2:13 PM

Hi !

So I tackled this package for Office 365 Business (2019) last week...
So I'd like to share my setup.py:

Code: Select all

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

uninstallkey = []

def install():

    if not installed_softwares(u'O365BusinessRetail'):
        print('Microsoft Office 365 Business 2019 : Installing...')

        killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'])

        run(u'setup.exe /configure Configuration.xml',timeout=2000,accept_returncodes=[1641,3010,0])

        print('Microsoft Office 365 Business 2019 : Installation complete')
    else:
        print('Microsoft Office 365 Business 2019 : Already installed !')

    if not isdir(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
        mkdirs(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall'))
    filecopyto('setup.exe',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe'))
    filecopyto('ConfigurationUninstall.xml',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','ConfigurationUninstall.xml'))

def uninstall():

    print('Microsoft Office 365 Business 2019 : Uninstalling...')

    #Closing applications :
    killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'])

    #Uninstalling :
    if installed_softwares(u'O365BusinessRetail'):
        if isfile(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe')):
            run('"' + makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe') + r'" /configure ConfigurationUninstall.xml',timeout=2000,accept_returncodes=[1641,3010,0])
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe'))
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','ConfigurationUninstall.xml'))
            if dir_is_empty(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
                remove_tree(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall'))

    print('Microsoft Office 365 Business 2019 : Uninstallation complete')


At the root of the package, I placed the "setup.exe" file as well as the "Office" directory downloaded using the previously executed command: setup.exe /download configuration.xml

Here is the content of the configuration.xml file (but it's up to you to configure it as you wish):

Code: Select all

<Configuration ID="30ca9b8e-4c43-4a87-a12f-1e5966fdce99">
  <Info Description="NomSociete" />
  <Add OfficeClientEdition="32" Channel="Insiders" ForceUpgrade="TRUE">
    <Product ID="O365BusinessRetail">
      <Language ID="fr-fr" />
      <ExcludeApp ID="Groove" />
      <ExcludeApp ID="Lync" />
    </Product>
    <Product ID="ProofingTools">
      <Language ID="en-us" />
    </Product>
  </Add>
  <Property Name="SharedComputerLicensing" Value="0" />
  <Property Name="PinIconsToTaskbar" Value="TRUE" />
  <Property Name="SCLCacheOverride" Value="0" />
  <Property Name="AUTOACTIVATE" Value="FALSE" />
  <Updates Enabled="TRUE" />
  <RemoveMSI>
    <IgnoreProduct ID="VisPro" />
    <IgnoreProduct ID="VisStd" />
  </RemoveMSI>
  <AppSettings>
    <Setup Name="Company" Value="NomSociete" />
    <User Key="software\microsoft\office\16.0\access\security" Name="vbawarnings" Value="1" Type="REG_DWORD" App="access16" Id="L_VBAWarningsPolicy" />
    <User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
    <User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
    <User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
  </AppSettings>
  <Display Level="None" AcceptEULA="TRUE" />
  <Logging Level="Off" />
</Configuration>
And the contents of the configurationUninstall.xml file:

Code: Select all

<Configuration>
  <Display Level="None" AcceptEULA="TRUE" />
  <Property Name="FORCEAPPSHUTDOWN" Value="True" />
  <Remove>
    <Product ID="O365BusinessRetail">
      <Language ID="fr-fr" />
    </Product>
  </Remove>
  <Logging Level="Off" />
</Configuration>
As you can see from the code, during installation I copy the "setup.exe" file and the "ConfigurationUninstall.xml" file into a folder created under "Microsoft Office".
Then, I use it for uninstallation...

It works perfectly ;)

A+
Chris.
Last edited by Christophe0110 on June 28, 2022 - 08:18, edited 1 time.
Minus
Messages: 13
Registration: August 2, 2019 - 9:05 AM

August 2, 2019 - 3:16 PM

That's

great, thanks a lot Christophe0110!

Okay, I'm on vacation now, but as soon as I get back to work I'll be sure to update my Office.

I'll keep you posted.
User avatar
Ben
Messages: 10
Registration: Nov 7, 2019 - 5:19 p.m.

November 7, 2019 - 5:26 PM

Good morning,

I am also in the process of planning the deployment of O365. I based my plan on the work done by Christophe0110 (thanks to him by the way!) but I am encountering a problem.
The installation process works perfectly. It proceeds correctly and takes into account the configuration XML file.

However, the uninstallation is failing: I can successfully enter the script (the files and the "OfficeClickToRunWAPTUninstall" folder are deleted correctly)... but O365 remains installed on the machine. In the WAPT console, the package is no longer visible on the machine, as if everything had gone smoothly.

It seems that the following line is the problem and is preventing the installer from launching:

Code: Select all

run('"' + makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe') + r'" /configure ConfigurationUninstall.xml',timeout=2000,accept_returncodes=[1641,3010,0])
Does anyone have any ideas? I'm stumped

THANKS !
-------------------
WAPT Version: 1.7.4 (Community Edition)
Server OS: Windows Server 2016
Administration/Package Creation Machine OS: Windows 10 1709
User avatar
Ben
Messages: 10
Registration: Nov 7, 2019 - 5:19 p.m.

November 13, 2019 - 11:44

I solved my problem which was very simple: the absolute path to the XML file had to be passed for uninstallation (contrary to what was proposed in the script above).

Below is my complete script:

Code: Select all

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

uninstallkey = []

def install():

    if not installed_softwares(u'O365BusinessRetail'):
        print('Microsoft Office 365 Business 2019 : Installation...')

        killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'])

        run(u'setup.exe /configure install.xml',timeout=2000,accept_returncodes=[1641,3010,0])

        print('Microsoft Office 365 Business 2019 : Installation complete')
    else:
        print('Microsoft Office 365 Business 2019 : Already installed !')

    if not isdir(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
        mkdirs(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall'))
    filecopyto('setup.exe',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe'))
    filecopyto('uninstall.xml',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','uninstall.xml'))
    filecopyto('uninstall.bat',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','uninstall.bat'))

def uninstall():

    print('Microsoft Office 365 Business 2019 : Uninstalling...')

    uninstallstring ='"%s\Microsoft Office\OfficeClickToRunWAPTUninstall\setup.exe" /configure "%s\Microsoft Office\OfficeClickToRunWAPTUninstall\uninstall.xml"' % (programfiles32,programfiles32)

    #Closing applications :
    killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'])

    #Uninstalling :
    if installed_softwares(u'O365BusinessRetail'):
        print('O365 a ete trouve.')
        if isfile(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe')):
            print('Setup.exe trouve. Lancement de la commande de desinstallation ('+uninstallstring+')')

            run(uninstallstring,timeout=2000,accept_returncodes=[1641,3010,0])

            print('Nettoyage des fichiers de desinstallation.')
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe'))
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','uninstall.xml'))
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','uninstall.bat'))

            print('Suppression du dossier.')
            if dir_is_empty(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
                remove_tree(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall'))

    print('Microsoft Office 365 Business 2019 : Uninstallation complete')
-------------------
WAPT Version: 1.7.4 (Community Edition)
Server OS: Windows Server 2016
Administration/Package Creation Machine OS: Windows 10 1709
Christophe0110
Messages: 53
Registration: June 11, 2019 - 12:04

November 14, 2019 - 2:57 PM

Hi Ben,

That's strange indeed, because it works for me without giving the full path to the XML file...

But if it works that way, I'll modify my script just to be safe (you never know, it might work for some and not for others...).

Cheers!
Minus
Messages: 13
Registration: August 2, 2019 - 9:05 AM

February 24, 2020 - 11:42

Hello,

shame on me, I forgot to give feedback as promised, :oops: :oops:

Christophe0110. It works perfectly as is.

I made a few minor adjustments, and frankly, it works.

Thank you for sharing.
Christophe0110
Messages: 53
Registration: June 11, 2019 - 12:04

March 2, 2020 - 11:49

It was nothing ;)
srvmac
Messages: 3
Registration: August 19, 2020 - 09:34

August 19, 2020 - 10:12

Hello everyone,

I am contacting you because I need to install Office 365 and I followed your advice and used the setup.py file you provided.

Despite this, there is a package installation error when I launch the installation from the Wapt console or from the client PC via the wapt library.

The error is: an operation failed, do you want to force the installation/uninstallation? Yes or no doesn't matter.

The setup.exe file runs correctly locally, and I successfully generated the Office folder in the root directory using the command `setup.exe /download installOfficeBusRet64.xml`. This downloaded all the files from Microsoft, and I placed everything in the waptdev/office365 package folder at the root.

My configuration file:

Code: Select all

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

uninstallkey = []

def install():

    if not installed_softwares(u'O365BusinessRetail'):
        print('Microsoft Office 365 Business 2019 : Installing...')

        killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'])

        run(u'setup.exe /configure installOfficeBusRet64.xml',timeout=2000,accept_returncodes=[1641,3010,0])

        print('Microsoft Office 365 Business 2019 : Installation complete')
    else:
        print('Microsoft Office 365 Business 2019 : Already installed !')

    if not isdir(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
        mkdirs(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall'))
    filecopyto('setup.exe',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe'))
    filecopyto('ConfigurationUninstall.xml',makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','ConfigurationUninstall.xml'))

def uninstall():

    print('Microsoft Office 365 Business 2019 : Uninstalling...')

    #Closing applications :
    killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.exe','MSPUB.EXE','MSACCESS.EXE','INFOPATH.EXE','lync.exe','ONENOTE.EXE','OUTLOOK.EXE','ONENOTEM.EXE','MSOSYNC.EXE','GROOVE.EXE'])

    #Uninstalling :
    if installed_softwares(u'O365BusinessRetail'):
        if isfile(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe')):
            run('"' + makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe') + r'" /configure ConfigurationUninstall.xml',timeout=2000,accept_returncodes=[1641,3010,0])
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','setup.exe'))
            remove_file(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall','ConfigurationUninstall.xml'))
            if dir_is_empty(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
                remove_tree(makepath(programfiles32,'Microsoft Office','OfficeClickToRunWAPTUninstall'))

    print('Microsoft Office 365 Business 2019 : Uninstallation complete')

Thank you for your help.

Seb
Christophe0110
Messages: 53
Registration: June 11, 2019 - 12:04

January 5, 2021 - 9:55 AM

Hello Seb,

I'm only seeing your message now while browsing through my old messages...
Sorry for the 6-month delay...

Were you able to solve your problem?

When you say:
The setup.exe file runs correctly locally, and I successfully generated the Office folder in the root directory using the command `setup.exe /download installOfficeBusRet64.xml`. This downloaded all the files from Microsoft, and I placed everything in the waptdev/office365 package folder at the root.
Note that these files must be placed in an "Office" folder located in the package directory (not the files directly in the root of the package).
And leave the setup.exe file next to the "Office" folder...

A+
Christophe.
Locked