|
|
@ -96,19 +96,17 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
result.EnsureSuccessExitCode(); |
|
|
|
result.EnsureSuccessExitCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<string> GetGitOutput(string? workingDirectory = null, params string[] args) |
|
|
|
public Task<ProcessResult> GetGitOutput(ProcessArgs args, string? workingDirectory = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var process = await ProcessRunner.GetProcessOutputAsync( |
|
|
|
return ProcessRunner.GetProcessResultAsync( |
|
|
|
GitExePath, |
|
|
|
GitExePath, |
|
|
|
string.Join(" ", args), |
|
|
|
args, |
|
|
|
workingDirectory: workingDirectory, |
|
|
|
workingDirectory: workingDirectory, |
|
|
|
environmentVariables: new Dictionary<string, string> |
|
|
|
environmentVariables: new Dictionary<string, string> |
|
|
|
{ |
|
|
|
{ |
|
|
|
{ "PATH", Compat.GetEnvPathWithExtensions(GitBinPath) } |
|
|
|
{ "PATH", Compat.GetEnvPathWithExtensions(GitBinPath) } |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return process; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task InstallAllIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
public async Task InstallAllIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
@ -122,15 +120,9 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
public async Task UnpackResourcesIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
public async Task UnpackResourcesIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Array of (asset_uri, extract_to) |
|
|
|
// Array of (asset_uri, extract_to) |
|
|
|
var assets = new[] |
|
|
|
var assets = new[] { (Assets.SevenZipExecutable, AssetsDir), (Assets.SevenZipLicense, AssetsDir), }; |
|
|
|
{ |
|
|
|
|
|
|
|
(Assets.SevenZipExecutable, AssetsDir), |
|
|
|
|
|
|
|
(Assets.SevenZipLicense, AssetsDir), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress?.Report( |
|
|
|
progress?.Report(new ProgressReport(0, message: "Unpacking resources", isIndeterminate: true)); |
|
|
|
new ProgressReport(0, message: "Unpacking resources", isIndeterminate: true) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Directory.CreateDirectory(AssetsDir); |
|
|
|
Directory.CreateDirectory(AssetsDir); |
|
|
|
foreach (var (asset, extractDir) in assets) |
|
|
|
foreach (var (asset, extractDir) in assets) |
|
|
@ -138,9 +130,7 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
await asset.ExtractToDir(extractDir); |
|
|
|
await asset.ExtractToDir(extractDir); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
progress?.Report( |
|
|
|
progress?.Report(new ProgressReport(1, message: "Unpacking resources", isIndeterminate: false)); |
|
|
|
new ProgressReport(1, message: "Unpacking resources", isIndeterminate: false) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task InstallPythonIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
public async Task InstallPythonIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
@ -262,11 +252,7 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
if (!Directory.Exists(TkinterExistsPath)) |
|
|
|
if (!Directory.Exists(TkinterExistsPath)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Logger.Info("Downloading Tkinter"); |
|
|
|
Logger.Info("Downloading Tkinter"); |
|
|
|
await downloadService.DownloadToFileAsync( |
|
|
|
await downloadService.DownloadToFileAsync(TkinterDownloadUrl, TkinterZipPath, progress: progress); |
|
|
|
TkinterDownloadUrl, |
|
|
|
|
|
|
|
TkinterZipPath, |
|
|
|
|
|
|
|
progress: progress |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
progress?.Report( |
|
|
|
progress?.Report( |
|
|
|
new ProgressReport( |
|
|
|
new ProgressReport( |
|
|
|
progress: 1f, |
|
|
|
progress: 1f, |
|
|
@ -281,11 +267,7 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
progress?.Report( |
|
|
|
progress?.Report( |
|
|
|
new ProgressReport( |
|
|
|
new ProgressReport(progress: 1f, message: "Tkinter install complete", type: ProgressType.Generic) |
|
|
|
progress: 1f, |
|
|
|
|
|
|
|
message: "Tkinter install complete", |
|
|
|
|
|
|
|
type: ProgressType.Generic |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -319,10 +301,7 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
public async Task InstallVcRedistIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
public async Task InstallVcRedistIfNecessary(IProgress<ProgressReport>? progress = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var registry = Registry.LocalMachine; |
|
|
|
var registry = Registry.LocalMachine; |
|
|
|
var key = registry.OpenSubKey( |
|
|
|
var key = registry.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64", false); |
|
|
|
@"SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64", |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (key != null) |
|
|
|
if (key != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var buildId = Convert.ToUInt32(key.GetValue("Bld")); |
|
|
|
var buildId = Convert.ToUInt32(key.GetValue("Bld")); |
|
|
@ -356,10 +335,7 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper |
|
|
|
message: "Installing prerequisites..." |
|
|
|
message: "Installing prerequisites..." |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
var process = ProcessRunner.StartAnsiProcess( |
|
|
|
var process = ProcessRunner.StartAnsiProcess(VcRedistDownloadPath, "/install /quiet /norestart"); |
|
|
|
VcRedistDownloadPath, |
|
|
|
|
|
|
|
"/install /quiet /norestart" |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
await process.WaitForExitAsync(); |
|
|
|
await process.WaitForExitAsync(); |
|
|
|
progress?.Report( |
|
|
|
progress?.Report( |
|
|
|
new ProgressReport( |
|
|
|
new ProgressReport( |
|
|
|