-
Notifications
You must be signed in to change notification settings - Fork 0
/
dell_support_assist.py
46 lines (40 loc) · 1.69 KB
/
dell_support_assist.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import os
import sys
import ctypes
import subprocess
import requests
import wmi
import winreg
from utilities import *
from motherboard import *
# Define the URL to download Dell SupportAssist
support_assist_download_url = "https://downloads.dell.com/serviceability/catalog/SupportAssistInstaller.exe"
# Set the installer path to the specified download folder
dell_support_assist_installer_filename = "SupportAssistInstaller.exe"
support_assist_installer_path = os.path.join(user_download_folder(), dell_support_assist_installer_filename)
def launch_dell_support_assist():
try:
ps_command = (
"Get-AppxPackage | Where-Object {$_.Name -like '*SupportAssist*'} | "
"Foreach-Object {"
"$packageName = $_.PackageFamilyName;"
"Start-Process shell:AppsFolder\\$packageName!App;"
"}"
)
subprocess.run(["powershell", "-Command", ps_command], check=True)
except subprocess.CalledProcessError as e:
print(f"Error launching the UWP app: {e}")
def install_support_assist():
download_installer(url=support_assist_download_url, user_download_folder=user_download_folder(),installer_path=support_assist_installer_path)
# Install Dell SupportAssist
install_program(support_assist_installer_path, "Dell Support Assist")
# Check if Dell SupportAssist is already installed
def check_and_launch_dell_support_assist():
try:
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Dell\SupportAssistAgent", 0, winreg.KEY_READ):
launch_dell_support_assist()
except FileNotFoundError:
install_support_assist()
def dell():
print(mobo_manufacturer())
check_and_launch_dell_support_assist()