diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
index 98fba5a2..f9203dfd 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
+++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
@@ -870,6 +870,15 @@ namespace ServiceLib.Resx {
}
}
+ ///
+ /// 查找类似 Only Check 的本地化字符串。
+ ///
+ public static string menuCheckOnly {
+ get {
+ return ResourceManager.GetString("menuCheckOnly", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Check Update 的本地化字符串。
///
@@ -3934,7 +3943,7 @@ namespace ServiceLib.Resx {
}
///
- /// 查找类似 Check for pre-release updates 的本地化字符串。
+ /// 查找类似 Check for pre-release 的本地化字符串。
///
public static string TbSettingsEnableCheckPreReleaseUpdate {
get {
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
index 6dd074e9..61fe7743 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
@@ -1734,4 +1734,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
{0} has a new version available: {1}
+
+ Only Check
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fr.resx b/v2rayN/ServiceLib/Resx/ResUI.fr.resx
index 59cff7c8..69c46098 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fr.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fr.resx
@@ -1731,4 +1731,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
{0} has a new version available: {1}
+
+ Only Check
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx
index 0f25830a..0942419a 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx
@@ -1734,4 +1734,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
{0} has a new version available: {1}
+
+ Only Check
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx
index b989f719..b98f9625 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.resx
@@ -691,7 +691,7 @@
Automatically adjust column width after subscription update
- Check for pre-release updates
+ Check for pre-release
Exception
@@ -1734,4 +1734,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
{0} has a new version available: {1}
+
+ Only Check
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx
index daf33e10..30dd55d5 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx
@@ -1734,4 +1734,7 @@
{0} has a new version available: {1}
+
+ Only Check
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
index c3cf5da5..328ecd99 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
@@ -691,7 +691,7 @@
自动调整配置列宽在更新订阅后
- 检查 Pre-Release 更新 (请谨慎启用)
+ 检查 Pre-Release
例外
@@ -1731,4 +1731,7 @@
{0} 有新版本可用:{1}
+
+ 仅检查
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
index 1aad3bfc..09e01d16 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
@@ -691,7 +691,7 @@
在更新訂閱後自動調整列寬
- 檢查 Pre-Release 更新 (請謹慎啟用)
+ 檢查 Pre-Release
例外
@@ -1731,4 +1731,7 @@
{0} 有新版本可用:{1}
+
+ 僅檢查
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs
index f6f98e1a..7aea70c9 100644
--- a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs
+++ b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs
@@ -9,6 +9,7 @@ public class CheckUpdateViewModel : MyReactiveObject
public IObservableCollection CheckUpdateModels { get; } = new ObservableCollectionExtended();
public ReactiveCommand CheckUpdateCmd { get; }
+ public ReactiveCommand CheckOnlyCmd { get; }
[Reactive] public bool EnableCheckPreReleaseUpdate { get; set; }
public CheckUpdateViewModel(Func>? updateView)
@@ -23,6 +24,13 @@ public class CheckUpdateViewModel : MyReactiveObject
_ = UpdateView(_v2rayN, ex.Message);
});
+ CheckOnlyCmd = ReactiveCommand.CreateFromTask(CheckOnly);
+ CheckOnlyCmd.ThrownExceptions.Subscribe(ex =>
+ {
+ Logging.SaveLog(_tag, ex);
+ _ = UpdateView(_v2rayN, ex.Message);
+ });
+
EnableCheckPreReleaseUpdate = _config.CheckUpdateItem.CheckPreReleaseUpdate;
this.WhenAnyValue(
@@ -71,11 +79,54 @@ public class CheckUpdateViewModel : MyReactiveObject
await ConfigHandler.SaveConfig(_config);
}
+ private async Task CheckOnly()
+ {
+ await Task.Run(CheckOnlyTask);
+ }
+
private async Task CheckUpdate()
{
await Task.Run(CheckUpdateTask);
}
+ private async Task CheckOnlyTask()
+ {
+ await SaveSelectedCoreTypes();
+
+ for (var k = CheckUpdateModels.Count - 1; k >= 0; k--)
+ {
+ var item = CheckUpdateModels[k];
+ if (item.IsSelected != true)
+ {
+ continue;
+ }
+
+ await UpdateView(item.CoreType, "...");
+ if (item.CoreType == _geo)
+ {
+ await UpdateView(item.CoreType, ResUI.menuCheckOnly + " (Not Support)");
+ continue;
+ }
+
+ if (!Enum.TryParse(item.CoreType, out var type))
+ {
+ await UpdateView(item.CoreType, "Not Support");
+ continue;
+ }
+
+ var updateService = new UpdateService(_config, async (success, msg) => await Task.CompletedTask);
+ var result = await updateService.CheckHasUpdateOnly(type, EnableCheckPreReleaseUpdate);
+ if (result.Success && result.Version != null)
+ {
+ await UpdateView(item.CoreType, string.Format(ResUI.MsgCheckUpdateHasNewVersion, type, result.Version));
+ }
+ else
+ {
+ await UpdateView(item.CoreType, result.Msg);
+ }
+ }
+ }
+
private async Task CheckUpdateTask()
{
_lstUpdated.Clear();
diff --git a/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml b/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml
index 0055f9ad..e7b1a2f7 100644
--- a/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml
+++ b/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml
@@ -33,6 +33,12 @@
Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" />
+
+