Página 1 de 1

Re-actualización del comando dell

Publicado: 21 de septiembre de 2023 - 09:53
por SeiyaGame
Buen día,

Me gustaría volver a la tema anterior con respecto a este paquete.

Arreglé la función de auditoría; se había producido un pequeño error de sangría. Este error provocó que la auditoría siempre mostrara un mensaje de ADVERTENCIA a pesar de que el servicio estaba instalado correctamente.

Código: Seleccionar todo

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
Además, he modificado el proceso de instalación. Ahora realiza una comprobación preliminar para garantizar que el equipo sea un modelo Dell antes de proceder con la instalación del software. (Considere si desea conservar este método; el otro también funciona)

Código: Seleccionar todo

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.

Información general:

Servidor WAPT: Debian 11, versión 2.4.0.14143, Enterprise Edition
Máquina de administración: Windows 11, versión WAPT 2.4.0.14143