Page 1 of 1

[RESOLVED] Office 2019 64-bit

Published: March 16, 2023 - 11:43
by Eyji
Good morning,

I created a repository to install Office 2019 in 32-bit and it works very well.
My problem is I would like to make the same package but for a 64-bit Office 2019 installation.
Could you tell me what mistake I might have made?.

Code: Select all

# 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 = []

# raccourcis
RaccourcisDossierProgramm1 = makepath(programfiles32,"Microsoft Office","root","Office16")

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'

def install():
    killalltasks('WINWORD.EXE')
    killalltasks('POWERPNT.EXE')
    killalltasks('EXCEL.EXE')
    killalltasks('MSPUB.EXE')
    killalltasks('MSACCESS.EXE')
    killalltasks('INFOPATH.EXE')
    killalltasks('lync.exe')
    killalltasks('ONENOTE.EXE')
    killalltasks('OUTLOOK.EXE')
    killalltasks('ONENOTEM.EXE')
    killalltasks('MSOSYNC.EXE')
    killalltasks('GROOVE.EXE')

    print('installing %s'.format(control.asrequirement()))

    office_installed = installed_softwares(softname)

    cmd = r'"setup.exe" /configure "Configuration-office2019.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))

    create_desktop_shortcut(r'Word',target=r'C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE')
    create_desktop_shortcut(r'Excel',target=r'C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE')
    create_desktop_shortcut(r'Outlook',target=r'C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE')
    create_desktop_shortcut(r'PowerPoint',target=r'C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE')
XML configuration file

Code: Select all

<Configuration>
  <Add OfficeClientEdition="64" Channel="PerpetualVL2019">
    <Product ID="ProPlus2019Volume">
      <Language ID="fr-fr" />
    </Product>
  </Add>
  <RemoveMSI>
    <IgnoreProduct ID="VisPro" />
    <IgnoreProduct ID="VisStd" />
  </RemoveMSI>
  <Display Level="None" AcceptEULA="TRUE" /> 
</Configuration>
Thanks in advance.

Re: Office 2019 64-bit

Published: March 16, 2023 - 2:06 PM
by dcardon
Hello Mehdi,

what is your WAPT version, OS version (server/client), edition, etc. (see forum rules above)?

What is the original error message?

Regards,

Denis

Re: Office 2019 64-bit

Published: March 16, 2023 - 2:36 PM
by Eyji
Good morning,

I am on version 2.3.0.13516, DEBIAN server 10.9 / Windows 10 LTSC 21H2 client.

Here is my error message.

Code: Select all

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4001, in install_wapt
    setup = import_setup(setup_filename)
  File "C:\Program Files (x86)\wapt\waptutils.py", line 1520, in import_setup
    py_mod = imp.load_source(modulename, setupfilename)
  File "imp.py", line 171, in load_source
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Windows\TEMP\waptom4sqfqv\setup.py", line 8, in <module>
NameError: name 'makepath' is not defined

NameError: name 'makepath' is not defined
Sincerely,

Mehdi

Re: Office 2019 64-bit

Published: March 16, 2023 - 6:03 PM
by dcardon
Hello again Mehdi,

The following two lines must be kept in the header of the package:

Code: Select all

# -*- coding: UTF-8 -*-
from setuphelpers import *
makepath is a wapt/setuphelpers function and not a native Python function.

Sincerely,

Denis

Re: Office 2019 64-bit

Published: March 17, 2023 - 11:07
by Eyji
Hello,

I'm so sorry to have bothered you just for this; I hadn't realized I hadn't copied everything. :?
Thank you for your prompt reply.
Have a good day,

Mehdi

Re: [SOLVED] Office 2019 64-bit

Published: March 23, 2023 - 4:41 PM
by dcardon
No worries Medhi, thanks for the feedback!
Denis