diff --git a/app/utils/Updater.py b/app/utils/Updater.py index bfc54db..b846699 100644 --- a/app/utils/Updater.py +++ b/app/utils/Updater.py @@ -21,7 +21,7 @@ """ AUTO_MAA AUTO_MAA更新器 -v1.0 +v1.1 作者:DLmaster_361 """ diff --git a/app/utils/package.py b/app/utils/package.py index ae7be05..fcaf9f9 100644 --- a/app/utils/package.py +++ b/app/utils/package.py @@ -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,