优化代码

This commit is contained in:
chenxudong 2025-06-19 15:55:47 +08:00
parent ccb5e315fd
commit e42a29ab11
2 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,3 @@
cd src
pyinstaller --onefile --add-data "install/Common.py:install" --add-data "datas/init.sql:datas" .\install\InstallMariaDB.py
pyinstaller --onefile --add-data "install/Common.py:install" --add-data "datas/nssm.exe:datas" --add-data "datas/electromagnetic.jar:datas" .\install\InstallMariaDB.py
pyinstaller --onefile --add-data "install/Common.py:install" --add-data "datas/nssm.exe:datas" --add-data "datas/electromagnetic.jar:datas" .\install\InstallComacDB.py

View File

@ -101,8 +101,10 @@ class InstallComacDb:
logger.info("清理历史服务")
stop_command = ["sc", "stop", self.service_name]
delete_command = ["sc", "delete", self.service_name]
subprocess.run(stop_command, capture_output=True, text=True)
subprocess.run(delete_command, capture_output=True, text=True)
res1 = subprocess.run(stop_command, capture_output=True, text=True)
logger.info(res1.stdout)
res2 = subprocess.run(delete_command, capture_output=True, text=True)
logger.info(res2.stdout)
time.sleep(5)
pass