Attention : support for WAPT 1.8.2 ended on June the 30th 2022.

There are known vulnerabilities in WAPT dependencies in WAPT 1.8.2 branch. Please upgrade to the latest supported version. CVE listing (non exhaustive) :
  • * python engine : python 2.7 (CVE-2020-10735, CVE-2015-20107, CVE-2022-0391, CVE-2021-23336, CVE-2021-3177, CVE-2020-27619, CVE-2020-26116, CVE-2019-20907, CVE-2020-8492, etc.)
  • * cryptography : openssl : CVE-2022-2068, CVE-2022-1292, CVE-2022-0778, CVE-2021-4160, CVE-2021-3712, CVE-2021-23841, CVE-2021-23840, CVE-2021-23839, CVE-2020-1971, CVE-2020-1968, CVE-2019-1551
  • * python dependencies : cryptography (CVE-2020-36242, CVE-2020-25659), eventlet (CVE-2021-21419), jinja2 (CVE-2020-28493), psutil (CVE-2019-18874), waitress (CVE-2022-31015), lxml (CVE-2021-4381, CVE-2021-28957, CVE-2020-27783, CVE-2018-19787), ujson (CVE-2022-31117, CVE-2022-31116, CVE-2021-45958), python-ldap (CVE-2021-46823)

Packaging advanced .exe packages

Improving the functionalities of packages

Our package Mozilla Firefox ESR is functional but it requires some improvements.

  • the package installs the software even if the software is already installed, it will overwrite older versions;

  • the package does not check whether the software version is already installed;

  • the package does not check whether the software version is already installed;

As with MSI installers, those problems are addressed using the function install_exe_if_needed.

Using install_exe_if_needed

The function is slightly the same as that used with MSI installers, with some differences:

  • the function requires to pass the silent flag as an argument;

  • the function requires to pass the uninstall key as an argument;

We make changes to the Mozilla Firefox ESR setup accordingly.

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

uninstallkey = []

def install():
    print('installing tis-firefox-esr')
    install_exe_if_needed("Firefox Setup 45.5.0esr.exe",
                          silentflags="-ms",
                          key='Mozilla Firefox 45.4.0 ESR (x64 fr)'
                          min_version="45.5.0"
                          killbefore="firefox.exe")
List of arguments available with install_exe_if_needed

Settings

Default value

Description

exe

name of the .exe file to execute.

silentflags

silent parameters to pass as arguments to the installer.

key

None

software uninstall key.

min_version

None

minimal version above which the software will update.

killbefore

[ ]

list of programs to kill before installing the package.

accept_returncodes

[0,3010]

accepted codes other than 0 and 3010 returned by the function.

timeout

300

maximum installation wait time (in seconds).

get_version

None

value passed as parameter to control the version number instead of the value returned by the installed_softwares function.

remove_old_version

False

automatically removes an older version of a software whose uninstallkey is identical

force

False

forces the installation of the software even though the same uninstallkey has been found

As a consequence, the package will have a different behavior:

  • Firefox will install only if it is not yet installed or if the installed version of Firefox is less than 45.5.0, unless the --force option is passed as argument when installing the package;

  • on installing, the running firefox.exe processes will be killed;

  • the function will add by itself the uninstall key, so leave the uninstall key argument empty;

  • when finishing the installation of the package, the function will check that the uninstall key is present on the machine and that the version of Firefox is greater than 45.5.0; if this not the case, the package will be flagged as ERROR;

Managing the de-installation of applications

Special case of a non-silent uninstaller

In that particular case, a package using install_exe_if_needed fills in the uninstall key, but the uninstall key points to a non silent uninstaller.

We have to circumvent that problem by using a function that will remove the uninstall key at the end of the installation.

:emphasize-lines: 13

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

uninstallkey = []

def install():
    print('installing tis-firefox-esr')
    install_exe_if_needed("Firefox Setup 45.5.0esr.exe",
                          silentflags="-ms",
                          key='Mozilla Firefox 45.4.0 ESR (x64 fr)',
                          min_version="45.5.0",
                          killbefore="firefox.exe")
    uninstallkey.remove('Mozilla Firefox 45.4.0 ESR (x64 fr)')

def uninstall():
    print('uninstalling tis-firefox-esr')
    run(r'"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms')