File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111from tkinter .ttk import Progressbar
1212import tkinter as tk
1313
14+ from PyQt5 .QtWidgets import QApplication
15+
1416from FB_win import win_main
1517# headers = {
1618# "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
@@ -194,14 +196,19 @@ async def check_version():
194196 return version , remote_version
195197
196198def version_ver ():
199+ # 确保只有一个QApplication实例
200+ app = QApplication .instance ()
201+ if app is None :
202+ app = QApplication (sys .argv )
203+
197204 loop = asyncio .new_event_loop ()
198205 asyncio .set_event_loop (loop )
199206 version , remote_version = loop .run_until_complete (check_version ())
200- print (version ,remote_version )
207+ print (version , remote_version )
208+
201209 if remote_version > version :
202210 install_new_version_thread (version , remote_version )
203211 else :
204- # 使用授权验证来启动主程序
205212 from authorization import verify_and_run
206213 verify_and_run (version , 1 )
207214if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -165,10 +165,18 @@ def check_authorization():
165165 FROM UserData
166166 WHERE PCCoded = ? \
167167 """
168+ update = """
169+ UPDATE UserData
170+ SET UseCount = UseCount + 1
171+ WHERE PCCoded = ? \
172+ """
168173 cursor .execute (query , (machine_code ,))
169174 results = cursor .fetchall ()
170175
171176 if results :
177+ # 更新UseCount
178+ cursor .execute (update , (machine_code ,))
179+ conn .commit ()
172180 for row in results :
173181 PCCoded = row [0 ]
174182 installDate = row [1 ]
You can’t perform that action at this time.
0 commit comments