Page 1 of 1

[Resolved] OpenBoard dependency reinstalls itself every time

Published: November 15, 2019 - 10:15 AM
by Jonattend
Good morning,
I use a "master" package with, as dependencies, about 20 packages including openboard.

If I modify my master package, the client machines update it, which is normal. But I've noticed that the openboard package is reinstalled every time, even if it's already present on the machines (unlike the others).

I also had this problem with the Anki package which I solved by specifying the uninstallation key (key='Anki') in the Anki package.

Regarding OpenBoard, I think the installation is faulty, which causes this phenomenon.

If I make a wapt-get list-registry On one client, I have this for OpenBoard:

{8CCA6AC7-BBF9-4DD2-8E70-A907E0FCA38F}}_is1OpenBoard "C:\Program Files (x86)\OpenBoard\unins000.exe"

We note that the command does not return any version number and that the UninstallKey key seems strange to me.

Using the following code:

Code: Select all

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

uninstallkey = ['{8CCA6AC7-BBF9-4DD2-8E70-A907E0FCA38F}}_is1']

def install():
    print('installing prefix-openboard')
    install_exe_if_needed("OpenBoard_Installer_1.5.3.exe",'/VERYSILENT /SUPPRESSMSGBOXES /NORESTART',key='{8CCA6AC7-BBF9-4DD2-8E70-A907E0FCA38F}}_is1')
WAPT returns the following error during installation on a client:

Code: Select all

EWaptSetupException: Fatal error : OpenBoard_Installer_1.5.3.exe has been executed and UninstallKey {8CCA6AC7-BBF9-4DD2-8E70-A907E0FCA38F}}_is1 has been found in the registry, but version in registry does not match requirements of min_version=0.0.0.0
What can I do? I think the problem is that OpenBoard doesn't have a version number...?

Thank you for your suggestions.

Re: OpenBoard dependency reinstalls itself every time

Published: November 15, 2019 - 1:08 PM
by htouvet
Indeed, the installer does not put a version number in the registry.
Therefore, it needs to be retrieved from elsewhere... in the executable file, for example, hence the `get_installed_version` function
And specify the minimum version in install_exe_if_needed

Code: Select all

def get_installed_version(e):
    ob_path = makepath(programfiles32,'OpenBoard','OpenBoard.exe')
    if isfile(ob_path):
        return get_file_properties(ob_path)['FileVersion']
    else:
        return None

def install():
    print('installing tis-openboard')
    install_exe_if_needed("OpenBoard_Installer_1.5.3.exe",'/VERYSILENT /SUPPRESSMSGBOXES /NORESTART',key='{8CCA6AC7-BBF9-4DD2-8E70-A907E0FCA38F}}_is1',min_version='1.5.3.240',get_version=get_installed_version)

Re: OpenBoard dependency reinstalls itself every time

Published: November 15, 2019 - 2:38 PM
by Jonattend
Hello,

thank you for the reply, it works!

To be sure I understand correctly and don't just copy and paste, can you confirm that the `get_version` function retrieves the version of the .exe file and returns the result?

Otherwise, even after modifying the package, ` wapt-get list-registry` still returns nothing regarding the version number. Is this normal?

Re: OpenBoard dependency reinstalls itself every time

Published: November 15, 2019 - 2:48 PM
by htouvet
Yes, you can provide the `install_exe_if_needed` function with a `get_version` parameter. This parameter should point to a function that takes a parameter (a dictionary containing the information currently in the registry) and returns the version.

By default, if this parameter isn't provided, the function uses the `version` key from the registry.

In the case of OpenBoard, this doesn't work because the installer doesn't store anything in this `version` key. So, we provide an alternative function, and in this case, I suggested retrieving the version from the OpenBoard executable's metadata.

It's normal that `list-registry` doesn't display anything additional, because we haven't modified the registry.

Re: OpenBoard dependency reinstalls itself every time

Published: November 15, 2019 - 4:14 PM
by Jonattend
I understand everything, it's perfect, ;)

thank you!!