From c41378a0853f3f1f129f988e88be9d637da59cc8 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 17 Feb 2025 12:24:55 +0800 Subject: [PATCH 1/2] Update build-windows-desktop.yml --- .github/workflows/build-windows-desktop.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-windows-desktop.yml b/.github/workflows/build-windows-desktop.yml index ee5b9294..268fc43d 100644 --- a/.github/workflows/build-windows-desktop.yml +++ b/.github/workflows/build-windows-desktop.yml @@ -47,4 +47,22 @@ jobs: name: v2rayN-windows-desktop path: | ${{ github.workspace }}/v2rayN/Release/windows* - \ No newline at end of file + + # release zip archive + - name: Package release zip archive + if: github.event.inputs.release_tag != '' + run: | + chmod 755 package-release-zip.sh + ./package-release-zip.sh $OutputArch $OutputPath64 + mv "v2rayN-${OutputArch}.zip" "v2rayN-${OutputArch}-desktop.zip" + ./package-release-zip.sh $OutputArchArm $OutputPathArm64 + mv "v2rayN-${OutputArchArm}.zip" "v2rayN-${OutputArchArm}-desktop.zip" + + - name: Upload zip archive to release + uses: svenstaro/upload-release-action@v2 + if: github.event.inputs.release_tag != '' + with: + file: ${{ github.workspace }}/v2rayN*.zip + tag: ${{ github.event.inputs.release_tag }} + file_glob: true + prerelease: true From 32a5cc8aa362ca09c9fb7f361c9ed753a28b1e5f Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 17 Feb 2025 12:27:00 +0800 Subject: [PATCH 2/2] Check for avalonia desktop windows version --- v2rayN/ServiceLib/Services/UpdateService.cs | 32 ++++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index 428a136b..47112c8d 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -427,22 +427,32 @@ namespace ServiceLib.Services { if (Utils.IsWindows()) { - //Check for standalone windows .Net version - if (coreInfo?.CoreType == ECoreType.v2rayN && RuntimeInformation.ProcessArchitecture == Architecture.X64) - { - var runtimes = await Utils.GetCliWrapOutput("dotnet", "--list-runtimes"); - if (runtimes == null || runtimes.Contains("Microsoft.WindowsDesktop.App 8") == false) - { - return coreInfo?.DownloadUrlWin64?.Replace(".zip", "-SelfContained.zip"); - } - } - - return RuntimeInformation.ProcessArchitecture switch + var url = RuntimeInformation.ProcessArchitecture switch { Architecture.Arm64 => coreInfo?.DownloadUrlWinArm64, Architecture.X64 => coreInfo?.DownloadUrlWin64, _ => null, }; + + if (coreInfo?.CoreType != ECoreType.v2rayN) + { + return url; + } + + //Check for standalone windows .Net version + if (File.Exists(Path.Combine(Utils.GetBaseDirectory(), "wpfgfx_cor3.dll")) + && File.Exists(Path.Combine(Utils.GetBaseDirectory(), "D3DCompiler_47_cor3.dll"))) + { + return url?.Replace(".zip", "-SelfContained.zip"); + } + + //Check for avalonia desktop windows version + if (File.Exists(Path.Combine(Utils.GetBaseDirectory(), "libHarfBuzzSharp.dll"))) + { + return url?.Replace(".zip", "-desktop.zip"); + } + + return url; } else if (Utils.IsLinux()) {