Using WAPT with the Command Line

The WAPT Agent provides a command line interface utility wapt-get.

The Windows Command Line utility

The Windows Command Line utility

Note

  • By default, command-line actions in WAPT are executed with the rights of the user who launched the cmd.exe.

  • If the cmd.exe has not been launched with Local Administrator privileges, the command will be passed on to the waptservice.

  • For security reasons, some actions will require a login and a password.

  • Only Local Administrators and members of the waptselfservice Active Directory security group are allowed.

  • To force using the WAPT service as a Local Administrator, simply add -S after wapt-get.exe.

Note

Each commands that take a package name as a parameter can also take the unique package_uuid of the package as a parameter (wapt-get install, wapt-get forget, etc.). Using a GUID allows to specify a unique package without ambiguity on its architecture or version. The package_uuid is listed in the output of wapt-get list and wapt-get search. For example:

Using the more common functions in WAPT with the command line

wapt-get install

The wapt-get install command launches the installation of a WAPT package.

To install Mozilla Firefox, the command is wapt-get install tis-firefox.

Note

If the package has not been downloaded to cache, wapt-get install will first download the package to cache, then it will install it.

Attention

Installing a WAPT package with install does not add the package as a dependency to the host.

The package is installed on the host, but if the computer is re-imaged, the package will not be reinstalled automatically.

