Skip to content

Commit

Permalink
fix for Dell Support Assist
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrlaczykowski committed Jun 7, 2024
1 parent 45b297e commit 241e921
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dell.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def launch_dell_support_assist():
try:
ps_command = (
"Get-AppxPackage | Where-Object {$_.Name -like 'SupportAssist'} | "
"Get-AppxPackage | Where-Object {$_.Name -like '*SupportAssist*'} | "
"Foreach-Object {"
"$packageName = $_.PackageFamilyName;"
"Start-Process shell:AppsFolder\\$packageName!App;"
Expand All @@ -31,11 +31,12 @@ def install_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()
if "Dell" in mobo_manufacturer():
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())
Expand Down
14 changes: 14 additions & 0 deletions utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ def download_installer(url, user_download_folder, installer_path):
for chunk in response.iter_content(chunk_size=1024):
installer_file.write(chunk)

def unsecured_download_installer(url, user_download_folder, installer_path):
try:
response = requests.get(url, stream=True, verify=False)
if response.status_code == 200:
os.makedirs(user_download_folder, exist_ok=True)
with open(installer_path, 'wb') as installer_file:
for chunk in response.iter_content(chunk_size=1024):
installer_file.write(chunk)
print(f"Downloaded installer to {installer_path}")
else:
print(f"Error downloading installer: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"Request error: {e}")

def install_program(installer_path):
if os.path.exists(installer_path):
try:
Expand Down

0 comments on commit 241e921

Please sign in to comment.