From dae495b102e3cd15648b10dab810f0d81f20d9db Mon Sep 17 00:00:00 2001 From: Hendrik Mennen Date: Tue, 19 Mar 2024 11:55:09 +0100 Subject: [PATCH] fix --- src/OneWare.Ghdl/Services/GhdlService.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/OneWare.Ghdl/Services/GhdlService.cs b/src/OneWare.Ghdl/Services/GhdlService.cs index 45c5604..6a731df 100644 --- a/src/OneWare.Ghdl/Services/GhdlService.cs +++ b/src/OneWare.Ghdl/Services/GhdlService.cs @@ -62,7 +62,8 @@ public GhdlService(ILogger logger, IDockService dockService, ISettingsService se private async Task<(bool success, string output)> ExecuteGhdlAsync(IReadOnlyCollection arguments, string workingDirectory, string status, AppState state = AppState.Loading, bool showTimer = false) { - if (!File.Exists(_path)) + if (!File.Exists(_path) || (_settingsService.GetSettingValue("Experimental_AutoDownloadBinaries") && + _packageService.Packages.GetValueOrDefault(GhdlModule.GhdlPackage.Id!) is {Status: PackageStatus.Available or PackageStatus.UpdateAvailable or PackageStatus.Installing})) { var install = await InstallGhdlAsync(); if (!install) return (false,string.Empty); @@ -86,13 +87,10 @@ private async Task InstallGhdlAsync() { if (!_settingsService.GetSettingValue("Experimental_AutoDownloadBinaries")) return false; if(!await _packageService.InstallAsync(GhdlModule.GhdlPackage)) return false; - } - var result = await _packageService.InstallAsync(GhdlModule.GhdlPackage); - if (result) - { SetEnvironment(); return true; } + return false; }