Compare commits

...

3 Commits

Author SHA1 Message Date
uye
031e99c295 feat: 增加自动下载更新包提示文本 2026-06-29 14:46:42 +08:00
uye
84b560d3cd feat: 新增隐藏更新进度提示框选项 2026-06-29 14:37:02 +08:00
MistEO
ac9dbff483 ci: 强调要读skills 2026-06-29 12:15:19 +08:00
12 changed files with 135 additions and 17 deletions

View File

@@ -45,7 +45,7 @@ jobs:
感谢您的反馈AI 正在自动分析该问题,预计耗时约 10 分钟。
prompt-template: |
分析 GitHub Issue {{issue_number}}。把最终结论写到 {{answer_file}}。
严格按照 .claude/skills/maa-issue-log-analysis/SKILL.md 中的规则,分析 GitHub Issue {{issue_number}}。把最终结论写到 {{answer_file}}。
extra-comment-content: |
<!-- Skip all labels -->

View File

@@ -6,7 +6,7 @@
// MAA.Updater.exe <ParentProcessId> <RootDir> <ExtractDir> <BackupDir>
// <PackagePath> <SuccessStatusFile> <FailureStatusFile>
// <RelaunchExecutablePath> <PlanFile>
// [--mutex-name <name>] [--show-console]
// [--mutex-name <name>] [--show-console] [--no-progress-ui]
//
// Plan file format (UTF-8 JSON):
// { "packageType": "full|ota", "removeList": ["rel/path", ...], "moveList": ["rel/path", ...] }
@@ -134,6 +134,8 @@ struct ProgressUiTheme
static std::wstring g_logFile;
static bool g_writeConsoleLog = false;
// 用户可通过 --no-progress-ui 显式关闭更新进度窗口
static bool g_suppressProgressUi = false;
static UpdateProgressUi g_progressUi;
static ProgressUiTheme g_progressUiTheme;
@@ -340,7 +342,8 @@ static bool EnsureProgressWindowClassRegistered()
static bool ShouldShowProgressUi()
{
return !g_writeConsoleLog && GetConsoleWindow() == nullptr;
// 控制台输出和进度窗口是两个独立选项,可同时显示;用户可通过 --no-progress-ui 显式关闭进度窗口
return !g_suppressProgressUi;
}
static void PumpProgressUiMessages()
@@ -1800,6 +1803,7 @@ int wmain(int argc, wchar_t* argv[])
std::wstring relaunchExecutable = argv[8];
std::wstring planFile = argv[9];
g_writeConsoleLog = HasArgument(argc, argv, L"--show-console");
g_suppressProgressUi = HasArgument(argc, argv, L"--no-progress-ui");
std::wstring mutexName;
for (int i = 1; i < argc - 1; ++i) {

View File

@@ -44,6 +44,8 @@ public class VersionUpdate : INotifyPropertyChanged
public bool ShowUpdaterConsole { get; set; } = false;
public bool ShowUpdaterProgress { get; set; } = true;
public void OnPropertyChanged(string propertyName, object before, object after)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventDetailArgs(propertyName, before, after));

View File

@@ -248,6 +248,7 @@ public static class ConfigurationKeys
public const string AutoDownloadUpdatePackage = "VersionUpdate.AutoDownloadUpdatePackage";
public const string AutoInstallUpdatePackage = "VersionUpdate.AutoInstallUpdatePackage";
public const string ShowUpdaterConsole = "VersionUpdate.ShowUpdaterConsole";
public const string ShowUpdaterProgress = "VersionUpdate.ShowUpdaterProgress";
public const string PenguinId = "Penguin.Id";
public const string IsDrGrandet = "Penguin.IsDrGrandet"; // 已迁移

View File

