Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Update main.py #3

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update main.py
  • Loading branch information
lowproger authored Jul 29, 2022
commit 91044dd5543a21efe4e8cfc555046028725403b2
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def autorun(self):
if self.state is False:
print("Автозапуск включен.")
path = os.path.dirname(os.path.realpath(__file__))
address = os.path.join(path, "main.exe")
key_value = "Software/Microsoft/Windows/CurrentVersion/Run"
address = os.path.join(path, "start.bat")
key_value = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
user = getpass.getuser()
key = reg.OpenKey(reg.HKEY_LOCAL_MACHINE, key_value, 0, reg.KEY_ALL_ACCESS)
reg.SetValueEx(key, user, 0, reg.REG_SZ, address)
Expand All @@ -79,7 +79,7 @@ def autorun(self):
icon_path=self.resource_path("nasa.ico"))
else:
print("Программа удалена из автозапуска.")
key_value = "Software/Microsoft/Windows/CurrentVersion/Run"
key_value = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
user = getpass.getuser()
key = reg.OpenKey(reg.HKEY_LOCAL_MACHINE, key_value, 0, reg.KEY_ALL_ACCESS)
reg.DeleteValue(key, user)
Expand Down