Skip to content

Commit

Permalink
In-app update alone package
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Sep 6, 2024
1 parent 8be1730 commit 9c7446f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions v2rayN/ServiceLib/Handler/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,15 @@ private async Task<ResultEventArgs> ParseDownloadUrl(ECoreType type, string gitH
{
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,
Expand Down
18 changes: 9 additions & 9 deletions v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ void _updateUI(bool success, string msg)

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)
{
Expand Down

0 comments on commit 9c7446f

Please sign in to comment.