public MainWindow() { try { InitializeComponent(); DataGridRnaSeqFastq.DataContext = RnaSeqFastqCollection; WorkflowTreeView.DataContext = StaticTasksObservableCollection; LbxSRAs.ItemsSource = SraCollection; // Version information try { SpritzUpdater.GetVersionNumbersFromWeb(); } catch (Exception e) { MessageBox.Show("Could not get newest version from web: " + e.Message, "Setup", MessageBoxButton.OK, MessageBoxImage.Warning); } // Check Docker setup Dispatcher.Invoke(() => { Process proc = new Process(); proc.StartInfo.FileName = "Powershell.exe"; proc.StartInfo.Arguments = "docker system info"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.CreateNoWindow = true; proc.Start(); StreamReader outputReader = proc.StandardOutput; DockerSystemInfo = outputReader.ReadToEnd(); proc.WaitForExit(); }); bool isDockerInstalled = !string.IsNullOrEmpty(DockerSystemInfo) && !DockerSystemInfo.Contains("error", StringComparison.InvariantCultureIgnoreCase); if (isDockerInstalled) { ParseDockerSystemInfo(DockerSystemInfo); } string message = isDockerInstalled ? "In Docker Desktop, please ensure all shared drives are enabled, and please ensure a Disk image size of at least 80 GB is enabled." : "Docker is not running or not installed. Please have Docker Desktop installed and running, enable all shared drives, and ensure a Disk image size of at least 80 GB is enabled."; if (isDockerInstalled && DockerMemory < 16) { message += $"{Environment.NewLine}{Environment.NewLine}The memory allocated to Docker is low ({DockerMemory}GB). Please raise this value above 16 GB in Docker Desktop if possible."; } MessageBox.Show(message, "Setup", MessageBoxButton.OK, isDockerInstalled ? MessageBoxImage.Information : MessageBoxImage.Error); } catch (Exception e) { MessageBox.Show($"ERROR: {e.Message}", "Initialization Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (SpritzUpdater.NewestKnownVersion != null && !SpritzUpdater.IsVersionLower(SpritzUpdater.NewestKnownVersion)) { try { SpritzUpdater newwind = new SpritzUpdater(); newwind.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }