# -*- coding: utf-8 -*- from setuphelpers import * import subprocess from waptcrypto import * def install(): # Installing the software install_exe_if_needed( "rustdesk.exe", silentflags="--silent-install", key="RustDesk", min_version=control.get_software_version(), ) # Create the uninstall key uninstallkey.clear() def uninstall(): run_notfatal(r'"C:\Program Files\RustDesk\RustDesk.exe" --uninstall') remove_tree( r"C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk", ignore_errors=True, ) def audit(): def get_rustdesk_id(): # Run the command and capture its output result = subprocess.run(["C:\\Program Files\\RustDesk\\rustdesk.exe", "--get-id"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) # Check if the command was successful if result.returncode == 0: # Store the output in a variable rustdesk_id = result.stdout final_id = rustdesk_id.rstrip() # Print the output for verification print(final_id) else: # If there was an error, print the error message print("Error:", result.stderr) return final_id WAPT.write_audit_data("RustDesk", "id", get_rustdesk_id(), max_count=3) return "OK"