Page 1 of 1

[SOLVED] Firefox package uninstallation key error

Published: March 16, 2022 - 10:41
by Mathéo21
Good morning,


For a project during my second-year internship in computer science (BTS program),
I implemented the WAPT solution on a Windows 2016 server.

I installed a Windows 10 client with the agent and then I created my own Firefox package using an .msi file.
Once the package was created, I deployed it to the client.


The package deploys correctly on the client, but on the server, it throws an error during installation and from what I read, it's a problem due to the uninstallation key.


That's why I modified it in the package's Python code
key uninstall.PNG
key uninstall.PNG (9.93 KB) Viewed 4759 times
modify uninstall key firefox.PNG
modify key uninstall firefox.PNG (2.87 KB) Viewed 4759 times
but despite that the error is still present, I wanted to know how I can fix it.
error installing Firefox server wapt.PNG
Error installing Firefox server wapt.PNG (39.55 KB) Viewed 4759 times
Thank you for your help.

P.S.: I'm a beginner on Wapt and I'm not very good at Python.

Re: Firefox package uninstallation key error

Published: March 16, 2022 - 10:42
by Mathéo21
Package created:
creating package 2 .PNG
creating package 2 .PNG (20.31 KB) Viewed 4757 times

Re: Firefox package uninstallation key error

Published: March 16, 2022 - 2:35 PM
by dcardon
Hello Mathéo21,

what version of Wapt are you using? It seems to be version 1.8.2. For your information, Tranquil IT's support for this version ends at the end of April [1], so I recommend you look into upgrading to 2.2 Discovery.

Could you please post the complete setup.py file (in a "code" block)? It appears you haven't passed the uninstall key to the install_msi_if_needed function...

Normally, it's not necessary to pass the uninstall key if it's an MSI file, unless it's poorly constructed (which is often the case with Firefox MSI files, unfortunately...).

Regards,

Denis

[1] https://www.wapt.fr/fr/doc-2.2/wapt-enterprise.html

Re: Firefox package uninstallation key error

Published: March 16, 2022 - 3:40 PM
by Mathéo21
If the default uninstallation key in the .msi package is incorrect, then I don't know if the modification I made in setup.py is correct or not?

Here is the setup.py file for my package:

Code: Select all


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

uninstallkey = ["Mozilla Firefox (x64 fr)"]

def install():
    install_msi_if_needed('Firefox Setup 98.0.1.msi')

def uninstall():
    pass
    # put here what to do when package is removed from host
    # implicit context variables are WAPT, control, user, params, run

def session_setup():
    print('Session setup for %s' % control.asrequirement())
    # put here what to do when package is configured inside a user session
    # implicit context variables are WAPT, control, user, params

def update_package():
    pass
    # put here what to do to update package content with newer installers.
    # launched with command wapt-get update-package-sources <path-to-wapt-directory>
    # implicit context variables are WAPT, basedir, control, user, params, run
    # if attributes in control are changed, they should be explicitly saved to package file with control.save_control_to_wapt()

def audit():
    pass
    # put here code to check periodically that state is matching expectations
    # return "OK", "WARNING" or "ERROR" to report status in console.
    # all print statement are reported too
    return "OK"
    
Thank you for your help.

Re: Firefox package uninstallation key error

Published: March 16, 2022 - 4:50 PM
by dcardon
Hello Mathéo21,

According to the list-registry, the uninstall_key is: "Mozilla Firefox 98.0.1 (x64 fr)" (see uninstall_key column) and not "Mozilla Firefox (x64 fr)"

And it needs to be passed as an argument to the msi function (if the key in the msi is faulty).

Code: Select all

install_msi_if_needed('Firefox Setup 98.0.1.msi', uninstallkeylist= ["Mozilla Firefox 98.0.1 (x64 fr)",])
Sincerely,

Denis Cardon

Re: Firefox package uninstallation key error

Published: March 21, 2022 - 12:04 PM
by Mathéo21
Hello,



I've switched to WAPT Discovery version 2.2.0.11720 and when I used the code snippet you suggested last time, I got another error.




So I wanted to know what might be causing it.



Thank you for your help.

Re: Firefox package uninstallation key error

Published: March 25, 2022 - 10:40 AM
by sfonteneau
It should rather be:

Code: Select all

install_msi_if_needed('Firefox Setup 98.0.1.msi')
But as Denis said, if the MSI file is poorly designed (properties in the MSI file do not correspond to the final installation):

Code: Select all

install_msi_if_needed('Firefox Setup 98.0.1.msi', key= "Mozilla Firefox 98.0.1 (x64 fr)",min_version='98.0.1')

Re: Firefox package uninstallation key error

Published: March 25, 2022 - 4:12 PM
by dcardon
Hi Mathéo,

thanks for your post. There was a bug in the `install_msi_if_needed` function when the MSI file was corrupted (which is the case with the Firefox MSI). A fix has been implemented and will be available in the next version.

Simon's command line should work for the installation. That said, I recommend using the Firefox installer executable instead; it's less buggy.

Best regards,

Denis