# -*- coding: utf-8 -*-
from setuphelpers import *
r""" Dell Optimizer Application, 4.0.310.0, A00
General Usage:
Dell-Optimizer-Application_92TP7_WIN_4.0.310.0_A00_01.exe [/<option1>[=<value1>]] [/<option2>[=<value2>]]...
See listing below for <option> and <value> information.
NOTE:If the folder name contains space, double quotes should be given for folder name
EXAMPLE:/s /e="c:\Folder Name"
Option - Description:
---------------------
(none) - Display of graphical user interface for guided installation/update or extraction.
/? or /h - Displays this Update Package usage information.
/s - Suppresses all graphical user interfaces of the Update Package.
/e=<path> - Extraction of update contents to a folder.
(NOTE: Requires /s option)
/passthrough ... - (Advanced) Sends all text following the /passthrough option directly to the vendor install software of the Update Package. This mode suppresses any provided graphical user interfaces, but not necessarily those of the vendor software.
/factoryinstall /passthrough (vendor command line parameter) - (Advanced) (commnad line parameters) will be passed to vendor installer directly without parsing MUP.xml. Post installation, If the vendor installer returns REBOOT_REQUIRED or REBOOT_UPDATE_PENDING, it will be turned to SUCCESS.
/l=<path> - Define a specific path for the Update Package log file.
(NOTE: This option can NOT be used in combination with /passthrough)
Example(s):
---------------------
Update the system silently
Dell-Optimizer-Application_92TP7_WIN_4.0.310.0_A00_01.exe /s
Extract the update contents to the folder C:\mydir\
Dell-Optimizer-Application_92TP7_WIN_4.0.310.0_A00_01.exe /s /e=C:\mydir
Pass command line arguments directly to vendor installer.
Turn the return code to success if required
Dell-Optimizer-Application_92TP7_WIN_4.0.310.0_A00_01.exe /factoryinstall /passthrough D:\Sample.xml C:\log\FI.log
Change from the default log location to C:\my path with spaces\log.txt
Dell-Optimizer-Application_92TP7_WIN_4.0.310.0_A00_01.exe /l="C:\my path with spaces\log.txt"
PS C:\waptdev\tis-dell-optimizer_0_PROD-wapt> wapt-get list-registry --json dell
{
"output":[],
"config_filename":"C:\\Program Files (x86)\\wapt\\wapt-get.ini",
"result":[
{
"key":"Dell Display Manager 2.0",
"name":"Dell Display Manager 2.0",
"version":"2.0.0.139",
"install_date":"",
"install_location":"",
"uninstall_string":"C:\\Program Files\\Dell\\Dell Display Manager 2.0\\uninst.exe",
"publisher":"Dell Inc.",
"system_component":0,
"win64":true
},
{
"key":"Dell Peripheral Manager",
"name":"Dell Peripheral Manager",
"version":"1.6.5",
"install_date":"",
"install_location":"",
"uninstall_string":"C:\\Program Files\\Dell\\Dell Peripheral Manager\\Uninstall.exe",
"publisher":"Dell Inc.",
"system_component":0,
"win64":true
},
{
"key":"{1344E072-D68B-48FF-BD2A-C1CCCC511A50}",
"name":"Dell Optimizer",
"version":"4.0.310.0",
"install_date":"2023-07-31 00:00:00",
"install_location":"C:\\Program Files\\Dell\\DellOptimizer\\",
"uninstall_string":"MsiExec.exe /I{1344E072-D68B-48FF-BD2A-C1CCCC511A50}",
"publisher":"Dell",
"system_component":0,
"win64":true
},
{
"key":"{6250A087-31F9-47E2-A0EF-56ABF31B610E}",
"name":"Dell Core Services",
"version":"1.0.248.0",
"install_date":"2023-07-31 00:00:00",
"install_location":"C:\\Program Files\\Dell\\",
"uninstall_string":"MsiExec.exe /I{6250A087-31F9-47E2-A0EF-56ABF31B610E}",
"publisher":"Nom de votre soci\u00e9t\u00e9",
"system_component":0,
"win64":true
},
{
"key":"{E27862BD-4371-4245-896A-7EBE989B6F7F}",
"name":"DellOptimizerUI",
"version":"4.0.310.0",
"install_date":"2023-07-31 00:00:00",
"install_location":"C:\\Program Files (x86)\\Dell\\DellOptimizer\\",
"uninstall_string":"MsiExec.exe /I{E27862BD-4371-4245-896A-7EBE989B6F7F}",
"publisher":"Dell",
"system_component":0,
"win64":true
},
{
"key":"{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}",
"name":"Dell Optimizer Core",
"version":"4.0.310.0",
"install_date":"",
"install_location":"",
"uninstall_string":"\"C:\\Program Files (x86)\\InstallShield Installation Information\\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\\DellOptimizer.exe\" -remove -runfromtemp",
"publisher":"Dell Inc.",
"system_component":0,
"win64":false
}
]
}
https://www.dell.com/support/kbdoc/en-us/000184087/installing-dell-optimizer-through-system-center-configuration-manager-sccm
https://www.manishbangia.com/deploy-and-install-dell-optimizer-using-sccm/
https://www.dell.com/support/manuals/fr-fr/dell-optimizer/dell-optimizer-4.0_ug/install-dell-optimizer-using-the-command-prompt?guid=guid-4f8d7f72-ce88-434f-9b37-5296167514d0&lang=en-us
7-31-2023[05:42:58]: (PowerShell Action): Exception occurred attempting to open script file 'C:\Users\sybe_t2\AppData\Local\Temp\{ECE1C88D-014F-4FDE-BA0B-97ED2A3FD05A}\StopTechHubService.ps1', error 'Le fichier 'C:\Users\sybe_t2\AppData\Local\Temp\{ECE1C88D-014F-4FDE-BA0B-97ED2A3FD05A}\StopTechHubService.ps1' est introuvable.'
7-31-2023[05:42:58]: Action returned value 0x80040716
7-31-2023[05:42:58]: Action 'StopTechHubService' returned status 0x80070643
7-31-2023[05:42:58]: Error code: 0x80070643
7-31-2023[05:42:58]: Original exit status: 0x80070643, final exit status: 0x00000643
7-31-2023[05:42:58]: State manager: removing staging files from: C:\Users\sybe_t2\AppData\Local\Temp\{ECE1C88D-014F-4FDE-BA0B-97ED2A3FD05A}\
7-31-2023[05:42:58]: State manager: removing state info
Analytics, Applications, Audio, Network, Power, Presence Detection, Collaboration, Dell Display Manager, Dell Peripheral Manager.
https://www.dell.com/support/manuals/fr-fr/dell-optimizer/dell-optimizer-4.0_ug/installation-modes?guid=guid-340f3508-cfc0-461c-8070-0b6d342b2d6b&lang=en-us
HeadlessMode == /ExcludeFeatures=Analytics,Audio,Collaboration,PresenceDetection
External Apps == /ExcludeFeatures=DellDisplayManager,DellPeripheralManager
/ExcludeFeatures=Analytics,Audio,Collaboration,PresenceDetection,DellDisplayManager,DellPeripheralManager
Dell Optimizer Core seems to invoke icacls cmd's
"""
log_path = r"C:\Windows\Temp\DellOptimizer_install.log"
# silentflags=rf'/s /l="{log_path}"',
silentflags = f'/silent /TelemetryConsent=false /InstallDotNet=false /HeadlessMode=true /debuglog"{log_path}"'
# silentflags=f'/silent /TelemetryConsent=false /InstallDotNet=false /ExcludeFeatures=Analytics,Audio,Collaboration,PresenceDetection,DellDisplayManager,DellPeripheralManager /debuglog"{log_path}"',
def install():
bin_name = "DellOptimizer.exe"
# Extracting installer
run([glob.glob("Dell-Optimizer-Application_*.EXE")[0], "/s", "/e=."], timeout=600)
# Installing software
install_exe_if_needed(
bin_name,
silentflags=silentflags,
key="{1344E072-D68B-48FF-BD2A-C1CCCC511A50}",
min_version=control.get_software_version(),
timeout=1200,
)
def uninstall():
if "HeadlessMode=true".lower() in silentflags.lower() or (
"DellDisplayManager" in silentflags.lower() or "DellPeripheralManager" in silentflags.lower()
):
# Uninstalling the software
for to_uninstall in installed_softwares(uninstallkey="Dell Display Manager 2.0"):
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(ensure_list(control.impacted_process))
run(uninstall_cmd(to_uninstall["key"]))
wait_uninstallkey_absent(to_uninstall["key"])
# Uninstalling the software
for to_uninstall in installed_softwares(uninstallkey="Dell Peripheral Manager"):
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(ensure_list(control.impacted_process))
run(uninstall_cmd(to_uninstall["key"]))
wait_uninstallkey_absent(to_uninstall["key"])
# Uninstalling the software with different uninstall_string
for to_uninstall in installed_softwares(uninstallkey="{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}"): # Dell Optimizer Core
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(ensure_list(control.impacted_process))
app_uninstall_cmd = uninstall_cmd(to_uninstall["key"])
app_uninstall_cmd.append("-silent")
run(app_uninstall_cmd)
wait_uninstallkey_absent(to_uninstall["key"])
# Uninstalling the software
for to_uninstall in installed_softwares(uninstallkey="{6250A087-31F9-47E2-A0EF-56ABF31B610E}"): # Dell Core Services
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(ensure_list(control.impacted_process))
run(uninstall_cmd(to_uninstall["key"]))
wait_uninstallkey_absent(to_uninstall["key"])
# Uninstalling the software
for to_uninstall in installed_softwares(uninstallkey="{E27862BD-4371-4245-896A-7EBE989B6F7F}"): # DellOptimizerUI
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(ensure_list(control.impacted_process))
run(uninstall_cmd(to_uninstall["key"]))
wait_uninstallkey_absent(to_uninstall["key"])