From 9c7446f820b7abbc2868ffdc077e4d251c616b14 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:07:26 +0800 Subject: [PATCH] In-app update alone package --- v2rayN/ServiceLib/Handler/UpdateHandler.cs | 9 +++++++++ .../ViewModels/CheckUpdateViewModel.cs | 18 +++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/UpdateHandler.cs b/v2rayN/ServiceLib/Handler/UpdateHandler.cs index d025ea00..48c4f5e9 100644 --- a/v2rayN/ServiceLib/Handler/UpdateHandler.cs +++ b/v2rayN/ServiceLib/Handler/UpdateHandler.cs @@ -437,6 +437,15 @@ namespace ServiceLib.Handler { if (Utils.IsWindows()) { + //Check for standalone windows .Net version + if (coreInfo?.coreType == ECoreType.v2rayN + && File.Exists(Path.Combine(Utils.StartupPath(), "wpfgfx_cor3.dll")) + && File.Exists(Path.Combine(Utils.StartupPath(), "D3DCompiler_47_cor3.dll")) + ) + { + return coreInfo?.coreDownloadUrl64.Replace("v2rayN.zip", "zz_v2rayN-SelfContained.zip"); + } + return RuntimeInformation.ProcessArchitecture switch { Architecture.Arm64 => coreInfo?.coreDownloadUrlArm64, diff --git a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs index 48162b0b..da18f0ce 100644 --- a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs @@ -148,15 +148,15 @@ namespace ServiceLib.ViewModels private async Task CheckUpdateN(bool preRelease) { - //Check for standalone windows .Net version - if (Utils.IsWindows() - && File.Exists(Path.Combine(Utils.StartupPath(), "wpfgfx_cor3.dll")) - && File.Exists(Path.Combine(Utils.StartupPath(), "D3DCompiler_47_cor3.dll")) - ) - { - UpdateView(_v2rayN, ResUI.UpdateStandalonePackageTip); - return; - } + ////Check for standalone windows .Net version + //if (Utils.IsWindows() + // && File.Exists(Path.Combine(Utils.StartupPath(), "wpfgfx_cor3.dll")) + // && File.Exists(Path.Combine(Utils.StartupPath(), "D3DCompiler_47_cor3.dll")) + // ) + //{ + // UpdateView(_v2rayN, ResUI.UpdateStandalonePackageTip); + // return; + //} void _updateUI(bool success, string msg) {