Skip to content

Commit

Permalink
✨ feat(ALL): 实现单实例检测
Browse files Browse the repository at this point in the history
 - 禁止启动多个NCD,这样会导致一些奇怪的问题出现
  • Loading branch information
HeartfeltJoy committed Sep 29, 2024
1 parent 19a6668 commit b43a15a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
if __name__ == "__main__":

# 检查是否已经有 NCD 在运行了, 如果有则取消运行
for proc in psutil.process_iter():
if proc.name() == "NapCat-Desktop.exe":
for proc in psutil.process_iter(['name']):
if proc.info['name'] == "NapCat-Desktop.exe":
sys.exit()

# 调整程序 log 输出
Logger()
# 检查是否以管理员模式启动, 非管理员模式尝试获取管理员权限
Expand Down

0 comments on commit b43a15a

Please sign in to comment.