Merge branch 'Updater'
This commit is contained in:
49
.github/workflows/python-app.yml
vendored
49
.github/workflows/python-app.yml
vendored
@@ -22,12 +22,12 @@ name: Build AUTO_MAA
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: [ "main","Updater" ]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
branches: [ "main","Updater" ]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
@@ -41,6 +41,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Repo Check
|
||||
id: repo_check
|
||||
run: |
|
||||
if [[ "$GITHUB_REPOSITORY" != "DLmaster361/AUTO_MAA" ]]; then
|
||||
echo "When forking this repository to make your own builds, you have to adjust this check."
|
||||
@@ -69,21 +70,33 @@ jobs:
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Built with pyinstaller
|
||||
id: built_with_pyinstaller
|
||||
run: |
|
||||
pyinstaller -F --version-file res/info.txt -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification
|
||||
python package.py
|
||||
- name: Read version
|
||||
id: read_version
|
||||
run: |
|
||||
$VERSION=(Get-Content -Path "更新说明.txt" -TotalCount 1).Trim()
|
||||
"version=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
$MAIN_VERSION=(Get-Content -Path "update_info.txt" -TotalCount 1).Trim()
|
||||
"AUTO_MAA_version=$MAIN_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
$UPDATER_VERSION=(Get-Content -Path "update_info.txt" -TotalCount 2 | Select-Object -Index 1).Trim()
|
||||
"updater_version=$UPDATER_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
- name: Create Zip
|
||||
id: create_zip
|
||||
run: |
|
||||
Compress-Archive -Path gui,res,AUTO_MAA.py,dist/AUTO_MAA.exe,requirements.txt,README.md,LICENSE,更新说明.txt -DestinationPath AUTO_MAA_${{ env.version }}.zip
|
||||
Compress-Archive -Path gui,res,AUTO_MAA.py,Updater.py,package.py,dist/AUTO_MAA.exe,requirements.txt,README.md,LICENSE -DestinationPath AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
|
||||
Compress-Archive -Path gui,dist/Updater.exe -DestinationPath Updater_${{ env.updater_version }}.zip
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: AUTO_MAA_${{ env.version }}
|
||||
path: AUTO_MAA_${{ env.version }}.zip
|
||||
name: AUTO_MAA_${{ env.AUTO_MAA_version }}
|
||||
path: |
|
||||
AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
|
||||
Updater_${{ env.updater_version }}.zip
|
||||
- name: Upload Update_Info Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: update_info
|
||||
path: update_info.txt
|
||||
publish_release:
|
||||
name: Publish release
|
||||
needs: build_AUTO_MAA
|
||||
@@ -97,10 +110,15 @@ jobs:
|
||||
pattern: AUTO_MAA_*
|
||||
merge-multiple: true
|
||||
path: artifacts
|
||||
- name: Download Update_Info
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: update_info
|
||||
path: ./
|
||||
- name: Check if release exists
|
||||
id: check_if_release_exists
|
||||
run: |
|
||||
release_id=$(gh release view $(head -n 1 更新说明.txt) --json id --jq .id || true)
|
||||
release_id=$(gh release view $(sed 's/\r$//g' <(head -n 1 update_info.txt)) --json id --jq .id || true)
|
||||
if [[ -z $release_id ]]; then
|
||||
echo "release_exists=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
@@ -114,22 +132,23 @@ jobs:
|
||||
run: |
|
||||
set -xe
|
||||
shopt -s nullglob
|
||||
NAME="$(head -n 1 更新说明.txt)"
|
||||
TAGNAME="$(head -n 1 更新说明.txt)"
|
||||
NOTES_MAIN="$(tail -n +2 更新说明.txt)"
|
||||
NAME="$(sed 's/\r$//g' <(head -n 1 update_info.txt))"
|
||||
TAGNAME="$(sed 's/\r$//g' <(head -n 1 update_info.txt))"
|
||||
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 update_info.txt))"
|
||||
NOTES_TAIL="\`\`\`本release通过GitHub Actions自动构建\`\`\`"
|
||||
NOTES="$NOTES_MAIN<br><br>$NOTES_TAIL"
|
||||
gh release create "$TAGNAME" --target "main" --title "$NAME" --notes "$NOTES" artifacts/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
|
||||
- name: Update release
|
||||
id: update_release
|
||||
if: steps.check_if_release_exists.outputs.release_exists == 'true'
|
||||
run: |
|
||||
set -xe
|
||||
shopt -s nullglob
|
||||
NAME="$(head -n 1 更新说明.txt)"
|
||||
TAGNAME="$(head -n 1 更新说明.txt)"
|
||||
NOTES_MAIN="$(tail -n +2 更新说明.txt)"
|
||||
NAME="$(sed 's/\r$//g' <(head -n 1 update_info.txt))"
|
||||
TAGNAME="$(sed 's/\r$//g' <(head -n 1 update_info.txt))"
|
||||
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 update_info.txt))"
|
||||
NOTES_TAIL="\`\`\`本release通过GitHub Actions自动构建\`\`\`"
|
||||
NOTES="$NOTES_MAIN<br><br>$NOTES_TAIL"
|
||||
gh release delete "$TAGNAME" --yes
|
||||
|
||||
102
AUTO_MAA.py
102
AUTO_MAA.py
@@ -18,6 +18,13 @@
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主程序
|
||||
v4.1
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
from PySide6.QtWidgets import (
|
||||
QWidget,
|
||||
QApplication,
|
||||
@@ -54,11 +61,14 @@ import time
|
||||
import random
|
||||
import secrets
|
||||
import winreg
|
||||
import requests
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Cipher import PKCS1_OAEP
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
|
||||
import Updater
|
||||
|
||||
uiLoader = QUiLoader()
|
||||
|
||||
|
||||
@@ -1005,6 +1015,7 @@ class Main(QWidget):
|
||||
self.config_path = self.app_path + "/config/gui.json"
|
||||
self.key_path = self.app_path + "/data/key"
|
||||
self.gameid_path = self.app_path + "/data/gameid.txt"
|
||||
self.version_path = self.app_path + "/res/version.json"
|
||||
self.PASSWORD = PASSWARD
|
||||
self.if_user_list_editable = True
|
||||
self.if_update_database = True
|
||||
@@ -1147,6 +1158,9 @@ class Main(QWidget):
|
||||
self.if_sleep = self.ui.findChild(QCheckBox, "checkBox_ifsleep")
|
||||
self.if_sleep.stateChanged.connect(self.change_config)
|
||||
|
||||
self.check_update = self.ui.findChild(QPushButton, "pushButton_check_update")
|
||||
self.check_update.clicked.connect(self.check_version)
|
||||
|
||||
self.run_text = self.ui.findChild(QTextBrowser, "textBrowser_run")
|
||||
self.wait_text = self.ui.findChild(QTextBrowser, "textBrowser_wait")
|
||||
self.over_text = self.ui.findChild(QTextBrowser, "textBrowser_over")
|
||||
@@ -1212,10 +1226,18 @@ class Main(QWidget):
|
||||
os.makedirs(self.app_path + "/data/MAAconfig/simple", exist_ok=True)
|
||||
os.makedirs(self.app_path + "/data/MAAconfig/beta", exist_ok=True)
|
||||
os.makedirs(self.app_path + "/data/MAAconfig/Default", exist_ok=True)
|
||||
# 生成版本信息文件
|
||||
if not os.path.exists(self.version_path):
|
||||
version = {
|
||||
"main_version": "0.0.0.0",
|
||||
"updater_version": "0.0.0.0",
|
||||
}
|
||||
with open(self.version_path, "w", encoding="utf-8") as f:
|
||||
json.dump(version, f, indent=4)
|
||||
# 生成配置文件
|
||||
if not os.path.exists(self.config_path):
|
||||
config = {"Default": {}}
|
||||
with open(self.config_path, "w") as f:
|
||||
with open(self.config_path, "w", encoding="utf-8") as f:
|
||||
json.dump(config, f, indent=4)
|
||||
# 生成预设gameid替换方案文件
|
||||
if not os.path.exists(self.gameid_path):
|
||||
@@ -1275,7 +1297,7 @@ class Main(QWidget):
|
||||
["SelfSet.IfSleep", "False"],
|
||||
]
|
||||
# 导入配置文件
|
||||
with open(self.config_path, "r") as f:
|
||||
with open(self.config_path, "r", encoding="utf-8") as f:
|
||||
config = json.load(f)
|
||||
# 检查并补充缺失的字段
|
||||
for i in range(len(config_list)):
|
||||
@@ -1283,7 +1305,7 @@ class Main(QWidget):
|
||||
config["Default"][config_list[i][0]] = config_list[i][1]
|
||||
self.config = config
|
||||
# 导出配置文件
|
||||
with open(self.config_path, "w") as f:
|
||||
with open(self.config_path, "w", encoding="utf-8") as f:
|
||||
json.dump(config, f, indent=4)
|
||||
|
||||
def check_database(self):
|
||||
@@ -2070,7 +2092,7 @@ class Main(QWidget):
|
||||
self.config["Default"]["MaaSet.path"] = self.maa_path.text().replace("\\", "/")
|
||||
if not self.check_maa_path():
|
||||
self.config["Default"]["MaaSet.path"] = ""
|
||||
with open(self.config_path, "w") as f:
|
||||
with open(self.config_path, "w", encoding="utf-8") as f:
|
||||
json.dump(self.config, f, indent=4)
|
||||
self.update_config()
|
||||
QMessageBox.critical(
|
||||
@@ -2098,7 +2120,7 @@ class Main(QWidget):
|
||||
self.config["Default"]["TimeSet.set" + str(i + 1)] = "False"
|
||||
time = self.start_time[i][1].time().toString("HH:mm")
|
||||
self.config["Default"]["TimeSet.run" + str(i + 1)] = time
|
||||
with open(self.config_path, "w") as f:
|
||||
with open(self.config_path, "w", encoding="utf-8") as f:
|
||||
json.dump(self.config, f, indent=4)
|
||||
self.update_config()
|
||||
|
||||
@@ -2309,6 +2331,76 @@ class Main(QWidget):
|
||||
self.run_now.setText("立即执行")
|
||||
self.run_now.clicked.connect(self.routine_starter)
|
||||
|
||||
def check_version(self):
|
||||
"""检查版本更新,调起文件下载进程"""
|
||||
# 从本地版本信息文件获取当前版本信息
|
||||
with open(self.version_path, "r", encoding="utf-8") as f:
|
||||
version_current = json.load(f)
|
||||
main_version_current = list(
|
||||
map(int, version_current["main_version"].split("."))
|
||||
)
|
||||
updater_version_current = list(
|
||||
map(int, version_current["updater_version"].split("."))
|
||||
)
|
||||
if not os.path.exists(self.app_path + "/Updater.exe"):
|
||||
updater_version_current = [0, 0, 0, 0]
|
||||
# 从远程服务器获取最新版本信息
|
||||
try:
|
||||
response = requests.get(
|
||||
"https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/blob/Updater/res/version.json"
|
||||
)
|
||||
except Exception as e:
|
||||
QMessageBox.critical(
|
||||
self.ui,
|
||||
"错误",
|
||||
f"获取版本信息时出错: {e}",
|
||||
)
|
||||
return None
|
||||
version_remote = response.json()
|
||||
main_version_remote = list(map(int, version_remote["main_version"].split(".")))
|
||||
updater_version_remote = list(
|
||||
map(int, version_remote["updater_version"].split("."))
|
||||
)
|
||||
|
||||
if (main_version_remote > main_version_current) or (
|
||||
updater_version_remote > updater_version_current
|
||||
):
|
||||
choice = QMessageBox.question(
|
||||
self.ui,
|
||||
"版本更新",
|
||||
f"发现新版本:\n 主程序:{self.version_text(main_version_current)} --> {self.version_text(main_version_remote)}\n 更新器:{self.version_text(updater_version_current)} --> {self.version_text(updater_version_remote)}\n 更新说明:\n{version_remote['announcement'].replace("\n","\n ")}\n\n是否开始更新?\n\n 注意:主程序更新时AUTO_MAA将自动关闭",
|
||||
)
|
||||
if choice == QMessageBox.No:
|
||||
return None
|
||||
|
||||
if updater_version_remote > updater_version_current:
|
||||
self.updater = Updater.Updater(
|
||||
self.app_path,
|
||||
"AUTO_MAA更新器",
|
||||
version_remote["updater_download_url"],
|
||||
)
|
||||
if main_version_remote > main_version_current:
|
||||
self.updater.update_process.accomplish.connect(self.update_main)
|
||||
self.updater.ui.show()
|
||||
elif main_version_remote > main_version_current:
|
||||
self.update_main()
|
||||
|
||||
def update_main(self):
|
||||
subprocess.Popen(
|
||||
self.app_path + "/Updater.exe",
|
||||
shell=True,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
)
|
||||
sys.exit()
|
||||
|
||||
def version_text(self, version_numb):
|
||||
"""将版本号列表转为可读的文本信息"""
|
||||
if version_numb[3] == 0:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}"
|
||||
elif version_numb[3] == 1:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}_beta"
|
||||
return version
|
||||
|
||||
def push_notification(self, title, message, ticker, t):
|
||||
"""推送系统通知"""
|
||||
notification.notify(
|
||||
|
||||
158
Updater.py
Normal file
158
Updater.py
Normal file
@@ -0,0 +1,158 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA更新器
|
||||
v1.0
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import zipfile
|
||||
import requests
|
||||
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QLabel,
|
||||
QProgressBar,
|
||||
)
|
||||
from PySide6.QtGui import QIcon
|
||||
from PySide6.QtCore import QObject, QThread, Signal
|
||||
from PySide6.QtUiTools import QUiLoader
|
||||
|
||||
uiLoader = QUiLoader()
|
||||
|
||||
|
||||
class UpdateProcess(QThread):
|
||||
|
||||
info = Signal(str)
|
||||
progress = Signal(int, int, int)
|
||||
accomplish = Signal()
|
||||
|
||||
def __init__(self, app_path, name, download_url):
|
||||
super(UpdateProcess, self).__init__()
|
||||
|
||||
self.app_path = app_path
|
||||
self.name = name
|
||||
self.download_url = download_url
|
||||
self.download_path = app_path + "/AUTO_MAA_Update.zip" # 临时下载文件的路径
|
||||
self.version_path = app_path + "/res/version.json"
|
||||
|
||||
def run(self):
|
||||
|
||||
# 下载
|
||||
try:
|
||||
response = requests.get(self.download_url, stream=True)
|
||||
file_size = response.headers.get("Content-Length")
|
||||
if file_size is None:
|
||||
file_size = 1
|
||||
else:
|
||||
file_size = int(file_size)
|
||||
with open(self.download_path, "wb") as f:
|
||||
downloaded_size = 0
|
||||
for chunk in response.iter_content(chunk_size=8192):
|
||||
f.write(chunk)
|
||||
downloaded_size += len(chunk)
|
||||
self.info.emit(
|
||||
f"正在下载:{self.name} 已下载: {downloaded_size / 1048576:.2f}/{file_size / 1048576:.2f} MB ({downloaded_size / file_size * 100:.2f}%)"
|
||||
)
|
||||
self.progress.emit(0, 100, int(downloaded_size / file_size * 100))
|
||||
except Exception as e:
|
||||
self.info.emit(f"下载{self.name}时出错: {e}")
|
||||
return None
|
||||
# 解压
|
||||
try:
|
||||
self.info.emit("正在解压更新文件")
|
||||
self.progress.emit(0, 0, 0)
|
||||
with zipfile.ZipFile(self.download_path, "r") as zip_ref:
|
||||
zip_ref.extractall(self.app_path)
|
||||
|
||||
self.info.emit("正在删除临时文件")
|
||||
self.progress.emit(0, 0, 0)
|
||||
os.remove(self.download_path)
|
||||
|
||||
self.info.emit(f"{self.name}更新成功!")
|
||||
self.progress.emit(0, 100, 100)
|
||||
|
||||
except Exception as e:
|
||||
self.info.emit(f"解压更新时出错: {e}")
|
||||
self.accomplish.emit()
|
||||
|
||||
|
||||
class Updater(QObject):
|
||||
|
||||
def __init__(self, app_path, name, download_url):
|
||||
super().__init__()
|
||||
|
||||
self.ui = uiLoader.load(app_path + "/gui/ui/updater.ui")
|
||||
self.ui.setWindowTitle("AUTO_MAA更新器")
|
||||
self.ui.setWindowIcon(QIcon(app_path + "/res/AUTO_MAA.ico"))
|
||||
|
||||
self.info = self.ui.findChild(QLabel, "label")
|
||||
self.info.setText("正在初始化")
|
||||
|
||||
self.progress = self.ui.findChild(QProgressBar, "progressBar")
|
||||
self.progress.setRange(0, 0)
|
||||
|
||||
self.update_process = UpdateProcess(app_path, name, download_url)
|
||||
|
||||
self.update_process.info.connect(self.update_info)
|
||||
self.update_process.progress.connect(self.update_progress)
|
||||
|
||||
self.update_process.start()
|
||||
|
||||
def update_info(self, text):
|
||||
self.info.setText(text)
|
||||
|
||||
def update_progress(self, begin, end, current):
|
||||
self.progress.setRange(begin, end)
|
||||
self.progress.setValue(current)
|
||||
|
||||
|
||||
class AUTO_MAA_Updater(QApplication):
|
||||
def __init__(self, app_path, name, download_url):
|
||||
super().__init__()
|
||||
|
||||
self.main = Updater(app_path, name, download_url)
|
||||
self.main.ui.show()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 获取软件自身的路径
|
||||
app_path = os.path.dirname(os.path.realpath(sys.argv[0])).replace("\\", "/")
|
||||
# 从本地版本信息文件获取当前版本信息
|
||||
with open(app_path + "/res/version.json", "r", encoding="utf-8") as f:
|
||||
version_current = json.load(f)
|
||||
main_version_current = list(map(int, version_current["main_version"].split(".")))
|
||||
# 从远程服务器获取最新版本信息
|
||||
response = requests.get(
|
||||
"https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/blob/Updater/res/version.json"
|
||||
)
|
||||
version_remote = response.json()
|
||||
main_version_remote = list(map(int, version_remote["main_version"].split(".")))
|
||||
|
||||
if main_version_remote > main_version_current:
|
||||
app = AUTO_MAA_Updater(
|
||||
app_path, "AUTO_MAA主程序", version_remote["main_download_url"]
|
||||
)
|
||||
sys.exit(app.exec())
|
||||
@@ -6,12 +6,12 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>697</height>
|
||||
<width>1200</width>
|
||||
<height>700</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
<string>AUTO_MAA</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<item>
|
||||
@@ -105,8 +105,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1218</width>
|
||||
<height>525</height>
|
||||
<width>1138</width>
|
||||
<height>528</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -189,8 +189,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>98</width>
|
||||
<height>74</height>
|
||||
<width>1156</width>
|
||||
<height>546</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -1102,6 +1102,25 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_check_update">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_21">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_check_update">
|
||||
<property name="text">
|
||||
<string>检查版本更新</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
35
gui/ui/updater.ui
Normal file
35
gui/ui/updater.ui
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>AUTO_MAA更新器</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
50
package.py
Normal file
50
package.py
Normal file
@@ -0,0 +1,50 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA打包程序
|
||||
v4.1
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
os.system(
|
||||
"pyinstaller -F --version-file res/AUTO_MAA_info.txt -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
|
||||
)
|
||||
os.system(
|
||||
"pyinstaller -F --version-file res/Updater_info.txt -w --icon=res/AUTO_MAA.ico Updater.py"
|
||||
)
|
||||
with open("res/version.json", "r", encoding="utf-8") as f:
|
||||
version = json.load(f)
|
||||
main_version = list(map(int, version["main_version"].split(".")))
|
||||
updater_version = list(map(int, version["updater_version"].split(".")))
|
||||
if main_version[3] == 0:
|
||||
main_version = f"v{'.'.join(str(_) for _ in main_version[0:3])}"
|
||||
elif main_version[3] == 1:
|
||||
main_version = f"v{'.'.join(str(_) for _ in main_version[0:3])}_beta"
|
||||
if updater_version[3] == 0:
|
||||
updater_version = f"v{'.'.join(str(_) for _ in updater_version[0:3])}"
|
||||
elif updater_version[3] == 1:
|
||||
updater_version = f"v{'.'.join(str(_) for _ in updater_version[0:3])}_beta"
|
||||
with open("update_info.txt", "w", encoding="utf-8") as f:
|
||||
print(f"{main_version}\n{updater_version}\n{version["announcement"]}", file=f)
|
||||
@@ -1,4 +1,5 @@
|
||||
plyer
|
||||
PySide6
|
||||
pycryptodome
|
||||
pyinstaller
|
||||
pyinstaller
|
||||
requests
|
||||
@@ -4,7 +4,7 @@ VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0.
|
||||
filevers=(4, 0, 0, 1),
|
||||
filevers=(4, 0, 1, 0),
|
||||
prodvers=(0, 0, 0, 0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
@@ -31,13 +31,13 @@ VSVersionInfo(
|
||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
||||
StringStruct('FileVersion', '4.0.0.1'),
|
||||
StringStruct('FileVersion', '4.0.1.0'),
|
||||
StringStruct('InternalName', 'AUTO_MAA'),
|
||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
||||
StringStruct('OriginalFilename', 'AUTO_MAA.py'),
|
||||
StringStruct('ProductName', 'AUTO_MAA'),
|
||||
StringStruct('ProductVersion', 'v4.0.0.1'),
|
||||
StringStruct('Assembly Version', 'v4.0.0.1')])
|
||||
StringStruct('ProductVersion', 'v4.0.1.0'),
|
||||
StringStruct('Assembly Version', 'v4.0.1.0')])
|
||||
])
|
||||
]
|
||||
)
|
||||
43
res/Updater_info.txt
Normal file
43
res/Updater_info.txt
Normal file
@@ -0,0 +1,43 @@
|
||||
# UTF-8
|
||||
#
|
||||
VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0.
|
||||
filevers=(0, 1, 0, 1),
|
||||
prodvers=(0, 0, 0, 0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||
flags=0x0,
|
||||
# The operating system for which this file was designed.
|
||||
# 0x4 - NT and there is no need to change it.
|
||||
OS=0x4,
|
||||
# The general type of file.
|
||||
# 0x1 - the file is an application.
|
||||
fileType=0x1,
|
||||
# The function of the file.
|
||||
# 0x0 - the function is not defined for this fileType
|
||||
subtype=0x0,
|
||||
# Creation date and time stamp.
|
||||
date=(0, 0)
|
||||
),
|
||||
kids=[
|
||||
VarFileInfo([VarStruct('Translation', [0, 1200])]),
|
||||
StringFileInfo(
|
||||
[
|
||||
StringTable(
|
||||
'000004b0',
|
||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
||||
StringStruct('FileVersion', '0.1.0.1'),
|
||||
StringStruct('InternalName', 'AUTO_MAA_Updater'),
|
||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
||||
StringStruct('OriginalFilename', 'Updater.py'),
|
||||
StringStruct('ProductName', 'AUTO_MAA_Updater'),
|
||||
StringStruct('ProductVersion', 'v0.1.0.1'),
|
||||
StringStruct('Assembly Version', 'v0.1.0.1')])
|
||||
])
|
||||
]
|
||||
)
|
||||
7
res/version.json
Normal file
7
res/version.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"main_version": "4.1.0.0",
|
||||
"main_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.0/AUTO_MAA_v4.1.0.zip",
|
||||
"updater_version": "0.1.0.0",
|
||||
"updater_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.0/Updater_v0.1.0.zip",
|
||||
"announcement": "\n测试版本,一般用户请下载v4.0_beta"
|
||||
}
|
||||
25
toexe.py
25
toexe.py
@@ -1,25 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
import os
|
||||
|
||||
os.system(
|
||||
"pyinstaller -F --version-file res/info.txt -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
|
||||
)
|
||||
20
更新说明.txt
20
更新说明.txt
@@ -1,20 +0,0 @@
|
||||
v4.0_beta
|
||||
## 新增功能
|
||||
- 服务器切换功能上线,支持B服 #7
|
||||
- 用户高级配置功能上线,支持用户修改几乎所有MAA配置
|
||||
## 修复BUG
|
||||
- 修复无用户进行代理时的逻辑错误
|
||||
## 程序优化
|
||||
- 进一步优化MAA配置流程
|
||||
- 优化自定义基建配置方法 #7
|
||||
- 无命令行窗口中止MAA进程
|
||||
- `gameid.txt`改由主程序进行初始化
|
||||
- log获取部分集成为1个函数
|
||||
- 消除部分if嵌套
|
||||
## 更新说明
|
||||
- 项目初始阶段,不会提供专门的版本更新程序,您需要手动更新程序。
|
||||
- v2.1.5及以前的用户,由于新版本采用全新的架构,您需要手动输入之前的信息。
|
||||
- v3.0_Beta版用户,直接用`AUTO_MAA.exe`替代`gui.exe`后,将原文件夹下的`gui文件夹`用新版本对应文件替换,重新设置每个用户的`自定义基建`选项(输入`-`以关闭该功能,输入自定义基建配置文件地址以开启该功能)。
|
||||
- v3.1~v3.1.3_beta版用户,直接用新版本文件替换旧版本即可。
|
||||
- 老用户请务必备份原有数据,在更新前确保所填MAA路径有效且已存在MAA配置文件,此次更新的代码改动较大,可能有数据遗失的风险。
|
||||
- 新用户请忽略本说明。
|
||||
Reference in New Issue
Block a user