@@ -348,8 +348,20 @@ To customize rotation schedules, please use 「{key=InfrastModeCustom}」.</syst
<system:String x:Key="UpdateAutoCheck">Scheduled Update Check</system:String>
<system:String x:Key="UpdateAutoCheckTip">In-game 00:00 / 18:00 (Server local time 04:00 / 22:00)</system:String>
<system:String x:Key="UpdateAutoDownload">Auto Download Update</system:String>
<system:String x:Key="UpdateAutoDownloadTip" xml:space="preserve">When disabled, detected updates (including manually triggered 「{key=UpdateCheckNow}」) will no longer download automatically. Instead, a system notification with a download link will be shown, allowing you to download the package and drag it into MAA manually.
If system notifications are turned off, an in-app notification will be used instead, though it does not provide an interactive download button.</system:String>
<system:String x:Key="AutoInstallUpdatePackage">Auto Install Update</system:String>
<system:String x:Key="ShowUpdaterConsole">Show MAA.Updater console output during update</system:String>
<system:String x:Key="ShowUpdaterConsole">Show updater console output during update</system:String>
<system:String x:Key="ShowUpdaterProgress">Show updater progress window</system:String>
<system:String x:Key="ShowUpdaterProgressTip" xml:space="preserve">Shows a standalone progress window from the updater during the update, displaying the current status and file processing progress.
When disabled, you won't be able to see the update progress visually. Do not launch MAA again while an update is in progress, as this may interrupt the update or corrupt files.</system:String>
<system:String x:Key="ShowUpdaterProgressWarning" xml:space="preserve">After disabling the update progress window, no progress will be shown during updates.
Please note:
1. Do not launch MAA again while an update is in progress, otherwise file locks may cause the update to fail or files to become corrupted.
2. If both the progress window and console output are disabled, the update will run with no UI feedback at all, making it hard to tell if it is stuck or has failed.
Are you sure you want to disable the update progress window?</system:String>
<system:String x:Key="UpdateCheckStable">Stable Release</system:String>
<system:String x:Key="UpdateCheckBeta">Beta Release</system:String>
<system:String x:Key="UpdateCheckNightly">Nightly Release</system:String>

View File

@@ -348,8 +348,20 @@
<system:String x:Key="UpdateAutoCheck">定期的な更新チェック</system:String>
<system:String x:Key="UpdateAutoCheckTip">ゲーム内 00:00 / 18:00サーバー現地時間 04:00 / 22:00</system:String>
<system:String x:Key="UpdateAutoDownload">自動アップデート</system:String>
<system:String x:Key="UpdateAutoDownloadTip" xml:space="preserve">オフの場合、更新の検出時(手動で 「{key=UpdateCheckNow}」 を実行した場合を含むに自動ダウンロードは行われず、ダウンロードリンク付きのシステム通知のみが表示されます。リンク先から更新パッケージをダウンロードし、MAA にドラッグして手動更新できます。
システム通知が無効な場合はアプリ内通知に切り替わりますが、アプリ内通知には操作可能なダウンロードボタンは提供されません。</system:String>
<system:String x:Key="AutoInstallUpdatePackage">自動インストール更新</system:String>
<system:String x:Key="ShowUpdaterConsole">更新中に MAA.Updater のコンソール出力を表示</system:String>
<system:String x:Key="ShowUpdaterConsole">更新中にアップデーターのコンソール出力を表示</system:String>
<system:String x:Key="ShowUpdaterProgress">アップデーターの進行状況ウィンドウを表示</system:String>
<system:String x:Key="ShowUpdaterProgressTip" xml:space="preserve">更新時にアップデーターが独立した進行状況ウィンドウを表示し、現在のステータスとファイル処理の進捗を示します。
オフにすると更新の進行状況が視覚的に分からなくなります。更新中は MAA を再度起動しないでください。更新が中断されたり、ファイルが破損する可能性があります。</system:String>
<system:String x:Key="ShowUpdaterProgressWarning" xml:space="preserve">更新進行状況ウィンドウをオフにすると、更新中に進行状況が表示されなくなります。
ご注意ください:
1. 更新中は MAA を再度起動しないでください。ファイルの占有により更新が失敗したり、ファイルが破損する可能性があります。
2. 進行状況ウィンドウとコンソール出力の両方をオフにすると、更新中に UI のフィードバックが一切なくなり、停止や失敗の判断が困難になります。
更新進行状況ウィンドウをオフにしてもよろしいですか?</system:String>
<system:String x:Key="UpdateCheckStable">安定版</system:String>
<system:String x:Key="UpdateCheckBeta">ベータ版</system:String>
<system:String x:Key="UpdateCheckNightly">内部テスト版</system:String>

View File

@@ -348,8 +348,20 @@
<system:String x:Key="UpdateAutoCheck">일정 시간마다 업데이트 확인</system:String>
<system:String x:Key="UpdateAutoCheckTip">게임 내 00:00 / 18:00 (서버 현지 시간 04:00 / 22:00)</system:String>
<system:String x:Key="UpdateAutoDownload">업데이트 자동 다운로드</system:String>
<system:String x:Key="UpdateAutoDownloadTip" xml:space="preserve">체크 해제 시, 업데이트 감지 시(수동으로 「{key=UpdateCheckNow}」 실행 포함)자동 다운로드가 중지되고 다운로드 링크가 포함된 시스템 알림만 표시됩니다. 링크에서 업데이트 패키지를 직접 다운로드한 후 MAA에 끌어다 놓아 수동으로 업데이트할 수 있습니다.
시스템 알림이 꺼져 있는 경우 앱 내 알림으로 전환되지만, 앱 내 알림에는 조작 가능한 다운로드 버튼이 제공되지 않습니다.</system:String>
<system:String x:Key="AutoInstallUpdatePackage">업데이트 패키지 자동 설치</system:String>
<system:String x:Key="ShowUpdaterConsole">업데이트 중 MAA.Updater 콘솔 출력 표시</system:String>
<system:String x:Key="ShowUpdaterConsole">업데이트 중 업데이터 콘솔 출력 표시</system:String>
<system:String x:Key="ShowUpdaterProgress">업데이터 진행 창 표시</system:String>
<system:String x:Key="ShowUpdaterProgressTip" xml:space="preserve">업데이트 시 업데이터가 별도의 진행 창을 표시하여 현재 상태와 파일 처리 진행률을 보여줍니다.
끄면 업데이트 진행 상황을 직관적으로 확인할 수 없습니다. 업데이트 중에는 MAA를 다시 실행하지 마세요. 업데이트가 중단되거나 파일이 손상될 수 있습니다.</system:String>
<system:String x:Key="ShowUpdaterProgressWarning" xml:space="preserve">업데이트 진행 창을 끄면 업데이트 중에 진행 상황이 표시되지 않습니다.
주의 사항:
1. 업데이트 중에는 MAA를 다시 실행하지 마세요. 파일 점유로 인해 업데이트가 실패하거나 파일이 손상될 수 있습니다.
2. 진행 창과 콘솔 출력을 모두 끄면 업데이트 중에 UI 피드백이 전혀 표시되지 않아 중단 또는 실패 여부를 판단하기 어렵습니다.
업데이트 진행 창을 끄시겠습니까?</system:String>
<system:String x:Key="UpdateCheckStable">안정 버전</system:String>
<system:String x:Key="UpdateCheckBeta">베타 버전</system:String>
<system:String x:Key="UpdateCheckNightly">개발 버전</system:String>

View File

@@ -348,8 +348,20 @@
<system:String x:Key="UpdateAutoCheck">定时检查更新</system:String>
<system:String x:Key="UpdateAutoCheckTip">游戏内 00:00 / 18:00对应服务器当地时间 04:00 / 22:00</system:String>
<system:String x:Key="UpdateAutoDownload">自动下载更新包</system:String>
<system:String x:Key="UpdateAutoDownloadTip" xml:space="preserve">取消勾选后,检测到新版本时(包括手动触发 「{key=UpdateCheckNow}」)将不再自动下载,仅通过系统通知提示并附带下载链接,可自行下载更新包后拖入 MAA 完成更新。
若系统通知已关闭,则改为软件内通知,但软件内通知不提供可交互的下载按钮。</system:String>
<system:String x:Key="AutoInstallUpdatePackage">自动安装更新包</system:String>
<system:String x:Key="ShowUpdaterConsole">显示 MAA.Updater 控制台输出</system:String>
<system:String x:Key="ShowUpdaterConsole">显示更新程序控制台输出</system:String>
<system:String x:Key="ShowUpdaterProgress">显示更新程序进度窗口</system:String>
<system:String x:Key="ShowUpdaterProgressTip" xml:space="preserve">更新时由更新程序显示一个独立的进度窗口,展示当前更新状态与文件处理进度。
关闭后将无法直观看到更新进展,更新过程中也不要重复启动 MAA否则可能导致更新中断或文件损坏。</system:String>
<system:String x:Key="ShowUpdaterProgressWarning" xml:space="preserve">关闭更新进度窗口后,更新过程中将不再显示进度提示。
请注意:
1. 更新期间请勿重复启动 MAA否则可能因文件占用导致更新失败或文件损坏。
2. 若同时关闭了进度窗口和控制台输出,更新过程将完全无界面提示,难以判断是否卡住或失败。
确定要关闭更新进度窗口吗?</system:String>
<system:String x:Key="UpdateCheckStable">正式版</system:String>
<system:String x:Key="UpdateCheckBeta">公测版</system:String>
<system:String x:Key="UpdateCheckNightly">内测版</system:String>

View File

@@ -348,8 +348,20 @@
<system:String x:Key="UpdateAutoCheck">定時檢查更新</system:String>
<system:String x:Key="UpdateAutoCheckTip">遊戲內 00:00 / 18:00對應伺服器當地時間 04:00 / 22:00</system:String>
<system:String x:Key="UpdateAutoDownload">自動下載更新檔</system:String>
<system:String x:Key="UpdateAutoDownloadTip" xml:space="preserve">取消勾選後,偵測到新版本時(包含手動觸發 「{key=UpdateCheckNow}」)將不再自動下載,僅透過系統通知提示並附上下載連結,可自行下載更新檔後拖入 MAA 完成更新。
若系統通知已關閉,則改為軟體內通知,但軟體內通知不提供可互動的下載按鈕。</system:String>
<system:String x:Key="AutoInstallUpdatePackage">自動安裝更新檔</system:String>
<system:String x:Key="ShowUpdaterConsole">顯示 MAA.Updater 主控台輸出</system:String>
<system:String x:Key="ShowUpdaterConsole">顯示更新程式主控台輸出</system:String>
<system:String x:Key="ShowUpdaterProgress">顯示更新程式進度視窗</system:String>
<system:String x:Key="ShowUpdaterProgressTip" xml:space="preserve">更新時由更新程式顯示一個獨立的進度視窗,展示目前更新狀態與檔案處理進度。
關閉後將無法直觀看到更新進展,更新過程中也不要重複啟動 MAA否則可能導致更新中斷或檔案損壞。</system:String>
<system:String x:Key="ShowUpdaterProgressWarning" xml:space="preserve">關閉更新進度視窗後,更新過程中將不再顯示進度提示。
請注意:
1. 更新期間請勿重複啟動 MAA否則可能因檔案佔用導致更新失敗或檔案損壞。
2. 若同時關閉了進度視窗和主控台輸出,更新過程將完全無介面提示,難以判斷是否卡住或失敗。
確定要關閉更新進度視窗嗎?</system:String>
<system:String x:Key="UpdateCheckStable">穩定版</system:String>
<system:String x:Key="UpdateCheckBeta">公測版</system:String>
<system:String x:Key="UpdateCheckNightly">內測版</system:String>

View File

@@ -445,6 +445,7 @@ internal static partial class PendingUpdateApplier
IReadOnlyList<string> moveEntries)
{
bool showUpdaterConsole = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ShowUpdaterConsole, false);
bool showUpdaterProgress = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ShowUpdaterProgress, true);
string planPath = Path.Combine(context.RootDir, $"maa-pending-update-{Guid.NewGuid():N}.json");
string updaterExecutablePath = PrepareDelegatedUpdaterExecutable(context);
string relaunchExecutablePath = Path.Combine(context.RootDir, "MAA.exe");
@@ -462,7 +463,7 @@ internal static partial class PendingUpdateApplier
// Args: <ParentPid> <RootDir> <ExtractDir> <BackupDir>
// <PackagePath> <SuccessStatusFile> <FailureStatusFile>
// <RelaunchExecutablePath> <PlanFile>
// [--mutex-name <name>] [--show-console]
// [--mutex-name <name>] [--show-console] [--no-progress-ui]
startInfo.ArgumentList.Add(Environment.ProcessId.ToString());
startInfo.ArgumentList.Add(context.RootDir);
startInfo.ArgumentList.Add(context.ExtractDir);
@@ -479,13 +480,19 @@ internal static partial class PendingUpdateApplier
startInfo.ArgumentList.Add("--show-console");
}
if (!showUpdaterProgress)
{
startInfo.ArgumentList.Add("--no-progress-ui");
}
_logger.Information(
"Delegating pending update apply to external updater: packageType={PackageType}, rootDir={RootDir}, extractDir={ExtractDir}, packagePath={PackagePath}, showUpdaterConsole={ShowUpdaterConsole}",
"Delegating pending update apply to external updater: packageType={PackageType}, rootDir={RootDir}, extractDir={ExtractDir}, packagePath={PackagePath}, showUpdaterConsole={ShowUpdaterConsole}, showUpdaterProgress={ShowUpdaterProgress}",
packageType,
context.RootDir,
context.ExtractDir,
context.PackagePath,
showUpdaterConsole);
showUpdaterConsole,
showUpdaterProgress);
if (!File.Exists(updaterExecutablePath))
{

View File

@@ -513,6 +513,36 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
}
}
private bool _showUpdaterProgress = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ShowUpdaterProgress, true);
/// <summary>
/// Gets or sets a value indicating whether to show the updater progress window.
/// </summary>
public bool ShowUpdaterProgress
{
get => _showUpdaterProgress;
set {
// 关闭进度窗口属于有风险的操作,需要二次确认
if (!value)
{
var result = MessageBoxHelper.Show(
LocalizationHelper.GetString("ShowUpdaterProgressWarning"),
LocalizationHelper.GetString("Warning"),
MessageBoxButton.YesNo,
MessageBoxImage.Warning,
yes: LocalizationHelper.GetString("Confirm"),
no: LocalizationHelper.GetString("Cancel"));
if (result != MessageBoxResult.Yes)
{
return;
}
}
SetAndNotify(ref _showUpdaterProgress, value);
ConfigurationHelper.SetGlobalValue(ConfigurationKeys.ShowUpdaterProgress, value.ToString());
}
}
/// <summary>
/// Updates manually.
/// </summary>

