mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Fix auto-upgrade for AppImage
Trying to execute before make sure chmod is applied
This commit is contained in:
@@ -13,6 +13,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
|
||||
namespace UVtools.Core.SystemOS;
|
||||
|
||||
@@ -240,11 +241,13 @@ public static class SystemAware
|
||||
|
||||
}
|
||||
|
||||
public static void StartProcess(string name, string? arguments = null)
|
||||
public static void StartProcess(string name, string? arguments = null, bool waitForCompletion = false, int waitTimeout = Timeout.Infinite)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Process.Start(new ProcessStartInfo(name, arguments!) { UseShellExecute = true })) { }
|
||||
using var process = Process.Start(new ProcessStartInfo(name, arguments!) {UseShellExecute = true});
|
||||
if (process is null) return;
|
||||
if (waitForCompletion) process.WaitForExit(waitTimeout);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Net.Http.Headers;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using UVtools.Core;
|
||||
@@ -223,7 +224,8 @@ public class AppVersionChecker : BindableBase
|
||||
|
||||
if (File.Exists(appImagePath)) File.Delete(appImagePath);
|
||||
File.Move(DownloadedFile, newFullPath, true);
|
||||
SystemAware.StartProcess("chmod", $"a+x \"{newFullPath}\"");
|
||||
SystemAware.StartProcess("chmod", $"a+x \"{newFullPath}\"", true);
|
||||
Thread.Sleep(500);
|
||||
SystemAware.StartProcess(newFullPath);
|
||||
}
|
||||
else // others
|
||||
|
||||
Reference in New Issue
Block a user