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 session_setup() function of 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;


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",
                          key='Mozilla Firefox 45.4.0 ESR (x64 fr)'

def session_setup():
  create_user_desktop_shortcut("Mozilla Firefox de %s" % get_current_user(),
                               r'C:\Program Files\Mozilla Firefox\firefox.exe',

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\ installation file;
# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

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

def install():
  # control est un objet PackageEntry correspondant au paquet en cours d'installation

def uninstall():
  if isdir(targetdir):