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)

Additional features

Customizing the user environment

One of the main advantages of WAPT is the silent installation and uninstallation of software, even when restricted users are connected.

The WAPT agent runs with Windows SYSTEM rights, it allow to define global settings in system context and customized settings in restricted user mode.

User settings customization relies on the session_setup function defined in WAPT library Setuphelpers.

Working principle

User mode customization operates as follows:

  • the instructions are defined in the session_setup() function of the setup.py file;

  • when the package is deployed on the machine, instructions are stored in the local database of the WAPT agent;

  • when the user connects to her computer, session_setup customizations are executed in the limit of one execution per user and per WAPT package version;

Hint

The session_setup customization will occur only once per user per package; a shortcut created in that context is created only once and not at every startup. To execute a task at each startup, it is preferable to define a Windows scheduled task to be launched by a local GPO or by a startup script.

Example: create a personalized desktop shortcut

One of the possibilities offered by Setuphelpers is adding personalized shortcuts on user desktops, instead of a desktop shortcut common to all users.

For that purpose, we will use the create_user_desktop_shortcut() function to create shortcuts containing the username and passing a website as an argument to Firefox.

# -*- 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")

def session_setup():
  create_user_desktop_shortcut("Mozilla Firefox de %s" % get_current_user(),
                               r'C:\Program Files\Mozilla Firefox\firefox.exe',
                               arguments="-url https://tranquil.it")

Deploying a portable software with WAPT

A good example of a WAPT package is a self-contained/ portable software package:

  • create the folder for the software in C:\Program Files (x86);

  • copy the software in that folder;

  • create the shortcut to the application;

  • manage the uninstallation process for the application;

  • close the application if it’s running;

Example with ADWCleaner

  • create a group package and modify the control file to transform it to a software package;

wapt-get make-group-template tis-adwcleaner
package          : tis-adwcleaner
version          : 6.041-1
architecture     : all
section          : base
priority         : standard
maintainer       : Tranquil-IT Systems
description      : ADW Cleaner

The file C:\waptdev\tis-adwcleaner-wapt is created.

  • download and copy/ paste adwcleaner.exe binary in C:\waptdev\tis-adwcleaner-wapt directory;

  • open and make desired changes to C:\waptdev\tis-adwcleaner-wapt\setup.py installation file;

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

uninstallkey = []

targetdir = makepath(programfiles32,'adwcleaner')
exename = 'adwcleaner_6.041.exe'

def install():
  mkdirs(targetdir)
  filecopyto(exename,targetdir)
  create_programs_menu_shortcut('ADWCleaner',target=makepath(targetdir,exename))
  # control est un objet PackageEntry correspondant au paquet en cours d'installation
  register_windows_uninstall(control)

def uninstall():
  killalltasks(exename)
  remove_programs_menu_shortcut('ADWCleaner')
  if isdir(targetdir):
      remove_tree(targetdir)
  unregister_uninstall('tis-adwcleaner')