diff --git a/UpTool2/MainForm.cs b/UpTool2/MainForm.cs index cef93fe..ea2ff44 100644 --- a/UpTool2/MainForm.cs +++ b/UpTool2/MainForm.cs @@ -10,11 +10,8 @@ using UpTool2.Task; using UpToolLib; using UpToolLib.DataStructures; using UpToolLib.Tool; - -#if DEBUG using System.Threading; using System.Diagnostics; -#endif namespace UpTool2 { @@ -227,7 +224,6 @@ namespace UpTool2 private void UpdateSidebarV(object sender, EventArgs e) { -#if DEBUG if (searchBox.Text == "!DEBUG:PRINT!") { searchBox.Text = "!DEBUG:PRINT"; @@ -246,20 +242,17 @@ namespace UpTool2 } else { -#endif - App[] apps = AppExtras.FindApps(searchBox.Text); - Enum.TryParse(filterBox.SelectedValue.ToString(), out Status status); - for (int i = 0; i < sidebarPanel.Controls.Count; i++) - { - Panel sidebarIcon = (Panel) sidebarPanel.Controls[i]; - App app = (App) sidebarIcon.Tag; - sidebarIcon.Visible = apps.Contains(app) && - ((int) app.Status & (int) (Program.Online ? status : Status.Installed)) != 0; + App[] apps = AppExtras.FindApps(searchBox.Text); + Enum.TryParse(filterBox.SelectedValue.ToString(), out Status status); + for (int i = 0; i < sidebarPanel.Controls.Count; i++) + { + Panel sidebarIcon = (Panel) sidebarPanel.Controls[i]; + App app = (App) sidebarIcon.Tag; + sidebarIcon.Visible = apps.Contains(app) && + ((int) app.Status & (int) (Program.Online ? status : Status.Installed)) != 0; + } + ClearSelection(); } - ClearSelection(); -#if DEBUG - } -#endif } private void MainForm_Load(object sender, EventArgs e) diff --git a/UpToolCLI/CacheManagement.cs b/UpToolCLI/CacheManagement.cs index f6c333a..f4d6629 100644 --- a/UpToolCLI/CacheManagement.cs +++ b/UpToolCLI/CacheManagement.cs @@ -91,12 +91,10 @@ namespace UpToolCLI ? "All up-to-date" : $@"Found {updatableCount} Updates: {string.Join(Environment.NewLine, apps.Select(s => $"- {s.Name} ({s.Version})"))}"); -#if !DEBUG Version vLocal = Assembly.GetExecutingAssembly().GetName().Version; Version vOnline = UpdateCheck.OnlineVersion; if (vLocal < vOnline) Console.WriteLine($"uptool is outdated ({vLocal} vs {vOnline}), update using \"uptool upgrade-self\""); -#endif } } } \ No newline at end of file diff --git a/UpToolCLI/Other.cs b/UpToolCLI/Other.cs index 9b22a2c..0d446e6 100644 --- a/UpToolCLI/Other.cs +++ b/UpToolCLI/Other.cs @@ -38,9 +38,6 @@ namespace UpToolCLI public static void UpgradeSelf(bool force) { -#if DEBUG - Console.WriteLine("Not enabled in debug builds"); -#else if (!force && Assembly.GetExecutingAssembly().GetName().Version >= UpdateCheck.OnlineVersion) Console.WriteLine("Already up-to-date"); else @@ -77,7 +74,6 @@ Online: {UpdateCheck.InstallerHash}"); UseShellExecute = false }); } -#endif } private static void Start(string identifier, string arguments, string file, bool waitForExit) diff --git a/UpToolCLI/PackageManagement.cs b/UpToolCLI/PackageManagement.cs index 63a6e83..7c9b926 100644 --- a/UpToolCLI/PackageManagement.cs +++ b/UpToolCLI/PackageManagement.cs @@ -179,13 +179,11 @@ namespace UpToolCLI Console.WriteLine($"Updating {app.Value.Name}"); AppExtras.Update(app.Value, false); } -#if !DEBUG if (Assembly.GetExecutingAssembly().GetName().Version < UpdateCheck.OnlineVersion) { Console.WriteLine("Updating self"); Other.UpgradeSelf(false); } -#endif Console.WriteLine("Done!"); } }