WAPT package structure

A WAPT package is a zip file containing several things:

schéma de la composition d'un paquet WAPT

Components of a WAPT software package

  • a file setup.py;
  • one or several binary files;
  • some additional optional files;
  • a control file in the WAPT folder;
  • a icon.png file in the WAPT folder;
  • a certificate.crt file in the folder WAPT;
  • a manifest.sha256 file in the folder WAPT;
  • a signature.sha256 file in the folder WAPT;
  • a wapt.psproj file in the folder WAPT;

The control file

The control file is the identity card of a package.

package           : tis-clavier-plus
version           : 10.7.2-3
architecture      : all
section           : base
priority          : optional
maintainer        : Administrateur
description       : Create keyboard shortcuts (Guillaume Ryder (http://utilfr42.free.fr))
description_fr    : Créer des raccourcis clavier (Guillaume Ryder (http://utilfr42.free.fr))
description_es    : Crear atajos de teclado (Guillaume Ryder (http://utilfr42.free.fr))
depends           :
conflicts         :
maturity          : stable
locale            : all
target_os         : windows
min_os_version    :
max_os_version    :
min_wapt_version  : 1.3.8
sources           :
installed_size    :
impacted_process  : clavier.exe
signer            : Tranquil IT
signer_fingerprint: 459934db53fd804bbb1dee79412a46b7d94b638737b03a0d73fc4907b994da5d
signature         : MLOzLiz0qCHN5fChdylnvXUZ8xNJj4rEu5FAAsDTdEtQ(...)hsduxGRJpN1wLEjGRaMLBlod/p8w==
signature_date    : 20170704-164552
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,min_os_version,max_os_version,min_wapt_version,sources,installed_size,signer,signer_fingerprint,signature_date,signed_attributes
Settings Description Example value
package Package name tis-geogebra
version``version`` Package version, can not contain more than 5 delimiters 5.0.309.0-0
architecture Processor architecture x64
section Type de paquet (host, group, base, unit) base
priority Package install priority (optional, not used as of 1.5.15) Not mandatory for the moment
maintainer Author of the package Arnold Schwarzenegger terminator@mydomain.lan
description Package description that will appear in the console and on the web interface The Graphing Calculator for Functions, Geometry, Algebra, Calculus, Statistics and 3D
description_fr Localized description of the package Calculator for graphical functions, geometry, algebra, calculus, statistics and 3D
depends Packages that must be installed before installing the package tis-java
conflicts Packages that must be uninstalled before installing the package tis-graph
maturity Maturity level (BETA, DEV, STABLE) Defines the maturity of a package
locale Langage environment for the package fr,en,es
target_os Accepted Operating System for the package windows
min_os_version Minimum version of Windows for the package to be seen by the WAPT agent 6.0
max_os_version Maximum version of Windows for the package to be seen by the WAPT agent 8.0
min_wapt_version WAPT’s minimal version for the package to work properly 1.3.8
sources Path to the SVN location of the package (source command) https://srv-svn.mydomain.lan/sources/tis-geogebra-wapt/trunk/
installed_size Minimum required free disk space to install the package 254251008
impacted_process Indicates a list of impacted processes when installing a package firefox.exe
signer CommonName (CN) of the package’s signer Tranquil IT
signer_fingerprint Fingerprint of the certificate holder’s signature 2BAFAF007C174A3B00F12E9CA1E74956
signature SHA256 hash of the package MLOzLiz0qCHN5fChdylnvXUZ8xNJj4rEu5FAAsDTdEtQ(…)hsduxGRJpN1wLEjGRaMLBlod/p8w==
signature_date Date when the package was signed 20180307-230413
signed_attributes List of package’s attributes that are signed package, version, architecture, section, priority, maintainer, description, depends, conflicts, maturity, locale, min_os_version, max_os_version, min_wapt_version, sources, installed_size, signer, signer_fingerprint, signature_date, signed_attributes

Note

If the control file contains special characters, the control file must be saved in UTF-8 (No BOM) format.

capture d'écran de Pyscripter indiquant la procédure pour changer le format de fichier en UTF-8 (No BOM)

Pyscripter - UTF-8 (No BOM)

Fields details

package

WAPT package name, without any accent, nor space, nor any special or uppercase character.

version

Preferably, always start with the packaged software version splitted by points (.) and finish with the WAPT packaging version separated by a dash (-) character.

architecture

New in version 1.5.

Defines whether the package may be installed on x64 or x32 processor equiped computers.

Note

A x64 package will be invisible for a WAPT agent installed on a x86 machine.

Allowed values:

  • x86 : le paquet est destiné uniquement aux machines avec un processeur 32bits ;
  • x64 : le paquet est destiné uniquement aux machines avec un processeur 64bits ;
  • all : le paquet est a destination des machines avec un processeur 32bits OU 64bits ;

section

Defines the package type.

Allowed values:

  • host: host package;
  • group: group package;
  • base: software package;
  • unit : paquet OU ;

priority

This option is not supported at this time. That field will be used to define package installation priority. This feature will become useful to define mandatory security updates.

This method will become useful to upgrade security related software, for example.

maintainer

Defines the WAPT package creator.

Note

To define the WAPT package creator’s email address may be useful.

description

Describes the functionality of the package that will appear in the console, on the local web interface http://127.0.0.1:8088 and in wapt-get command lines.

Hint

Adding a field description_fr or description_es allows you to internationalize the description of your package. If the language does not exist, the WAPT agent will use the default language description.

depends

Defines the packages that must be installed before, for example tis-java is a dependency for the LibreOffice package and must be installed before LibreOffice.

Several dependencies may be defined by splitting them with commas “,”.

example:

depends: tis-java,tis-firefox-esr,tis-thunderbird

conflicts

Works as the opposite of dépends.

conflicts defines package(s) that must be removed before installing a package, for example tis-firefox must be removed before the package tis-firefox-esr is installed, or OpenOffice must be removed before LibreOffice is installed.

Several conflicts may be defined by splitting them with commas “,”.

maturity

New in version 1.5.1.19.

Defines the maturity of a package.

By default, WAPT gents will see packages flagged as PROD and packages with a blanck maturity.

For a computer to see packages with different maturity levels, you will have to configure the maturities in wapt-get.ini.

maturities = PROD,DEV,PREPROD

locale

New in version 1.5.1.19.

Defines the language of the WAPT package.

A WAPT agent will see by default packages that are configured for its language environment and packages with no language specified.

For a computer to see a package in another language, you will have to configure the locales in wapt-get.ini.

locales = fr,en,es

The language filled in the field must be in ISO 639-1 format.

https://en.wikipedia.org/wiki/ISO_639-1

target_os

New in version 1.5.1.18.

Defines the Operating System for the package.

A WAPT agent will see by default packages that are configured for its operating system and packages with no operating system specified.

Le système d’exploitation indiqué dans le champ target_os du paquet doit être soit “windows” ou bien vide.

min_os_version

New in version 1.3.9.

Defines the minimal OS version number. For exemple, this attribute may be used to avoid installing on WindowsXP packages that only work on Windows7 and above.

Windows “Operating System Version” are listed below:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx

max_os_version

New in version 1.3.9.

Defines the maximal OS version number. For example, this attribute may be used to install on Windows7 more recent versions of a sotfware that are no more supported on Windows XP.

Windows “Operating System Version” are listed below:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx

min_wapt_version

New in version 1.3.8.

WAPT minimum version to install a package

Note

With functionalities in WAPT evolving, some functions that you may have used in old packages may become obsolete with newer versions of WAPT agents.

sources

Defines a SVN repository, for example: https://srv-svn.mydomain.lan/sources/tis-geogebra-wapt/trunk/

This method allows to version a package and collaboratively work on it.

Hint

Package versioning is particularly useful when several people create packages in a collaborative way. This function is also useful to trace the history of a package in a regulated environment.

installed_size

Defines the required minimum free disk space to install the package.

Example:

installed_size: 254251008

The testing of available free disk space is done on C:\Programm Files folder.

The value set in installed_size must be in bytes.

Hint

To convert storage values to bytes, visit http://bit-calculator.com/.

impacted_process

New in version 1.5.1.18.

Indicates processes that are impacted when installing a package.

Example:

impacted_process : firefox.exe,chrome.exe,iexplorer.exe

This field is used by the functions install_msi_if_needed and install_exe_if_needed if killbefore has not been filled.

impacted_process is also used when uninstalling a package. This allows to close the application if the application is running before being uninstalled.

signer

Automatically filled during package signature.

Common Name of the certificate (CN). It is typically the signer’s full name.

signer_fingerprint

Automatically filled during package signature.

Private key fingerprint of the package signer.

signature

Automatically filled during package signature.

Signature of the attributes of the package.

signature_date

Automatically filled during package signature.

Date when the attributes of the package have been signed.

signed_attributes

Automatically filled during package signature.

List of the package’s attributes that are signed

The setup.py file

import setuphelpers

That line is found at the beginning of every WAPT package:

from setuphelpers import *

The package imports all setuphelpers functions.

Setuphelpers is a WAPT library that offers many methods to more easily develop highly functional packages.

uninstallkey list

We then find:

uninstallkey = ['tisnaps2','Mozilla Firefox 45.6.0 ESR (x86 fr)']

We associate here a list of uninstall keys to the package. When a package is removed, the WAPT agent looks up the uninstallkey in the registry associated to the package. This uninstallkey will indicate to WAPT the actions to trigger to remove the software.

Even if there is no uninstallkey for a software, it’s mandatory to declare an empty uninstallkey array:

uninstallkey = []

Function install()

Then comes the setup.py function declaration.

It is the recipe of the WAPT package, the set of instructions that will be executed.

def install():
        run('"install.exe" /S')

The wapt.psproj file

Package project file wapt.psproj is found in the WAPT folder.

It’s the PyScripter project file for the WAPT package.

To edit a package with PyScripter, just open that file.

To continue edition of control and setup.py files, you would certainly re-open them.

The icon.png file

The icon.png icon file is located in the WAPT folder.

It associates an icon to the package.

That icon will appear in the local web interface of WAPT self-service (http://127.0.0.1:8088).

Hint

The icon must be a 48px per 48px PNG file.

The manifest.sha256 file

The manifest.sha256 manifest file is located in the WAPT folder.

It contains the sha256 fingerprint of every file in the WAPT package.

The control file

The signature signature file is located in the WAPT folder.

It contains the signature of the manifest.sha256 file.

On installing a package, wapt-get checks:

  • that the signature of manifest.sha256 matches the actual manifest.sha256 file (the agent will verify the public certificates in C:\Program Files\wapt\ssl\);
  • that the sha256 fingerprint of each file is identical to the fingerprint in the manifest.sha256 file;

Other files

Other files may be embedded in the WAPT package. For example:

  • an installer beside your setup.py to be called in your setup.py;
  • an answer file to pass on to the software installer;
  • a licence file;