View File

@@ -59,12 +59,14 @@
IsChecked="{Binding UpdateAutoCheck}" />
<controls:TooltipBlock TooltipText="{DynamicResource UpdateAutoCheckTip}" />
</StackPanel>
<CheckBox
Margin="8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{DynamicResource UpdateAutoDownload}"
IsChecked="{Binding AutoDownloadUpdatePackage}" />
<StackPanel Margin="8" Orientation="Horizontal">
<CheckBox
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{DynamicResource UpdateAutoDownload}"
IsChecked="{Binding AutoDownloadUpdatePackage}" />
<controls:TooltipBlock TooltipText="{DynamicResource UpdateAutoDownloadTip}" />
</StackPanel>
<CheckBox
Margin="8"
HorizontalAlignment="Left"
@@ -79,6 +81,18 @@
IsChecked="{Binding ShowUpdaterConsole}">
<TextBlock Text="{DynamicResource ShowUpdaterConsole}" TextWrapping="Wrap" />
</CheckBox>
<StackPanel
Margin="8"
Orientation="Horizontal">
<CheckBox
MaxWidth="150"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsChecked="{Binding ShowUpdaterProgress}">
<TextBlock Text="{DynamicResource ShowUpdaterProgress}" TextWrapping="Wrap" />
</CheckBox>
<controls:TooltipBlock TooltipText="{DynamicResource ShowUpdaterProgressTip}" />
</StackPanel>
<StackPanel
Margin="8"
Orientation="Horizontal"