The command wapt-get install tis-firefox returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
installing WAPT packages tis-firefox
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 14121562 / 54313787 (26%) (24624 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 33131357 / 54313787 (61%) (29414 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 50511741 / 54313787 (93%) (30412 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 54313787 / 54313787 (100%) (30360 KB/s)
Installing tis-firefox(=94.0.1-106)
Installing: Firefox_Setup_94.0.1.exe
Waiting for key key Mozilla Firefox 94.0.1 (x64 en-US) to appear in Windows registry
Delete C:\Program Files (x86)\wapt\cache\tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt

Results:

=== install packages ===
  tis-firefox [x64_en_PROD]     | tis-firefox (94.0.1-106)                   | tis-firefox (50.0.2-73)

wapt-get update

The wapt-get update command allow to update the list of available packages.

The local WAPT Agent will download Packages file from the private repository and compare it to its local database.

  • If new updates are available, the WAPT Agent switches the packages status to TO-UPGRADE.

  • If new software have been added on the repository, they become downloadable by the WAPT Agent.

Note

The wapt-get update command does not download packages, it only updates the local database of packages.

The command wapt-get update returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Update package list from https://srvwapt.mydomain.lan/wapt, https://srvwapt.mydomain.lan/wapt-host
Total packages : 8
Added packages :

Removed packages :

Discarded packages count : 6
Pending operations :
  install:
  upgrade:
  additional:
  remove:
  immediate_installs:
Repositories URL :
  https://srvwapt.mydomain.lan/wapt
  https://srvwapt.mydomain.lan/wapt-host

wapt-get upgrade

The command wapt-get upgrade allows to launch the installation of packages waiting to be upgraded or waiting to be installed.

The local WAPT Agent downloads if necessary WAPT packages in its local cache then installs them.

Hint

It is strongly advised to launch a wapt-get update command before launching a wapt-get upgrade command.

Without previously launching a wapt-get update, the WAPT Agent will install nothing.

The command wapt-get upgrade returns:

Installing tis-mumble
Shutting down Mumble
installing Mumble 1.2.3

=== install packages ===
tis-mumble

wapt-get remove

The remove <package name> command removes a package.

The command takes the package name with the repository prefix as argument.

To remove Mozilla Firefox, the command is wapt-get remove <prefix>-firefox.

Attention

Removing a WAPT package with wapt-get remove does not remove the package dependency on the host.

The package will effectively be uninstalled from the host, but it will automatically be reinstalled on the next upgrade.

To completely remove a package from a host, do a wapt-get remove for the targeted package, then edit the host configuration via the WAPT Console to remove the package dependency on the host.

The command wapt-get remove tis-firefox returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Removing tis-firefox ...

Waiting for the removal of key key Mozilla Firefox 94.0.1 (x64 en-US) from Windows registry
=== Removed packages ===
  tis-firefox

wapt-get uninstall

The wapt-get uninstall <package name> command run the uninstall package function if exist.

The command takes on argument. That argument is the name package or a list of package names with the repository prefix.

Attention

Run the uninstall package function doesn’t remove the package on the host.

The command wapt-get uninstall tis-adwcleaner returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
 Uninstalling tis-adwcleaner ...
 None
 Uninstallation done

wapt-get forget

The wapt-get forget <package name> command install status for package from local database.

The command takes on argument. That argument is the name package or a list of package names with the repository prefix.

Attention

Forgetting the package doesn’t uninstall the package.

The command wapt-get forget tis-adwcleaner returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini

=== Packages removed from status ===
  tis-adwcleaner

wapt-get audit

The wapt-get audit [<package name>] command run the audit function.

The command takes on argument. That argument is the name package or a list of package names with the repository prefix.

If the argument is defined, the wapt-get audit [<package name>] command runs the package audit function.

Also, the wapt-get audit command runs the audit function for all packages installed on the host.

The command wapt-get uninstall tis-firefox returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Auditing tis-firefox ...
Auditing tis-firefox
OK: Uninstall Key Mozilla Firefox 94.0.1 (x64 en-US) in Windows Registry.
tis-firefox -> OK

wapt-get show

The wapt-get show <package name> command displays informations stored in the Packages index file.

If several versions of a WAPT package are available on the WAPT repository, every version of the package will be displayed.

The command wapt-get show tis-7zip returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Display package control data for tis-7zip

package           : tis-7zip
version           : 19.00-25
architecture      : x64
section           : base
priority          : optional
name              : 7-Zip
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : 7-Zip is a free and open-source file archiver with a high compression ratio
depends           :
conflicts         :
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 1.7
sources           : https://www.7-zip.org/download.html
installed_size    :
impacted_process  : 7zFM,7z,7zG
description_fr    : 7-Zip est un logiciel gratuit et open source pour archiver des fichiers avec un taux de compression élevé
description_pl    :
description_de    : 7-Zip ist ein Datenkompressionsprogramm mit einer hohen Kompressionsrate
description_es    : 7-Zip es un archivador de ficheros con una alta relación de compresión
description_pt    : O 7-Zip é um compactador de arquivos com alta taxa de compressão
description_it    :
description_nl    :
description_ru    : 7-Zip свободный файловый архиватор с высокой степенью сжатия данных
audit_schedule    :
editor            : Igor Pavlov
keywords          : 7zip,7,zip,7-zip,file,archiver,high,compression,ratio
licence           : LGPL
homepage          : https://www.7-zip.org/
package_uuid      : dc66ccd1-d987-482e-b792-04e89a3803f7
valid_from        :
valid_until       :
forced_install_on :
changelog         : https://www.7-zip.org/history.txt
min_os_version    : 5.0
max_os_version    :
icon_sha256sum    : eddc038d3625902b6ddeaabd13dd91529e8d457ffbd0c554f96d343ae243a67a
signer            : documentation
signer_fingerprint: 3f2c0a02231a36eafa1f67905f5c083e4b66cb59942f69cbd231d778a1a25b3d
signature         : QzhPeZFrRbjcGzfqRpoWsDP9Plaz6BBVlL3adq/MRM19D61+Aez/JiA8skriCgwSErJXbxOPfxusVqqIpEtyoqh/RlRcnmgCQqk2Fig4gmxpz0rHKokukPQlRk+HdC/uByxSjfp9oXuB3PVG2PZAFifjVBtjEX2QmV+OY6NdMI9dtkxCsn1Xotn2qhu2bwbJWQ0s51rD9emWuQR7l/8WXl+HoquuRho4aCeAOYd6Nta9ktVSR2FM6OO5ZeUOg4fsnMg+hwp2MlDOmBHX37aJm3hLYkGP2xWjpL9YDDxI7ruRXSHyT7YmbILrS0h1m3PTOiV8jy1hTLDgKVeptPWVgA==
signature_date    : 2021-11-19T16:15:42.019196
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
filename          : tis-7zip_19.00-25_x64_windows_0f4137ed1502b5045d6083aa258b5c42_5.0_PROD_a10c57d7848cf7b145d6cd64bf4d5389.wapt
size              : 1704227
md5sum            : a10c57d7848cf7b145d6cd64bf4d5389

OK Package control signature checked properly by certificate documentation (fingerprint: 3f2c0a02231a36eafa1f67905f5c083e4b66cb59942f69cbd231d778a1a25b3d )

Note

A warning message may display with this command, for example:

WARNING: control data signature can not be validated with certificates [<SSLCertificate cn='documentation' fingerprint=3f2c0a  issuer='documentation' validity=2021-11-19 - 2031-11-17 Code-Signing=True CA=True>]

This is normal if your certificate is not trusted. Only control file is available for wapt-get show not all package. .. CLARIFY ABOVE

If you want to check the package, download it to cache and run the wapt-get show on the local package.

For example:

wapt-get download tis-7zip
wapt-get show "C:\Program Files (x86)\wapt\cache\tis-7zip_19.00-25_x64_windows_0f4137ed1502b5045d6083aa258b5c42_5.0_PROD_a10c57d7848cf7b145d6cd64bf4d5389.wapt"

wapt-get show-params

The wapt-get show-params <package name> command return lists of parameters that would be passed to the wapt-get install <package name> --params=PARAMS command.

The command takes on argument. That argument is the name package or a list of package names with the repository prefix.

The command wapt-get show tis-7zip returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
tis-7zip : {True, 'documentation': True}

wapt-get show-log

The wapt-get show-log <package name> command return the latest audit logs stored in the agent’s local sqlite database.

The command takes on argument. That argument is the name package or a list of package names with the repository prefix.

The command wapt-get show tis-7zip returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Package: tis-7zip (21.06-34) PROD
-------------------
Status: OK

Installation log:
-------------------
Installing: 7z2106-x64.msi
Waiting for key key {23170F69-40C1-2702-2106-000001000000} to appear in Windows registry


Installation Parameters:
-------------------
{}

Last audit:
-------------------
Status: OK
Date: 2022-01-06T10:32:38.698272

Output:
Auditing tis-7zip
OK: Uninstall Key {23170F69-40C1-2702-2106-000001000000} in Windows Registry.


Next audit on: 2022-01-06T10:32:38.698272

wapt-get download

The wapt-get download <package name> command downloads the WAPT package to the local cache located at C:\Program Files\wapt\cache.

The command wapt-get download tis-7zip returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Downloading packages tis-7zip(=19.00-25)
https://srvwapt.mydomain.lan/wapt/tis-7zip_19.00-25_x64_windows_0f4137ed1502b5045d6083aa258b5c42_5.0_PROD_a10c57d7848cf7b145d6cd64bf4d5389.wapt : 1704227 / 1704227 (100%) (11804 KB/s)

Downloaded packages:
  C:\Program Files (x86)\wapt\cache\tis-7zip_19.00-25_x64_windows_0f4137ed1502b5045d6083aa258b5c42_5.0_PROD_a10c57d7848cf7b145d6cd64bf4d5389.wapt

wapt-get download-upgrade

The wapt-get download-upgrade command downloads packages to be upgraded to the local WAPT cache C:\Program Files (x86)\wapt\cache.

The command wapt-get download-upgrade returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 18466658 / 54313787 (34%) (32089 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 36390179 / 54313787 (67%) (32693 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 52684289 / 54313787 (97%) (31564 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 54313787 / 54313787 (100%) (30747 KB/s)

=== downloaded packages ===
  C:\Program Files (x86)\wapt\cache\B8D346E7-DDDB-0013-5A8A-425CF3B6199E.wapt
  C:\Program Files (x86)\wapt\cache\tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt

wapt-get list

The wapt-get list command lists WAPT packages that are installed on the computer.

The command wapt-get list returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
package                              version    install_status install_date     description                                                                      package_uuid
------------------------------------ ---------- ---------- ---------------- -------------------------------------------------------------------------------- ------------------------------------
tis-7zip                            21.06-34   OK         2021-12-10T14:57 7-Zip is a free and open-source file archiver with a high compression ratio      717a30cc-0d44-42d1-9538-0f2f298d8603
tis-firefox                         94.0.1-106 OK         2021-12-10T14:58 Mozilla Firefox is a free and open-source web browser                            5a91f54a-3e27-44cf-a2b6-6b84012aa3a2

package

version

install status

install_date

description

package_uuid

Package Name

Package Version

Installation status

Date and time of installation

Package description

Unique UUID of the package

wapt-get list-upgrade

The wapt-get list-upgrade command lists WAPT packages that are need to be upgraded on the host.

The command wapt-get list-upgrade returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini

=== upgrade packages ===
tis-notepadplusplus(=8.2-10)

wapt-get -S tasks

The wapt-get -S tasks command check if some tasks are running or pending in queue.

The command wapt-get -S tasks returns:

About to speak to waptservice...
Running task 14: Uninstall of tis-vlc (task #14), status:

Using special Command Lines with WAPT

wapt-get clean

The wapt-get clean command removes packages from the C:\Program Files (x86)\wapt\cache folder.

The command is launched after each upgrade to save disk space.

The command wapt-get clean returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Removed files:
C:\Program Files (x86)\wapt\cache\tis-mumble_1.2.3-1_all.wapt
C:\Program Files (x86)\\wapt\cache\tis-vlc_1.2.3-2_all.wapt

wapt-get upgradedb

The wapt-get upgradedb command upgrades the local WAPT database schema if necessary.

The command wapt-get upgradedb returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
WARNING upgrade db aborted: current structure version 20210420 is newer or equal to requested structure version 20210420
No database upgrade required, current 20210420, required 20210420

wapt-get add-upgrade-shutdown - wapt-get remove-upgrade-shutdown

These 2 commands modify this file : C:WindowsSystem32GroupPolicyMachineScriptsscripts.ini.

  • The wapt-get add-upgrade-shutdown command adds a waptexit local security policy object, enabling the execution of waptexit at system shutdown.

The command wapt-get add-upgrade-shutdown returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
0

The scripts.ini contains:

[Shutdown]
0CmdLine = C:\Program Files (x86)\wapt\waptexit.exe
0Parameters =
  • The wapt-get remove-upgrade-shutdown command removes the waptexit local security policy object, disabling the execution of waptexit during system shutdown.

The command wapt-get add-upgrade-shutdown returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
0

The scripts.ini contains:

[Shutdown]

wapt-get register

The wapt-get register <description> command reports the computer hardware and software inventory to the WAPT inventory Server.

Hint

You can pass a description as an argument to the wapt-get register, that description will be displayed in the WAPT Console in the column description.

You may benefit from WAPT to improve your IT management by affecting a username or a computer serial as descriptions for your hosts.

Note

If the host is already registered, the new execution with a description updates the registered information.

It is not necessary to define a description to register the host with the command line.

The command wapt-get register "John Doe PC" returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Registering host against server: https://srvwapt.mydomain.lan
Host correctly registered against server https://srvwapt.mydomain.lan.wapt-get inventory

wapt-get unregister

The wapt-get unregister command remove the computer hardware and software inventory to the WAPT inventory server.

The command wapt-get unregister returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Unregistering host from server: https://srvwapt.mydomain.lan
Please get login for api/v3/hosts_delete:admin
Password:
Host correctly unregistered against server https://srvwapt.mydomain.lan.

wapt-get inventory

The wapt-get inventory command displays all local inventory information in JSON format.

The command wapt-get inventory returns (in part):

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
{
  "host_info": {
    "description": "John Doe PC",
    "system_manufacturer": "Xen",
    "system_productname": "HVM domU",
    "computer_name": "Documentation",
    "computer_fqdn": "Documentation.srvwapt.mydomain.lan",
    "dnsdomain": "mydomain.lan",
    "workgroup_name": "Documentation",
    "domain_name": null,
    "domain_controller": null,
    "domain_controller_address": null,
    "domain_info_source": "history",
    "networking": [
    {
      "iface": "{085AB96368A-05A3B96-43EC-B773-0C0BB96794D9}",
      "mac": "a2:1d:6e:fc:8d:e6",
      "addr": [
      {
        "addr": "192.168.0.1",
        "netmask": "255.255.255.0",
        "broadcast": "192.168.0.255",
        "connected": true
      },
      {
        "addr": "fe80::2437:567f:79c8:f964",
        "netmask": "ffff:ffff:ffff:ffff::/64",
        "broadcast": "fe80::ffff:ffff:ffff:ffff%3",
        "connected": true
      }
      ]
    }
    ],
    "gateways": [
    "192.168.0.254"
    ],
    "dns_servers": [
    "192.168.0.11"
    ],
    "connected_ips": [
    "192.168.0.1",
    "fe80::2437:567f:79c8:f964"
    ],
    "mac": [
    "a2:fc:1d:6e:8d:e6"
    ],
...

wapt-get update-status

The command wapt-get update-status resends local status to the WAPT inventory Server.

Note

If a hardware component has changed on the computer, wapt-get update-status would not report that information back to the WAPT inventory Server.

To do so, the command to use is wapt-get inventory.

The command wapt-get update-status returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Updated host status correctly sent to the WAPT Server https://srvwapt.mydomain.lan. {'success': True, 'msg': 'update_host', 'result': {'uuid': 'B8D346E7-DDDB-0013-5A8A-425CF3B6199E', 'computer_fqdn': 'documentation.mydomain.lan', 'status_hashes': {'dmi': '124b8bcef5b690afea7cf8001351a22132885123', 'wmi': 'ae5dbb5627b7b3a5a31d5914a9dbf48b85b133da', 'host_info': 'e737a82da15fbe9cae88ba9b4a9662a73657d959', 'audit_data': None, 'wapt_status': 'bcb76ad07cf1b6f814082ec5a58c4fee0364a640', 'audit_status': 'c34adb535c711b59d4408f00f77b7392687d7e56', 'host_metrics': '9fc68bd98c82e0e9bece0ce3afaeeb63a3ed1db1', 'waptwua_status': '4f9dcf0af339ce28d7354283fd4e6bdaf17b85c8', 'waptwua_updates': 'c5cf38908fc549f499ade5b17ce221ff0ced377f', 'wuauserv_status': '7c30215c3c34566e5b0c69c9e1dbfe3e6117b837', 'host_capabilities': 'c31286122a213f3bb313531541582bb2ba1d0a81', 'installed_packages': '3279f3bf4d5ed5086b198fa94a6a6f422f519ab3', 'last_update_status': '347c5a8c01e182f1e03e5c9d0fe07dd87ab79153', 'installed_softwares': 'd582a6f7325af35eae17cb7ecdca59ef0d137dda', 'authorized_certificates': '2974f9535f813fc454b735193c31828b132a6ba0', 'waptwua_updates_localstatus': 'c5cf38908fc549f499ade5b17ce221ff0ced377f'}, 'server_uuid': '82295c4d-4944-11ec-bac6-a25b5d7da3d5'}, 'request_time': 0.046843767166137695}

wapt-get setlocalpassword

The wapt-get setlocalpassword command allows to define a local password for WAPT package installations.

The command wapt-get setlocalpassword returns:

Local password:
Confirm password:
Local auth password set successfully

wapt-get reset-uuid

The wapt-get reset-uuid command retrieves the host’s UUID from BIOS and resends it to the WAPT inventory Server.

The command wapt-get reset-uuid returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
New UUID: B0F23D44-86CB-CEFE-A8D6-FB8E3343FE7F

wapt-get generate-uuid

The wapt-get generate-uuid command creates a new host UUID and resends it to the WAPT inventory Server.

The wapt-get generate-uuid is useful if you have bios UUID bugs on your hosts.

The command wapt-get generate-uuid returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
New UUID: RND-0279A1F4-BBBE-43AE-A591-F82652E0104B

Note

All randomly generated UUID put an RND- in front of.

wapt-get get-server-certificate

The wapt-get get-server-certificate command downloads the SSL certificate from the WAPT Server to use HTTPS to communicate with the WAPT Server.

The downloaded certificate is stored in C:\Program Files(x86)\waptssl\server.

The command wapt-get get-server-certificate returns:

Server certificate written to C:\Program Files (x86)\wapt\ssl\server\srvwapt.mydomain.lan.crt

wapt-get enable-check-certificate

The wapt-get enable-check-certificate command downloads the SSL certificate from the WAPT Server and enables secured communication with the WAPT Server.

The wapt-get enable-check-certificate command is used for activating the verification of the SSL / TLS certificate.

The command wapt-get enable-check-certificate returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Server certificate : C:\Program Files (x86)\wapt\ssl\server\template-auto.test.lan.crt
Certificate CN: template-auto.test.lan
Pining certificate C:\Program Files (x86)\wapt\ssl\server\template-auto.test.lan.crt

wapt-get check-upgrades

The wapt-get check-upgrades command show last updates/upgrade status on the host.

The command wapt-get check-upgrades returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
{
  "running_tasks": [],
  "errors": [],
  "date": "2022-01-06T14:09:26.554391",
  "upgrades": [
    "tis-notepadplusplus(=8.2-10)"
  ],
  "pending": {
    "install": [],
    "upgrade": [
    "tis-notepadplusplus(=8.2-10)"
    ],
    "additional": [],
    "remove": [],
    "immediate_installs": []
  }
}

wapt-get add-licence

The wapt-get add-licence command add the licence on the server.

The command wapt-get add-licence returns:

Using config file C:\Program Files (x86)\wapt\wapt-get.ini
Server: https://srvwapt.mydomain.lan
Server UUID: 82295c4d-4944-11ec-bac6-a25b5d7da3d5
Server CABundle: 0

{"licence_nr":"6f011e23-cb70-40a4-b340-0d18ae1e2f02","product":"WAPT Enterprise","features":["full"],"licenced_to":"documentation","domain":"","contact_email":"documentation@tranquil.it","count":"10","valid_from":"2021-06-14T00:00:0","valid_until":"2022-01-12T00:00:0","renewal_url":null,"signed_attributes":["licence_nr","product","features","licenced_to","domain","contact_email","count","valid_from","valid_until","renewal_url","signed_attributes","signer","signature_date","signer_certificate","server_uuid"],"signer":"","signature_date":"2022-01-13T16:38:56","signer_certificate":"-----BEGIN CERTIFICATE-----\nMIIEIjCCAwqgAwIBAgIUIOMdx8FmRdmCNTHxOfKecSp/cAAwDQYJKoZIhvcNAQEL\nBQAwgZcxCzAJBgNVBAYTAkZSMSIwIAYDVQQHDBlTYWludCBTZWJhc3RpZW4gc3Vy\nIExvaXJlMRwwGgYDVQQKDBNUcmFucXVpbCBJVCBTeXN0ZW1zMSAwHgYDVQQDDBdy\nZWxpY2VuY2luZy50cmFucXVpbC5pdDEkMCIGCSqGSIb3DQEJARYVdGVjaG5pcXVl\nQHRyYW5xdWlsLml0MB4XDTIxMDYwODE0MTQ0MVoXDTMxMDYwNjE0MTQ0MVowgZcx\nCzAJBgNVBAYpk6dZrIrw9Kb5hee+1EgqEbudCBTZWJhc3RpZW4gc3VyIExvaXJl\nMRwwGgYDVQQKDBNUcmFucXVpbCBJVCBTeXN0ZW1zMSAwHgYDVQQDDBdyZWxpY2Vu\nY2luZy50cmFucXVpbC5pdDEkMCIGCSqGSIb3DQEJARYVdGVjaG5pcXVlQHRyYW5x\ndWlsLml0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzT43W8OhWXAe\nhDB+IWwQm9IGGdR0VY/klKcSheo/8jGlNziyH6BANhjFKYNX9UtQ+ghzv6BGfSTH\nyua1aXEQM89sSKFOoJztoD1L9FZtuWQb/vfLWkisP8fRPvH4B/tYG+5nchGa6+6r\nqGSGSpWcnj6CovgQR01ATUuHN3NV1N7q48hBT/ZT9R5U3sEi+hNK4eRIeZ220Pzm\nDoNGkVKlEiczgXuM77ezYp8UWvpk6dZrIrw9Kb5hee+1EgqEbgVmdARoaOPGTK8h\n8VW+milWsl4TEY19kxXWvva+M6wX00ipJ2LxEiu5+dlOok9E8i405UTNE7oSVYsF\n90/6S3C4twIDAQABo2QwYjAPBgNVHRMBAf8EBTADAQH/MCAGA1UdJQEB/wQWMBQG\nCCsGAQUFBwMDBggrBgEFBQcDAjAdBgNVHQ4EFgQUpRT6Co2uoWZMCwP7FKiF73+j\nfAEwDgYDVR0PAQH/BAQDAgHWMA0GCSqGSIb3DQEBCwUAA4IBAQAdXX5IkpuH/Gek\nPPHC4KvE/6GsU0kqLI1w5ML5pbF1zyCCL0nm4f8w2JJIJ2Ycdb4QVD27kJqgZcH1\nniYQ3RCIh6aasS8qpCOf90KkpvKMJiyk/ra7I6NSgPut4ErkoxUWocgF6SNFEjwB\naqUZY//Hkoqk2dXqdujLVGJfBpX95ZJ9PmFNLfsyUsvu1WcFMb0En0EUO74Mq4M3\nKo2S86G9pEDKooaN5Vq19biReOwQYpX1YlSLtrxFx8AM87auQgaD8EWSdA1q2ycN\n8ZnmXGxAhDv8hmE2Fv0x0t3hzYXxxcv1ZjYWRHlMUl/buWQQ35u9MFkjh7YZlTlM\nb9wjtN+W\n-----END CERTIFICATE-----\n","signature":"J7DZ+mja7zGghYFCDKh8WIxzzdhKPeoNswWjnKZziT+ddpoRdg45kZz4E8PxMIUzhTI8WIxzzdhKPeoNswrICpQ8t5kepzovZpoONwjgOQ5PoCAgDOE3NV+larFrMdkAjCpx4tV86n5gyXHJnlnH1OXCpKUBiIiP/de18bEgSSlgjXgE/wr2ZfclsRsRRfsRbGSterRKQcthNDrFlf8RjH5cpDnDvMJ+qJtTsqxA13/WT2NS2uNWZI93si/9mowWY8MdT/PZjosciCqijbq4oa+/FrPsALhUOtcGE9JylwknszUD5Ayfh+9sNLLxsG6eT0JlnNgf4nx9mXAu4GBg==","server_uuid":"82295c4d-4944-11ec-bac6-a25b5d7da3d5"}
Login to server api/v3/licences
Waptserver https://srvwapt.mydomain.lan Admin User () :admin
Waptserver Password: ************
Licence properly activated on server

wapt-get check-licences

The wapt-get check-licences command shows the licences registered on the server.

The command wapt-get check-licences returns:

Using config file C:\Program Files (x86)\wapt\wapt-get.ini
Server: https://srvwapt.mydomain.lan
Server UUID: 36bf01bc-c8f5-11eb-bf04-36127be97253
Server CABundle: 0

Total licences count: 10
Licenced to: documentation

Valid Nr:b7b6e537-3cb7-4d9a-3cb7-2448020e2e51 Count:10 From:2022-01-13T00:00:0 Expire:2023-01-12T23:59:0 Server:36bf01bc-c8f5-11eb-bf04-36127be97253 Licencee:documentation

wapt-get dnsdebug

The wapt-get dnsdebug command shows the local dns informations.

The command wapt-get dnsdebug returns:

DNS Server : dns.mydomain.lan
DNS Domain : mydomain.lan
Main repo url: https://srvwapt.mydomain.lan/wapt
wapt SRV: []
waptserver SRV: []
CNAME: []

Using the Command Line for user session setup

wapt-get session-setup

The wapt-get session-setup command launches user level customizations of installed WAPT packages.

The wapt-get session-setup command runs the session-setup function in the setup.py file.

Note

The argument ALL will launch wapt-get session-setup for all installed WAPT packages.

The command wapt-get session-setup ALL returns:

Configuring tis-7zip ... No session-setup. Done
Configuring tis-ccleaner ... Already installed. Done
Configuring tis-vlc ... No session-setup. Done
Configuring mdl-tightvnc ... No session-setup. Done
Configuring tis-brackets ... No session-setup. Done
Configuring mdl-firefox-esr ... No session-setup. Done
Configuring tis-paint.net ... No session-setup. Done

Using the Command Line to create WAPT packages

wapt-get list-registry

The wapt-get list-registry <keyword> command lookups a keyword in software installed on the computer.

The command can take an argument, not case sensitive, to search for a specific word: wapt-get list-registry <keyword>.

The informations returned is:

Information

Definition

Available on Windows

Available on Linux

Available on Mac OS

UninstallKey

Uninstall key indentifier in the registry

feature available

feature not available

feature not available

Software

Name of the software in the registry

feature available

feature available

feature available

Version

Version of the software in the registry

feature available

feature available

feature available

Uninstallstring

Uninstall string of the software in the registry

feature available

feature not available

feature not available

Note

  • On Windows, this informations is collected by WAPT from the registry in two localisation :

    • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

  • On Linux, this informations is collected by WAPT in Applications

  • On Mac OS, this informations is collected by WAPT in /var/lib/dpkg/info/

The command wapt-get list-registry firefox returns (on Windows):

The output of wapt-get list-registry is a table listing uninstall keys for each software corresponding to the search term.

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
UninstallKey                           Software                               Version             Uninstallstring
---------------------------------------------------------------------------------------------------------------------------------------------------------
Mozilla Firefox 45.5.0 ESR (x64 fr)    Mozilla Firefox 45.5.0 ESR (x64 fr)    45.5.0              "C:\Program Files\Mozilla Firefox\uninstall\helper.exe"

wapt-get sources

The wapt-get sources <package name> command downloads sources from a source code management platform like Git or SVN.

The command wapt-get sources tis-firefox returns nothing;

wapt-get make-template

Warning

This method is deprecated, instead use the WAPT Console to create a package template.

The wapt-get make-template <installer-path> [<packagename> [<source directoryname>]] command allows to create a package template from a MSI or an EXE installer.

Use this arguments:

Argument

Definition

Default value

installer-path

Installer path of the binary

Not default value, it’s necessary

packagename

Name of package

If it is not defined, the package name is created like prefix-binary-name_package-version-wapt

source directoryname

Directory to save the source files

If not defined, it’s the value of default_sources_root in waptconsole.ini

The command wapt-get make-template C:\\Users\\User\\Downloads\\tightvnc.msi tis-tightvnc returns:

Using config file: C:\Users\Documentation\AppData\Local\waptconsole\waptconsole.ini
Template created. You can build the WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-package C:\waptdev\tis-tightvnc-wapt
You can build and upload the WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-upload C:\waptdev\tis-tightvnc-wapt

Hint

  • If you have previously installed tis-waptdev package on your development computer, PyScripter editor will launch automatically and open the package in development mode.

wapt-get make-host-template

Warning

This method is mainly for scripting, usually the host package are automatically created with the WAPT Console.

The wapt-get make-host-template <hostname> [[<package>,<package>,...] [directory]] command creates an empty WAPT host package from a template.

Use this arguments:

Argument

Definition

Default value

hostname

Name of host use for package name

If none is given, use the FQDN

package

List of packages needed on the host.

If it is not define, no packages are added as dependencies

directory

Directory to save the source files

If it is not define, it is C:\waptdev

The command wapt-get make-host-template host01.mydomain.lan returns:

Using config file: C:\Users\Documentation\AppData\Local\waptconsole\waptconsole.ini
Template created. You can build the WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-package C:\waptdev\host01.mydomain.lan-wapt
You can build and upload the WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-upload C:\waptdev\host01.mydomain.lan-wapt

wapt-get make-group-template

Warning

This method is to be used only if you cannot use the console to create a package.

The wapt-get make-group-template <name of group> command creates an empty WAPT group package from a template.

The command wapt-get make-group-template accounting returns:

Template created. You can build the WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-package C:\waptdev\accounting-wapt
You can build and upload the WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-upload C:\waptdev\accounting-wapt

wapt-get build-package

The wapt-get build-package <path to the package> command builds a WAPT package and signs it with the private key of the Administrator.

Note

The path to the private key, the default prefix and the default development path MUST be properly set in the wapt-get.ini file.

The command wapt-get build-package c:\waptdev\tis-dropbox returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
Building packages 1 packages
Personal certificate is documentation
Please type the password to decrypt the private key C:\Users\documentation\private\documentation.pem
Password:
Private key is <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'>
Personal certificate is SSLCertificate cn=documentation
Private key is <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'>
Building  c:\waptdev\tis-dropbox
Signing c:\waptdev\tis-dropbox with key <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'> and certificate documentation (C:\Users\documentation\private\documentation.crt)
Package c:\waptdev\tis-dropbox signed : signature : BN7j6lwloY...Iu9QVulA=
...done building. Package filename c:\waptdev\tis-dropbox_104.4.175-7_windows_0f4137ed1502b5045d6083aa258b5c42_5.1_PROD.wapt
1 packages successfully built
0 packages failed

You can upload to repository with
  C:\Program Files (x86)\wapt\wapt-get.exe upload-package "c:\waptdev\tis-dropbox_104.4.175-7_windows_0f4137ed1502b5045d6083aa258b5c42_5.1_PROD.wapt"

Warning

The directory name doens’t define the package name and prefix, it’s defined by the control file.

wapt-get sign-package

The wapt-get sign-package <path to the package> command signs a package with the private key of the Administrator.

Attention

sign-package does not rename the WAPT package with the chosen prefix of the Organization.

The command wapt-get sign-package C:\waptdev\smp-7zip_16.4.0.0-1_all.wapt returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
Signing packages c:\waptdev\tis-dropbox
Personal certificate is SSLCertificate cn=documentation
Please type the password to decrypt the private key C:\Users\documentation\private\documentation.pem
Password:
Private key is <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'>
Signing c:\waptdev\tis-dropbox
  OK: Package c:\waptdev\tis-dropbox signed : signature : b'nJYfYswDWi'...b'v790D7uA='

wapt-get build-upload

The wapt-get build-upload <path to the package> command builds and uploads a WAPT package onto the main WAPT repository.

Hint

By passing the -i argument to build-upload, the WAPT packaging version number is incremented before upload, so to avoid having to modify manually the control file.

The command wapt-get -i build-upload C:\waptdev\tis-tightvnc-wapt returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
Building packages 1 packages
Personal certificate is documentation
Please type the password to decrypt the private key C:\Users\documentation\private\documentation.pem
Password:
Private key is <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'>
Personal certificate is SSLCertificate cn=documentation
Private key is <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'>
Building  c:\waptdev\tis-dropbox
Signing c:\waptdev\tis-dropbox with key <SSLPrivateKey 'C:\\Users\\documentation\\private\\documentation.pem'> and certificate documentation (C:\Users\documentation\private\documentation.crt)
Package c:\waptdev\tis-dropbox signed : signature : s9FOLFQvYw...c9T3Hv1A=
...done building. Package filename c:\waptdev\tis-dropbox_104.4.175-7_windows_0f4137ed1502b5045d6083aa258b5c42_5.1_PROD.wapt
1 packages successfully built
0 packages failed
Building and uploading packages to https://srvwapt.mydomain.lan
Please get login for https://srvwapt.mydomain.lan/api/v3/upload_xxx:admin
Password:
c:\waptdev\tis-dropbox_104.4.175-7_windows_0f4137ed1502b5045d6083aa258b5c42_5.1_PROD.wapt[================================] 126459984/126459984 - 00:00:40
Package uploaded successfully: 1 Packages uploaded, 0 errors

wapt-get duplicate

The wapt-get duplicate <package source> <package new_duplicate> command duplicates a package downloaded from the repository and opens it as a PyScripter project.

Warning

Don’t use this command for duplicating a host package.

Use this arguments :

Argument

Definition

Required

directory or package

Directory path of package or compiled package in .wapt

feature available

new-package-name

Name of the new package

feature available

new-version

Change the package version in the control file. If it’s not defined, the same version is duplicated.

feature not available

target directory

Path to the target directory of the duplicated package. If it’s not defined, use the same as the source package.

feature not available

The command wapt-get duplicate tis-firefox tis-firefox-custom returns:

Package duplicated. You can build the new WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-package C:\waptdev\tis-firefox-custom-wapt
You can build and upload the new WAPT package by launching
  C:\Program Files (x86)\wapt\wapt-get.exe build-upload C:\waptdev\tis-firefox-custom-wapt

Hint

  • If you have previously installed tis-waptdev package on your development computer, PyScripter editor will launch automatically and open the package in development mode.

wapt-get edit

Warning

This method is to be used only if you cannot use the console to create a package.

The wapt-get edit <package name> command downloads and edits a WAPT package from the server repository.

The command takes on argument. That argument is the name package or a list of package names with the repository prefix.

The command wapt-get edit tis-firefox returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 1629411 / 54313787 (3%) (2686 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 8147055 / 54313787 (15%) (5679 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 15207836 / 54313787 (28%) (7367 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 19552932 / 54313787 (36%) (7249 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 24984302 / 54313787 (46%) (7471 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 29329398 / 54313787 (54%) (7143 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 33674494 / 54313787 (62%) (6951 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 40735275 / 54313787 (75%) (7534 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 45623508 / 54313787 (84%) (7326 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 53227426 / 54313787 (98%) (7603 KB/s)
https://srvwapt.mydomain.lan/wapt/tis-firefox_94.0.1-106_x64_windows_0f4137ed1502b5045d6083aa258b5c42_6.1_PROD_en_f5335369ad5805e8dbc1f8ae99b2258e.wapt : 54313787 / 54313787 (100%) (7663 KB/s)
Package edited. You can build and upload the new WAPT package by launching

Hint

  • If you have previously installed tis-waptdev package on your development computer, PyScripter editor will launch automatically and open the package in development mode.

wapt-get edit-host

Warning

This method is to be used only if you cannot use the console to create a package.

The wapt-get edit-host <host FQDN> command edits a WAPT host package.

The command wapt-get edit-host RND-0279A1F4-BBBE-43AE-A591-F82652E0104B returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
Package edited. You can build and upload the new WAPT package by launching
C:\Program Files (x86)\wapt\wapt-get.exe -i build-upload c:\waptdev\RND-0279A1F4-BBBE-43AE-A591-F82652E0104B_0-wapt

Hint

  • If you have previously installed tis-waptdev package on your development computer, PyScripter editor will launch automatically and open the package in development mode.

wapt-get update-package-sources

The wapt-get update-package-sources <path to the package> command update run the update-package function in setup.py file.

The command wapt-get update-package-sources tis-firefox returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
Latis Mozilla Firefox version is: 95.0.2
Download URL is: https://download-installer.cdn.mozilla.net/pub/firefox/releases/95.0.2/win64/en-US/Firefox%20Setup%2095.0.2.exe
Downloading: Firefox_Setup_95.0.2.exe
Firefox_Setup_95.0.2.exe[================================] 54810424/54810424 - 00:00:07
Software version updated (from: 94.0.1 to: 95.0.2)
Packages updated :
c:\waptdev\tis-firefox_0-wapt

Hint

  • If you have previously installed tis-waptdev package on your development computer, PyScripter editor will launch automatically and open the package in development mode.

Using the command-lines for WaptWUA management WAPT Enterprise feature only

wapt-get waptwua-scan

The wapt-get waptwua-scan scan status of Windows against current rules and send result to server.

The command wapt-get waptwua-scan returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Ensure wuauserv Auto Update option is disabled
Scanning with windows updates rules:
{
"direct_download": false,
"default_allow": false,
"filter": "Type='Software' or Type='Driver'",
"download_scheduling": "7d",
"install_scheduling": null,
"install_delay": null,
"postboot_delay": "10m"
}
Downloading wsusscn2.cab file from https://srvwapt.mydomain.lan/waptwua/wsusscn2.cab
wsusscn2.cab[================================] 1024297844/1024297844 - 00:02:04
Windows updates rules have been changed
Looking for updates with filter: Type='Software' or Type='Driver'
  Connecting to local update searcher using offline wsusscn2 file...
  Offline Update searcher ready...
Waiting for WUA search to complete
Done searching
WUA Search completed !
Updates scan done.
Writing status in local wapt DB
Status: OK
(0, 0, 0)
None
re-enabling wuauserv previous state: 0

wapt-get waptwua-download

The wapt-get waptwua-download command scan status of Windows against current rules, download missing kb and send result to server.

The command wapt-get waptwua-download returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Ensure wuauserv Auto Update option is disabled
Downloading wsusscn2.cab file from https://srvwapt.mydomain.lan/waptwua/wsusscn2.cab
wsusscn2.cab[================================] 1024297844/1024297844 - 00:00:26
Start of install for all pending Windows updates
Scanning with params:
{
"direct_download": false,
"default_allow": false,
"filter": "Type='Software' or Type='Driver'",
"download_scheduling": "7d",
"install_scheduling": null,
"install_delay": null,
"postboot_delay": "10m"
}
Scanning with windows updates rules:
{
"direct_download": false,
"default_allow": false,
"filter": "Type='Software' or Type='Driver'",
"download_scheduling": null,
"install_scheduling": null,
"install_delay": null,
"postboot_delay": "10m"
}
Bypassing scan, no change since last successful scan
Writing status in local wapt DB
Status: OK
{'downloaded': [], 'missing': []}
None
re-enabling wuauserv previous state: 0

wapt-get waptwua-install

The wapt-get waptwua-install install pending updates.

The command wapt-get waptwua-install returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Ensure wuauserv Auto Update option is disabled
Downloading wsusscn2.cab file from https://srvwapt.mydomain.lan/waptwua/wsusscn2.cab
wsusscn2.cab[================================] 1024297844/1024297844 - 00:00:26
Start of install for all pending Windows updates
Scanning with params:
{
"direct_download": false,
"default_allow": false,
"filter": "Type='Software' or Type='Driver'",
"download_scheduling": "7d",
"install_scheduling": null,
"install_delay": null,
"postboot_delay": "10m"
}
Scanning with windows updates rules:
{
"allowed_products": null,
"allowed_classifications": null,
"allowed_severities": null,
"allowed_updates": null,
"forbidden_updates": null,
"allowed_kbs": null,
"forbidden_kbs": null,
"default_allow": false
}
Looking for updates with filter: Type='Software' or Type='Driver'
  Connecting to local update searcher using offline wsusscn2 file...
  Offline Update searcher ready...
Waiting for WUA search to complete
Done searching
WUA Search completed !
Updates scan done.
Installed 07609d43-d518-4e77-856e-d1b316d1b8a8 : MSXML 6.0 RTM Security Update  (925673)
Installed bb49cc19-8847-4986-aa93-5e905421e55a : Security Update for Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB2538242)
Installed 729a0dcb-df9e-4d02-b603-ed1aee074428 : Security Update for Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package (KB2538243)
Installed 719584bc-2208-4bc9-a650-d3d6347eb32e : Security Update for Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package (KB2565063)
Installed a8761130-35b6-41ce-8b67-2d35bb2d0846 : 2021-02 Cumulative Update for .NET Framework 3.5 and 4.8 for Windows 10, version 20H2 for x64 (KB4601050)
Installed 30f75e5d-2c46-42be-aef6-97ae730452be : 2021-07 Cumulative Update for Windows 10 Version 20H2 for x64-based Systems (KB5004945)
Installed 6e88be6e-d470-4e7e-9f36-01479049aadb : 2021-08 Servicing Stack Update for Windows 10 Version 20H2 for x64-based Systems (KB5005260)
Installed a15155a4-1299-41ff-9a39-28a33ce7cadd : 2021-12 .NET Core 3.1.22 Security Update for x64 Client (KB5009193)
Installed 38db0ad6-27f8-4bf9-ab2a-cffc4d7bc390 : Windows Malicious Software Removal Tool x64 - v5.96 (KB890830)
Scanning with windows updates rules:
{
"direct_download": false,
"default_allow": false,
"filter": "Type='Software' or Type='Driver'",
"download_scheduling": "7d",
"install_scheduling": null,
"install_delay": null,
"postboot_delay": "10m"
}
Windows updates rules have been changed
Writing status in local wapt DB
Status: OK
[]
None
re-enabling wuauserv previous state: 2

waptwua-status

The wapt-get waptwua-status return the last update status.

The command wapt-get waptwua-status returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
{'enabled': None,
'last_error': 'OperationalError: cannot rollback - no transaction is active',
'last_install_batch': [],
'last_install_date': None,
'last_install_reboot_required': None,
'last_install_result': None,
'last_scan_date': '2022-01-07T10:20:50.213644',
'last_scan_duration': 1490.500022649765,
'missing_downloads': [],
'rules_packages': [],
'status': 'SCANNING',
'wsusscn2cab_date': '2021-12-14T04:06:46'}
None

Using the command-lines for interaction with users WAPT Enterprise feature only

wapt-get propose-upgrade

The wapt-get propose-upgrade command launch an upgrade proposal by launching waptexit in open sessions.

The command wapt-get propose-upgrade returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
{'result': 1, 'summary': 'waptexit launched for 1 sessions'}

Using the command-lines for initial setup

wapt-get create-keycert

The wapt-get create-keycert [<options>] command create a RSA key pair and X509 certificate.

List of options avaible

Option

Description

Default Value

--CommonName

Display name of the certificate

/

--CommonName64

Display name of the certificate, encoded in base64 (if accents, spaces etc..)

/

--CodeSigning WAPT Enterprise feature only

If the certificate / key pair will be allowed to sign software packages

0

--CA WAPT Enterprise feature only

If this certificate / key pair can be used to sign other certificates (main or intermediate Certificate Authority)

0

--ClientAuth

Corresponds to a property (use) of the certificate

1 for a non-CA certificate

--PrivateKeyPassword

Password for unlocking the key if --NoPrivateKeyPassword is not used

Randomly generated password

--PrivateKeyPassword64 if --PrivateKeyPassword is not used

Password for unlocking the key, encoded in base64 (if accents, spaces etc..)

Randomly generated password

--NoPrivateKeyPassword

If private key is not encrypted if --PrivateKeyPassword or --PrivateKeyPassword64 are not used

Empty

-F

Force overwrite existing certificate

/

--Country

Name of the certificate holder’s country to register in the certificate.

/

--Locality

Name of the certificate holder’s city to register in the certificate.

/

--Organization

Name of the certificate holder’s Organization to register in the certificate.

/

--OrgUnit

Name of the certificate holder’s Organization Unit (Service) to register in the certificate.

/

--Email

Email address of the certificate holder to register in the certificate

/

--CAKeyFilename

Path to the key (.pem) of an Certificate Authority

Parameter default_ca_key_path in waptconsole.ini

--CACertFilename

Path to the certicate (.crt) of an Certificate Authority

Parameter default_ca_cert_path in waptconsole.ini

--CAKeyPassword

Password for unlocking the key of Certificate Authority

/

-NoCAKeyPassword

If Certificate Authority key is not encrypted

/

--BaseDir

Folder where the private key and the public certificate will be stored.

Directory personal_certificate_path in waptconsole.ini

-EnrollNewCert

Copy the certificate to waptssl

/

-SetAsDefaultPersonalCert

The certificate path is assigned to personal_certificate_path in waptconsole.ini

/

The command wapt-get create-keycert returns:

Using config file C:\Users\Administrator\AppData\Local\waptconsole\waptconsole.ini
BaseDir: C:\private\
Common name of certificate to create: documentation
Private Key Filename: C:\private\documentation.pem
Certificate Filename: C:\private\documentation.crt
New private key password: QR.-DVp6MPGW

Warning

If default_ca_key_path and default_ca_cert_path are defined in C:UsersAdministratorAppDataLocalwaptconsolewaptconsole.ini you must place CA certificate in the same location.

Else this error appears :

wapt-get create-keycert
Using config file C:\Users\tisadmin\AppData\Local\waptconsole\waptconsole.ini
BaseDir: C:\Users\tisadmin\private\
Common name of certificate to create: CRT
Exception at 00483595: Exception:
CA Certificate C:\Program Files (x86)\wapt\ssl does not exist.

wapt-get build-waptagent

The wapt-get build-waptagent [</ConfigFilename>] compile and upload a waptagent.exe and waptupgrade.exe package using /ConfigFilename parameter to ini file. For ini file use the wapt-get.ini syntax.

Note

By default, use waptconsole.ini configuration.

The command wapt-get build-waptagent returns:

Building customized waptagent.exe installer
......................................................................................
Built C:\Users\documentation\AppData\Local\Temp\wapt20220107T12203700000.tmp\waptupgrade\waptagent.exe
Private key Password for C:\Users\documentation\private\documentation.crt : ********
Building waptupgrade package
Waptserver https://srvwapt.mydomain.lan Admin User () :admin
Waptserver Password: ************
Uploading customized waptagent.exe installer
Uploading C:\Users\documentation\AppData\Local\Temp\wapt20220107T12203700000.tmp\waptupgrade\waptagent.exe to waptserver https://srvwapt.mydomain.lan
OK
Uploading C:\Users\documentation\AppData\Local\Temp\wapt20220107T12203700000.tmp\tis-waptupgrade_2.1.2.10605-0_all_PROD_all.wapt to waptserver https://srvwapt.mydomain.lan
OK : 1 Packages uploaded, 0 errors. Errors:

Using the command-lines for repository management

wapt-get upload-package

The wapt-get upload-package <path to the package> command uploads a package onto the main WAPT repository.

The command wapt-get upload-package C:\\waptdev\\tis-tightvnc.wapt returns:

Using config file: C:\Users\documentation\AppData\Local\waptconsole\waptconsole.ini
Uploading packages to https://srvwapt.mydomain.lan
Please get login for https://srvwapt.mydomain.lan/api/v3/upload_xxx:admin
Password:
c:\waptdev\tis-tightvnc.wapt[================================] 54316019/54316019 - 00:00:17
OK : 1 Packages uploaded, 0 errors

wapt-get scan-packages

Hint

This command it’s only for the Windows repositories

The wapt-get scan-packages <directory> command rebuild a Packages file for http package repository.

The command wapt-get scan-packages C:\wapt\waptserver\repository\wapt returns:

Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Packages filename: C:\wapt\waptserver\repository\wapt
Processed packages:
  C:\wapt\waptserver\repository\wapt\tis-firefox.wapt
  C:\wapt\waptserver\repository\wapt\tis-tightvnc.wapt
  C:\wapt\waptserver\repository\wapt\tis-7zip.wapt
Skipped packages:

wapt-scanpackages

Hint

This command it’s only for the Linux repositories

The wapt-scanpackages <directory> command rebuild a Packages file for http package repository.

The command wapt-scanpackages /var/www/wapt/ returns nothing

Re-signing packages on the server using a command line

Hint

This commands are only avaible on Linux server

Danger

Before using this method, ensure that your WAPT Server is safe and not under the control of an unauthorized third party entity.

  • Copy your .crt and .pem to /tmp/ on the WAPT Server using Winscp or an equivalent tool.

  • It is then possible to re-sign all the packages at once on the WAPT Server with the following commands.

wapt-signpackages -d /var/www/wapt-host -c /tmp/wapt_pub_key.crt -k /tmp/wapt_priv_key.pem -s
wapt-signpackages -d /var/www/wapt -c /tmp/wapt_pub_key.crt -k /tmp/wapt_priv_key.pem -s
wapt-scanpackages /var/www/wapt/

Warning

If the error Access violation appear it’s beacause the package is too big.

Edit the package and see this procedure.

Hint

Use this method if re-signing from the WAPT console method does not complete successfully.

Attention

Remove your .crt and .pem from /tmp/ on the WAPT Server.

Using the command-lines with options

Option

Definition

--version

Show program’s version number and exit

-h | --help

Show help message and exit

-c CONFIG | --config=CONFIG

Path to another file like wapt-get.ini or waptconsole.ini. Replaces the file normally used by the command line.

-l LOGLEVEL | --loglevel=LOGLEVEL

Level of log files following this list : ‘debug’, ‘warning’, ‘info’, ‘error’, ‘critical’ (default: warning)

-D | --direct

Don’t use http service for update/upgrade

-S | --service

Request a Waptservice user

-u | --update-packages

Run wapt-get update before the command-line

-f | --force

Force the command-line

-p PARAMS | --params=PARAMS

Setup params as a JSon Object

-r WAPT_URL | -repo WAPT_URL | --repository=WAPT_URL

Override URL of main wapt repository from wapt-get.ini or waptconsole.ini file

-y | --hide

Hide the console during the execution of the command-line

-F FILTER_ON_HOST_CAP | --use-host-caps=FILTER_ON_HOST_CAP

Filter the packages based on the current host capabilities (0/1)

-i | --inc-release

Increase release number when building package

-a UPDATE_SERVER_STATUS | --update-server-status=UPDATE_SERVER_STATUS

Send updated status of host (soft, packages, etc..) to server after action. UPDATE_SERVER_STATUS takes a value of 0 or 1)

keep-signature-date

Keep the current package signature date, and file changetime. Only for wapt-get sign-package

-s SECTION_FILTER | --sections=SECTION_FILTER

Add a filter section to wapt-get search. Section it’s type of package

-o REDIRECT_OUTPUT | --output=REDIRECT_OUTPUT

Redirect the outputs to a given .ini file

-j | -json

Switch to json output for scripts purpose

-e ENCODING | --encoding=ENCODING

Change chararacter encoding for the output

-x EXCLUDES | --excludes=EXCLUDES

Comma separated list of files or directories to exclude for build-package

-k PERSONAL_CERTIFICATE_PATH | --certificate=PERSONAL_CERTIFICATE_PATH

Path to the PEM X509 certificate to sign packages. Package are unsigned if not provided

-w PRIVATE_KEY_PASSWD | --private-key-passwd=PRIVATE_KEY_PASSWD

Path to the file containing the private key password

-U USER | --user=USER

To define an interactive user

-g USERGROUPS | --usergroups=USERGROUPS

Groups of the final user as a JSon array for checking install permission

-t MAX_TTL | --maxttl=MAX_TTL

ax run time in minutes of wapt-get process before being killed by subsequent wapt-get (default: 60 minutes)

-L LANGUAGE | --language=LANGUAGE

Override language for install, example : fr (default : en)

-m MD | --message-digest=MD

Message digest type for wapt-get sign-package

-n | --newest-only

Return only the newest version of packages when use wapt-get search

--locales=LOCALES

Override packages locales filter for wapt-get search

--maturity=MATURITY

Set/change package maturity when building package

--pin-server-cert

When registering, pin the server certificate.

--wapt-server-url=SET_WAPTSERVER_URL

When the setting wapt_server is not defined, defined in wapt-get.ini.

--wapt-repo-url=SET_WAPTREPO_URL

When the setting repo_url is not defined, defined in wapt-get.ini.

--wapt-server-user=WAPT_SERVER_USER

Defines the user to upload packages to the server

--wapt-server-passwd=WAPT_SERVER_PASSWD

Defines the password to upload packages to the server

--log-to-windows-events

Log steps to the Windows event log

--use-gui

Force use of GUI Helper even if not in dev mode

--no-ide

Don’t launch ide when editing a package