diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml
index 08f050eecc..7392e33e97 100644
--- a/src/MaaWpfGui/Res/Localizations/en-us.xaml
+++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml
@@ -593,6 +593,7 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla
Details
Solution
Please refer to the documentation: 「FAQ - Crashes」 to solve.
+ Failed to extract the update package. Please try to manually extract the update package in the root directory.
Please retry after shutting down the emulator and killing ADB. Otherwise restart your computer, then run MAA as administrator without opening the emulator, finally retry it.
The file is occupied, please restart the computer and try again.
Open link failure, please go to "Windows Settings" and select the default browser.
diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml
index 4429af933b..8e3e592b0f 100644
--- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml
+++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml
@@ -590,6 +590,7 @@
詳細情報
解決策
ドキュメント「よくある問題 - クラッシュ」を参照してください。
+ アップデートパッケージの解凍に失敗しました。ルートディレクトリにあるアップデートパッケージを手動で解凍してみてください。
エミュレータとADBを閉じるか、コンピューターを再起動してから、管理者権限でMAAを開いて操作してください。
ファイルが占有されています。コンピュータを再起動して再試行してください。
リンクを開けませんでした。Windows 設定に移動してデフォルトのブラウザを選択してください。
diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml
index 306f89da13..1c2801ea42 100644
--- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml
+++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml
@@ -590,6 +590,7 @@ OF-1을 해금하지 않았다면 선택하지 말아 주세요.
세부 정보
해결 방법
FAQ 문서의 크래시 관련 문단을 참고하세요.
+ 업데이트 패키지 압축 해제에 실패했습니다. 루트 디렉토리에 있는 업데이트 패키지를 수동으로 압축 해제해 보십시오.
에뮬레이터와 ADB를 종료하거나 컴퓨터를 재시작하고 관리자 권한으로 MAA를 실행해 주세요.
파일이 사용 중입니다. 컴퓨터를 다시 시작하고 다시 시도하세요.
링크 열기 실패. "Windows 설정"으로 이동하여 기본 브라우저를 선택하세요.
diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml
index 4da42f10f9..d62fce322f 100644
--- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml
+++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml
@@ -51,7 +51,7 @@
使用 GPU 加速推理
不使用
系统默认 GPU
-
+
任务设置
设置指引
@@ -596,6 +596,7 @@
详细信息
解决方案
请参考文档: 常见问题 - 闪退 进行操作。
+ 解压更新包失败,请尝试手动解压根目录下更新包。
请「关闭模拟器与 ADB」或「重启电脑后在未开启模拟器的情况下使用管理员权限打开 MAA」后进行操作。
文件被占用,请重启电脑后重试。
打开链接失败,请前往「Windows 设置」选择默认浏览器。
diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml
index 5726f50046..3151d7b088 100644
--- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml
+++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml
@@ -587,6 +587,7 @@
詳細資訊
解決方法
請參考文件: 常見問題 - 閃退 進行操作。
+ 解壓更新包失敗,請嘗試手動解壓根目錄下更新包。
請關閉模擬器與 ADB 或重開電腦後,使用系統管理員身分執行 MAA 進行操作。
檔被佔用,請重開電腦後重試。
打開連結失敗,請前往「Windows 設置」選擇默認瀏覽器。
diff --git a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs
index 7f1cf7d223..d79143f0f8 100644
--- a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs
@@ -256,7 +256,15 @@ namespace MaaWpfGui.ViewModels.UI
}
}
- File.Move(path, moveTo);
+ try
+ {
+ File.Move(path, moveTo);
+ }
+ catch (Exception e)
+ {
+ _logger.Error($"move file error, path: {path}, moveTo: {moveTo}, error: {e.Message}");
+ throw;
+ }
}
}
@@ -279,18 +287,26 @@ namespace MaaWpfGui.ViewModels.UI
}
string curFileName = file.Replace(extractDir, curDir);
- if (File.Exists(curFileName))
+ try
{
- string moveTo = file.Replace(extractDir, oldFileDir);
- if (File.Exists(moveTo))
+ if (File.Exists(curFileName))
{
- DeleteFileWithBackup(moveTo);
+ string moveTo = file.Replace(extractDir, oldFileDir);
+ if (File.Exists(moveTo))
+ {
+ DeleteFileWithBackup(moveTo);
+ }
+
+ File.Move(curFileName, moveTo);
}
- File.Move(curFileName, moveTo);
+ File.Move(file, curFileName);
+ }
+ catch (Exception e)
+ {
+ _logger.Error($"move file error, file name: {file}");
+ throw;
}
-
- File.Move(file, curFileName);
}
// 操作完了,把解压的文件删了
@@ -308,8 +324,9 @@ namespace MaaWpfGui.ViewModels.UI
{
File.Delete(filePath);
}
- catch (Exception)
+ catch (Exception e)
{
+ _logger.Error($"delete file error, filePath: {filePath}, error: {e.Message}, try to backup.");
int index = 0;
string currentDate = DateTime.Now.ToString("yyyyMMddHHmm");
string backupFilePath = $"{filePath}.{currentDate}.{index}";
@@ -320,7 +337,15 @@ namespace MaaWpfGui.ViewModels.UI
backupFilePath = $"{filePath}.{currentDate}.{index}";
}
- File.Move(filePath, backupFilePath);
+ try
+ {
+ File.Move(filePath, backupFilePath);
+ }
+ catch (Exception e1)
+ {
+ _logger.Error($"move file error, path: {filePath}, moveTo: {backupFilePath}, error: {e1.Message}");
+ throw;
+ }
}
}
}
diff --git a/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs b/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs
index 4e714a07f0..abf96c58fc 100644
--- a/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs
+++ b/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs
@@ -89,6 +89,11 @@ namespace MaaWpfGui.Views.UI
return LocalizationHelper.GetString("ErrorSolutionCrash");
}
+ if (details.Contains("CheckAndUpdateNow()") && details.Contains("MoveFile"))
+ {
+ return LocalizationHelper.GetString("ErrorSolutionUpdatePackageExtractionFailed");
+ }
+
if (details.Contains("Hyperlink_Click") && details.Contains("StartWithShellExecuteEx"))
{
return LocalizationHelper.GetString("ErrorSolutionSelectDefaultBrowser");