Updater改为独立打包

This commit is contained in:
DLmaster
2024-12-29 01:42:03 +08:00
parent 77298f4dab
commit e1352586b7
2 changed files with 17 additions and 2 deletions

View File

@@ -21,7 +21,7 @@
"""
AUTO_MAA
AUTO_MAA更新器
v1.0
v1.1
作者DLmaster_361
"""

View File

@@ -25,7 +25,9 @@ v4.2
作者DLmaster_361
"""
import os
import json
import shutil
import subprocess
from app import version_text
@@ -55,6 +57,19 @@ if __name__ == "__main__":
capture_output=True,
text=True,
)
shutil.copy(os.path.normpath("app/utils/Updater.py"), os.path.normpath("."))
with open(os.path.normpath("Updater.py"), "r", encoding="utf-8") as f:
file_content = f.read()
file_content = file_content.replace(
"from .version import version_text", "from app import version_text"
)
with open(os.path.normpath("Updater.py"), "w", encoding="utf-8") as f:
f.write(file_content)
result = subprocess.run(
f"powershell -Command nuitka --standalone --onefile --mingw64"
f" --enable-plugins=pyside6 --windows-console-mode=disable"
@@ -66,7 +81,7 @@ if __name__ == "__main__":
f" --copyright='Copyright © 2024 DLmaster361'"
f" --assume-yes-for-downloads --show-progress"
f" --output-filename=Updater --remove-output"
f" app\\utils\\Updater.py",
f" Updater.py",
shell=True,
capture_output=True,
text=True,