|
|
@ -20,14 +20,16 @@ using StabilityMatrix.Core.Services; |
|
|
|
namespace StabilityMatrix.Avalonia.Helpers; |
|
|
|
namespace StabilityMatrix.Avalonia.Helpers; |
|
|
|
|
|
|
|
|
|
|
|
[SupportedOSPlatform("windows")] |
|
|
|
[SupportedOSPlatform("windows")] |
|
|
|
public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
public class WindowsPrerequisiteHelper( |
|
|
|
|
|
|
|
IGitHubClient gitHubClient, |
|
|
|
|
|
|
|
IDownloadService downloadService, |
|
|
|
|
|
|
|
ISettingsManager settingsManager, |
|
|
|
|
|
|
|
IPyRunner pyRunner |
|
|
|
|
|
|
|
) : IPrerequisiteHelper |
|
|
|
{ |
|
|
|
{ |
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); |
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); |
|
|
|
|
|
|
|
|
|
|
|
private readonly IGitHubClient gitHubClient; |
|
|
|
private readonly IGitHubClient gitHubClient = gitHubClient; |
|
|
|
private readonly IDownloadService downloadService; |
|
|
|
|
|
|
|
private readonly ISettingsManager settingsManager; |
|
|
|
|
|
|
|
private readonly IPyRunner pyRunner; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private const string VcRedistDownloadUrl = "https://aka.ms/vs/16/release/vc_redist.x64.exe"; |
|
|
|
private const string VcRedistDownloadUrl = "https://aka.ms/vs/16/release/vc_redist.x64.exe"; |
|
|
|
private const string TkinterDownloadUrl = |
|
|
|
private const string TkinterDownloadUrl = |
|
|
@ -62,19 +64,6 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
public string GitBinPath => Path.Combine(PortableGitInstallDir, "bin"); |
|
|
|
public string GitBinPath => Path.Combine(PortableGitInstallDir, "bin"); |
|
|
|
public bool IsPythonInstalled => File.Exists(PythonDllPath); |
|
|
|
public bool IsPythonInstalled => File.Exists(PythonDllPath); |
|
|
|
|
|
|
|
|
|
|
|
public WindowsPrerequisiteHelper( |
|
|
|
|
|
|
|
IGitHubClient gitHubClient, |
|
|
|
|
|
|
|
IDownloadService downloadService, |
|
|
|
|
|
|
|
ISettingsManager settingsManager, |
|
|
|
|
|
|
|
IPyRunner pyRunner |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.gitHubClient = gitHubClient; |
|
|
|
|
|
|
|
this.downloadService = downloadService; |
|
|
|
|
|
|
|
this.settingsManager = settingsManager; |
|
|
|
|
|
|
|
this.pyRunner = pyRunner; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task RunGit( |
|
|
|
public async Task RunGit( |
|
|
|
ProcessArgs args, |
|
|
|
ProcessArgs args, |
|
|
|
Action<ProcessOutput>? onProcessOutput, |
|
|
|
Action<ProcessOutput>? onProcessOutput, |
|
|
@ -166,6 +155,11 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
{ |
|
|
|
{ |
|
|
|
await InstallNodeIfNecessary(progress); |
|
|
|
await InstallNodeIfNecessary(progress); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prerequisites.Contains(PackagePrerequisite.Tkinter)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await InstallTkinterIfNecessary(progress); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task InstallAllIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
public async Task InstallAllIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|