Re dell command update

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
Answer
SeiyaGame
Messages: 13
Registration: May 25, 2023 - 3:19 p.m.

September 21, 2023 - 09:53

Good morning,

I would like to return to the previous topic regarding this package.

I fixed the audit function; a small indentation error had crept in. This error caused the audit to always display a WARNING message despite the service being correctly installed.

Code: Select all

def audit():
    audit_status = "OK"
    service_name = "DellClientManagementService"
    service_start_mode = get_service_start_mode(service_name)

    if service_start_mode in ["Disabled", "Manual"]:
        print(f"{service_name} service is stopped and prevents the application from working properly.")
        audit_status = "ERROR"
    elif not service_installed(service_name):
        print(f"{service_name} service does not exist.")
        audit_status = "ERROR"
    else:
        if service_is_running(service_name):
            print(f"{service_name} service is working properly.")
        else:
            print(f"{service_name} service is not running.")
            audit_status = "WARNING" # The indent error was here :D
    return audit_status
Furthermore, I've modified the installation process. It now performs a preliminary check to ensure the machine is indeed a Dell model before proceeding with the software installation. (Consider whether you want to keep this method; the other one also works.)

Code: Select all

def install():
    
    def get_system_manufacturer():
        return registry_readstring(HKEY_LOCAL_MACHINE, "SYSTEM\HardwareConfig\Current", "SystemManufacturer")  # Ex: Dell Inc.    
    
    # Declaring local variables
    bin_name = glob.glob("Dell-Command-Update-Windows-Universal-Application_*.EXE")[0]
    
    if "Dell" not in get_system_manufacturer():
        print(f"WARNING: {control.name} can only be installed on a Dell System! The installation will be ignored.")
        return

    # Installing the software
    print("Installing: %s" % bin_name)
    install_exe_if_needed(
        bin_name,
        silentflags="/s /factoryinstall",
        name="Dell Command | Update",
        min_version=control.get_software_version(),
        timeout=900,
    )

    # Disabling telemetry
    registry_set(HKEY_LOCAL_MACHINE, r"SOFTWARE\DELL\UpdateService\Clients\CommandUpdate\Preferences\Settings\General", "UserConsentDefault", 0)
    registry_set(HKEY_LOCAL_MACHINE, r"SOFTWARE\DELL\UpdateService\Clients\CommandUpdate\Preferences\CFG", "ShowSetupPopup", 0)
    
    # Download updates (notify when ready)
    # registry_set(
    #     HKEY_LOCAL_MACHINE, r"SOFTWARE\DELL\UpdateService\Clients\CommandUpdate\Preferences\Settings\Schedule", "AutomationMode", "ScanDownloadNotify"
    # )
    # registry_set(
    #     HKEY_LOCAL_MACHINE, r"SOFTWARE\DELL\UpdateService\Clients\CommandUpdate\Preferences\Settings\Schedule", "ScheduleMode", 
    #     "Auto"
    # )

    # Manual updates only
    registry_set(
        HKEY_LOCAL_MACHINE, r"SOFTWARE\DELL\UpdateService\Clients\CommandUpdate\Preferences\Settings\Schedule", "ScheduleMode", 
        "ManualUpdates"
    )

    # Disable notification
    registry_set(
        HKEY_LOCAL_MACHINE, r"SOFTWARE\DELL\UpdateService\Clients\CommandUpdate\Preferences\Settings\Schedule", "DisableNotification", 1
    )
Flavien.

General information:

WAPT Server: Debian 11, version 2.4.0.14143, Enterprise Edition
Administration machine: Windows 11, WAPT version 2.4.0.14143
Answer