Page 1 of 2

|PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: November 17, 2023 - 4:21 PM
by Vincent38
Good morning

I offer you the package(s) to install the outlook connector (v9.0.0.1937) for ZIMBRA in x64 and x86 (depending on your version of office/outlook).

There is a problem with the .msi file; the declared "uninstallkey" key is incorrect and does not match the one actually registered in the registry, so it needs to be corrected, hence the modification in setup.py.


To retrieve the .msi files (x64 and x86):
https://www.zimbra.com/product/addons/z...-download/


setup.py for x64:

Code: Select all

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls

uninstallkey = ["{E84234CB-FF68-4270-A7EE-422FA03B4E0E}"]

def install():
    # Declaring local variables

    # Installing the software
    print("Installing: ZimbraConnectorOLK_9.0.0.1937_x64.msi")
    install_msi_if_needed('ZimbraConnectorOLK_9.0.0.1937_x64.msi',key='{E84234CB-FF68-4270-A7EE-422FA03B4E0E}')

setup.py for x86:

Code: Select all

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls

uninstallkey = ["{C0A5C7CF-452B-4551-A9D5-CE41BC7831AF}"]

def install():
    # Declaring local variables

    # Installing the software
    print("Installing: ZimbraConnectorOLK_9.0.0.1937_x86.msi")
    install_msi_if_needed('ZimbraConnectorOLK_9.0.0.1937_x86.msi',key='{C0A5C7CF-452B-4551-A9D5-CE41BC7831AF}')
    

It works for me, but I'm unsure about having to enter the uninstallkey twice :D
Commander

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: January 10, 2024 - 4:10 PM
by Vincent38
Hello!

Update for version v9.0.0.1941, uninstallkey needs to be modified in the setup.py file:

for x64: {89D59DBA-173A-4D13-8AB9-606F132F70FE}

for x86: {7B50AD56-1BE7-4006-97E2-B6969930BB5F}

Regards

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: January 12, 2024 - 10:36 AM
by jpele
Hello,
I created the package "blindly," as we don't have an easy way to test this software at the moment. Could you please test it and confirm that it works correctly? It can be downloaded here:
https://wapt.tranquil.it/wapt-testing/t ... EPROD.wapt

Without your confirmation, the package will not be automatically published on the Store.

Sincerely,
Jimmy

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: January 12, 2024 - 12:02 PM
by Vincent38
Good morning
As I expected, it doesn't work, since, as indicated in my post, the installation key specified in the msi by zimbra does not correspond to the one actually used.
So it gets stuck at the key verification stage:

Code: Select all

C:\Users\vmorey\Desktop>wapt-get install domoprod-zimbra-connector-outlook
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
installing WAPT packages domoprod-zimbra-connector-outlook
https://wapt1.addomo.domosolaris.com/wapt/domoprod-zimbra-connector-outlook_9.0.0.1941-2_x64_windows_PROD.wapt : 23071462 / 23071462 (100%) (79638 KB/s)
Installing domoprod-zimbra-connector-outlook(=9.0.0.1941-2)
Installing: ZimbraConnectorOLK_9.0.0.1941_x64.msi (9.0.0.1941)
Waiting for key: {E832D508-4385-452B-93CF-18D28BA6270B} to appear in Windows registry
The rest of the message after pressing Ctrl+C:

Code: Select all

2024-01-12 12:06:11,693 CRITICAL Fatal error in install script: AttributeError: 'EWaptSetupException' object has no attribute 'returncode':
Traceback (most recent call last):
  File "C:\Users\vmorey\AppData\Local\Temp\waptmgpv8_ev\setup.py", line 9, in install
    install_msi_if_needed(
  File "C:\Program Files (x86)\wapt\common.py", line 4033, in new_func
    return func(*args, **kwargs)
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 1416, in install_msi_if_needed
    error('MSI %s has been installed but the %s can not be found' % (msi,searchparam))
  File "C:\Program Files (x86)\wapt\waptutils.py", line 1892, in error
    raise EWaptSetupException('Fatal error : %s' % reason)
waptutils.EWaptSetupException: Fatal error : MSI ZimbraConnectorOLK_9.0.0.1941_x64.msi has been installed but the key {E832D508-4385-452B-93CF-18D28BA6270B} can not be found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4083, in install_wapt
    exitstatus = setup.install()
  File "C:\Users\vmorey\AppData\Local\Temp\waptmgpv8_ev\setup.py", line 14, in install
    if e.returncode == 1603:
AttributeError: 'EWaptSetupException' object has no attribute 'returncode'

2024-01-12 12:07:58,670 CRITICAL Package domoprod-zimbra-connector-outlook [x64_fr_PROD] not installed due to errors : AttributeError: 'EWaptSetupException' object has no attribute 'returncode'

Results :

 === install packages ===
  domoprod-zimbra-connector-outlook [x64_fr_PROD] | domoprod-zimbra-connector-outlook (9.0.0.1941-2)

 === errors packages ===
  domoprod-zimbra-connector-outlook [x64_fr_PROD] | domoprod-zimbra-connector-outlook (9.0.0.1941-2)
Commander

PS: And to test it yourself, you just need an Office installation including Outlook (x64 or x86 depending on the package, any version, Office 2016, 2019 or even 365)
No need to launch Outlook; if the package installs, that's it

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: January 15, 2024 - 12:05 PM
by Vincent38
I notified Zimbra of this problem on Friday, I am waiting for their reply.

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: February 21, 2024 - 6:48 PM
by Vincent38
Hello

. Well, it's really tricky, actually. It seems the problem stems from the fact that the ZCO installer (.msi) modifies itself when it detects it's being run on a machine not using an English version of Windows.

Indeed, the .msi is multilingual, including the language of the setup itself.
There's only one .msi file, but running it on an English Windows machine displays the installation text (copyright information, license details, button names, etc.) in English, while running it on a French Windows machine displays the same information in French.
But this modification causes the installer to generate/use a new "product code" (it's not just the uninstallation key that changes, but all the keys corresponding to ZCO in the registry) that's different from the one written in the .msi information.

And since wapt uses the key declared in the .msi by default, it obviously doesn't work.

I'm not quite sure how to solve this. Perhaps Zimbra can resolve the issue. Otherwise, is your tool (luti) capable of automatically installing the .msi file to retrieve the correct key and inject it into the package before pushing it to the store?

Regards

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: March 8, 2024 - 3:47 PM
by bastien30
Good morning,

I just stumbled upon this topic, I actually made a package for the ZCO very recently, based on the one from the TIS store.

My package is multi-architecture and integrates both versions, 32-bit and 64-bit.
The reason is simple: on a 64-bit machine with a 32-bit version of Outlook installed, the 64-bit package will fail because the ZCO will not install.

My package detects the presence of a 32-bit Outlook and installs the corresponding ZCO (there is certainly a cleaner way to detect Office).
In addition, I define some ZCO parameters via the registry (the same parameters that can be used to customize the MSI, but I didn't want to have to do it every time) :D ): disabling updates, server address and port, using SSL, disabling aliases in the GAL, and disabling signature synchronization.
To be adapted according to needs (there are other customizable parameters in this registry key).

To address the fact that the uninstall key changes depending on the language, I use an uninstall() function that retrieves the uninstall key of the installed ZCO to uninstall it. Therefore, I don't use the install_msi_if_needed() function.

Finally, the only constraint is that the package version must match the 64-bit ZCO version. If they release different version numbers for the two architectures, then it could cause a problem (but I think that's unlikely).

Edit 03/01/2025:
  • Added an audit function to add the Windows Search registry keys from the ZCO that were deleted after an automatic Office update (I personally set the "audit_schedule" parameter to "10m" in the control file), otherwise the non-admin user gets a UAC prompt every time Outlook starts and the search function no longer works (see https://forums.zimbra.org/viewtopic.php?t=67734).
  • ZCO configuration correction via the registry on 32-bit Windows


Here is the code for setup.py:

Code: Select all

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

def install():        
    # Check architecture and if Office is 32bits on 64bits system
    regpath = r'SOFTWARE\Zimbra'
    if is32() or isdir(makepath(programfiles32, r'Microsoft Office', r'root')):
        print(r'INFO: x86 installation detected')
        bin_name = 'ZimbraConnectorOLK_x86.msi'
        if is64():
            regpath = r'SOFTWARE\WOW6432Node\Zimbra'
    else:
        bin_name = 'ZimbraConnectorOLK_x64.msi'
    
    installed_zco = installed_softwares('Zimbra Connector for Microsoft Outlook')
    if not installed_zco or installed_zco[0]['version'] < Version(control.get_software_version(), 4) or WAPT.options.force :
        try:
            # Installing the software
            run(r'msiexec /qn /norestart /i %s' % bin_name, timeout=600)
        except Exception as e:
            if e.returncode == 1603:
                print(f'INFO: Microsoft Outlook needs to be installed.')
                error(e)
            else:
                error(e)
    else:
        print('%s version %s is already installed, skipping...' % (control.name, installed_zco[0]['version']))
    
    # Customize installation
    with reg_openkey_noredir(HKEY_LOCAL_MACHINE, r'SOFTWARE\Zimbra', sam=KEY_WRITE, create_if_missing=True) as key:
        reg_setvalue(key, 'SkipVersionUpgrade', '65535', REG_SZ)  # disable auto-update
        reg_setvalue(key, 'ZimbraServerName', 'smtp.mydomain.tld', REG_SZ)  # Zimbra server name
        reg_setvalue(key, 'ZimbraServerPort', 443, REG_DWORD)  # Zimbra server port
        reg_setvalue(key, 'ZimbraConnectionMethod', 1, REG_DWORD)  # use SSL
        reg_setvalue(key, 'GalSyncDisableAliases', 1, REG_DWORD)  # disable alias in GAL
        reg_setvalue(key, 'SigSyncEnabled', 0, REG_DWORD)  # disable signature sync

def uninstall():
    if installed_softwares('Zimbra Connector for Microsoft Outlook'):
        key = installed_softwares('Zimbra Connector for Microsoft Outlook')[0]['key']
        run('msiexec /qn /norestart /X %s' % key)
def audit():
    audit_result = "OK"
    # Check architecture and if Office is 32bits on 64bits system
    regpath = r'SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Windows\Windows Search\Preferences'
    if is64() and isdir(makepath(programfiles32, r'Microsoft Office', r'root')):
        regpath = r'SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Windows\Windows Search\Preferences'

    # Fix Windows Search ZCO registry key if needed
    # https://wiki.zimbra.com/wiki/Summary_of_the_registry_keys_that_ZCO_uses
    # https://forums.zimbra.org/viewtopic.php?t=67734
    for key in [r'{D00FDE68-3E80-4f8c-899D-D9DD16BA7D1D}', r'{FA9628A0-F223-4d5d-B314-E01BC8100572}']:
        if registry_readstring(HKEY_LOCAL_MACHINE, regpath, key) != "1":
                print(r'Fixing Windows Search ZCO registry key %s...' % key)
                registry_set(HKEY_LOCAL_MACHINE, regpath, key, 1, REG_DWORD)
                audit_result = "WARNING"

    return audit_result
    
def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    url = 'https://www.zimbra.com/product/addons/zimbra-connector-for-outlook-download/'

    # Getting latest version from official sources
    print('URL used is: %s' % url)
    for arch in 'x86', 'x64':
        print('Processing %s version...' % arch)
        for bs_search in bs_find_all(url, 'a', 'rel', 'noopener', proxies=proxies):
            if '_%s.msi' % arch in bs_search.get('href', ''):
                download_url = bs_search['href']
                latest_bin = download_url.split('/')[-1]
                version = latest_bin.split('_')[1]
                break
        print('Latest %s %s version is: %s' % (control.name, arch, version))
        print('Download URL for %s is: %s' % (arch, download_url))

        # Downloading latest binaries
        print('Downloading: %s' % latest_bin)
        latest_bin = '%s_%s' % (latest_bin.split('_')[0], latest_bin.split('_')[2])
        wget(download_url, latest_bin, proxies=proxies)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if Version(version_from_file, 4) == Version(version, 4):
            print(f'INFO: Binary file version ({version_from_file}) corresponds to online version ({version})')
        else:
            error(f'ERROR: Binary file version ({version_from_file}) do NOT corresponds to online version ({version})')

    # Changing version of the package
    if Version(version, 4) > Version(control.get_software_version(), 4):
        print('Software version updated (from: %s to: %s)' % (control.get_software_version(), Version(version)))
        control.set_software_version(version)
        control.save_control_to_wapt()
        package_updated = True
    else:
        print('Software version up-to-date (%s)' % Version(version))

    # Validating or not update-package-sources
    return package_updated

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: March 11, 2024 - 3:21 PM
by Vincent38
Wow, great job!
I had thought about it, but too much work to do that. :D
I'll adopt it, thank you!!!

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: March 12, 2024 - 00:35
by Vincent38
Regarding the problem with the incorrect uninstall key, I received feedback from Zimbra; they confirmed the problem, a bug report has been opened, and hopefully it will be fixed in future versions of ZCO. :D

Re: |PACKAGE] ZIMBRA-ZCO 9.0.0.1941 (x64 and x86)

Published: March 12, 2024 - 3:29 PM
by bastien30
Hello,

thank you for the feedback.
It's true that if they fix it, that's all for the best.

But given their bug-fixing speed, I don't think it will happen anytime soon. :roll: