def removestartup():
# check if it is linux
if os_type == 'Linux' or os_type == 'FreeBSD' or os_type == 'OpenBSD':
# remove it
os.remove(home_address + "/.config/autostart/persepolis.desktop")
# check if it is mac OS
elif os_type == "Darwin":
# OS X
if checkstartup():
os.system('launchctl unload ' + home_address +
"/Library/LaunchAgents/com.persepolisdm.plist")
os.remove(home_address +
"/Library/LaunchAgents/com.persepolisdm.plist")
# check if it is Windows
elif os_type == 'Windows':
if checkstartup():
# Connect to the startup path in Registry
key = winreg.OpenKey(
winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, winreg.KEY_ALL_ACCESS)
# remove persepolis from startup
winreg.DeleteValue(key, 'persepolis')
# Close connection
winreg.CloseKey(key)
评论列表
文章目录