Skip to content

Commit

Permalink
Using native standalone Linux skia sharp libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
BAndysc committed Oct 16, 2021
1 parent ba0e5b1 commit be7ada7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 20 additions & 2 deletions WDE.Updater/Services/StandaloneUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Diagnostics;
using System.IO;
using WDE.Common.Services;
using WDE.Common.Services.MessageBox;
using WDE.Common.Utils;
using WDE.Module.Attributes;

namespace WDE.Updater.Services
Expand All @@ -11,11 +14,13 @@ public class StandaloneUpdater : IStandaloneUpdater
{
private readonly IAutoUpdatePlatformService platform;
private readonly IFileSystem fs;
private readonly IMessageBoxService messageBoxService;

public StandaloneUpdater(IAutoUpdatePlatformService platform, IFileSystem fs)
public StandaloneUpdater(IAutoUpdatePlatformService platform, IFileSystem fs, IMessageBoxService messageBoxService)
{
this.platform = platform;
this.fs = fs;
this.messageBoxService = messageBoxService;
}

public bool HasPendingUpdate()
Expand Down Expand Up @@ -59,7 +64,20 @@ private bool TryLaunch(string file)
{
if (File.Exists(file))
{
Process.Start(file);
try
{
Process.Start(file);
}
catch (Exception e)
{
messageBoxService.ShowDialog(new MessageBoxFactory<bool>()
.SetTitle("Updater")
.SetMainInstruction("Error while starting the updater")
.SetContent("While trying to start the updater, following error occured: " + e.Message +
".\n\nYou can try to run the Updater.exe (Updater on Linux) manually")
.WithOkButton(true)
.Build()).ListenErrors();
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageReference Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)" />
<PackageReference Include="Prism.Core" Version="7.2.0.1422" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.0-preview.127" />
<PackageReference Include="SmartFormat.NET" Version="2.5.3" />
<PackageReference Include="HarfBuzzSharp" Version="2.8.2-preview.127" />
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.127" />
Expand Down

0 comments on commit be7ada7

Please sign in to comment.