[RESOLVED] Webots packet sharing

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

April 14, 2025 - 5:05 PM

Good morning,

I'm sharing my package for the webots software, for which I've pushed the initial software configuration a bit further than the tis package (French language, no telemetry and disable auto update) ;)

Code: Select all

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

try:
    from waptenterprise.waptservice.enterprise import get_active_sessions, start_interactive_process
except:
    from waptservice.enterprise import get_active_sessions, start_interactive_process

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls

def install():
    # Declaring local variables
    bin_name= glob.glob("webot*.exe")[0]
    
    def get_version(app_registry_dict):
        return app_registry_dict["version"].replace("R", "").replace("b",".2").replace("a",".1")

    # Uninstalling others versions
    for uninstall in installed_softwares(name="Webots"):
        print("Removing: %s" % (uninstall["name"]))
        killalltasks(control.get_impacted_process_list())
        run(uninstall_cmd(uninstall["key"]))

    # Installing the software
    install_exe_if_needed(
        bin_name,
        silentflags="/VERYSILENT /ALLUSERS",
        key="Webots_is1",
        min_version=control.get_software_version(),
        get_version=get_version
    )

    # Installing Windows Firewall rules
    print('Add Windows Firewall rules')
    add_netfirewallrule(r"webots-bin", r"C:\program files\webots\msys64\mingw64\bin\webots-bin.exe", profile="Domain")

def session_setup():
    # Declaring local variables
    version= "R" + control.get_software_version().replace(".2","b").replace(".1","a")

    # Set french language
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\\Cyberbotics\\Webots-%s\\General' % version,'language','fr',type=REG_SZ)

    # Disable UpdateOnStartup
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\\Cyberbotics\\Webots-%s\\General' % version,'checkWebotsUpdateOnStartup','false',type=REG_SZ)

    # Disable telemetry
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\\Cyberbotics\\Webots-%s\\General' % version,'telemetry','false',type=REG_SZ)

def audit():
    run_session_setup(control.package)
    return "OK"

def run_session_setup(package_name):
    for session_id in get_active_sessions():
        start_interactive_process("wapt-get", "--hide session-setup %s -f" % package_name, session_id=session_id)  # , minimize=True

def uninstall():
    print('Uninstalling Windows Firewall rules')
    remove_netfirewallrule("webots-bin")
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

April 17, 2025 - 3:34 PM

Hi Olivier,

Ingrid has taken care of the package; it's in wapt-testing [1] and should be available on the store soon. Thanks for sharing. :-)

I'm marking the topic as resolved.

Best regards,

Denis

[1] https://wapt.tranquil.it/wapt-testing/t ... EPROD.wapt
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked