From ab7eb4687cf8da2e8e1a4156625b4c24ae11e5c2 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Sat, 23 Oct 2021 15:39:12 +1300 Subject: [PATCH] Update warning message to include 2.0 to 2.1 upgrade Unfortunately with the number of DisplayProfile changes I've had to make I am going to have to force people to recreate their DisplayProfiles again :(. This is neeed so that I can support cloned displays and HDR and basic colour settings. This has all taken a lot of working out, but I can't convert the old DisplayProfiles format to the new one as there is just too much missing data in there. --- DisplayMagician/Program.cs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/DisplayMagician/Program.cs b/DisplayMagician/Program.cs index 21e3f57..7c00fe4 100644 --- a/DisplayMagician/Program.cs +++ b/DisplayMagician/Program.cs @@ -236,14 +236,14 @@ namespace DisplayMagician { // Check if it's an upgrade from DisplayMagician v1 to v2 // and if it is then copy the old configs to the new filenames and // explain to the user what they need to do. - // e.g. DisplayProfiles_1.0.json exists, but DisplayProfiles_2.0.json doesn't - if (File.Exists(Path.Combine(AppProfilePath, "DisplayProfiles_1.0.json")) && !File.Exists(Path.Combine(AppProfilePath, "DisplayProfiles_2.0.json"))) + // e.g. DisplayProfiles_1.0.json exists, but DisplayProfiles_2.1.json doesn't + if (File.Exists(Path.Combine(AppProfilePath, "DisplayProfiles_1.0.json")) && !File.Exists(Path.Combine(AppProfilePath, "DisplayProfiles_2.1.json"))) { - logger.Info($"Program/Main: This is an upgrade from DisplayMagician v1 to DisplayMagician v2, so performing some upgrade steps."); + logger.Info($"Program/Main: This is an upgrade from DisplayMagician v1.0 to DisplayMagician v2.1, so performing some upgrade steps."); // Note whether we copied the old Settings file to the new v2 name earlier (before the logging was enabled) if (upgradedSettingsFile) { - logger.Info($"Program/Main: Upgraded v1 settings file {oldSettingsFile} to v2 settings file {newSettingsFile} earlier in loading process (before logging service was available)."); + logger.Info($"Program/Main: Upgraded v1.0 settings file {oldSettingsFile} to v2.0 settings file {newSettingsFile} earlier in loading process (before logging service was available)."); } // Copy the old Game Shortcuts file to the new v2 name @@ -259,14 +259,29 @@ namespace DisplayMagician { } catch(Exception ex) { - logger.Error(ex, $"Program/Main: Exception upgrading v1 shortcut file {oldShortcutsFile} to v2 shortcut file {ShortcutRepository.ShortcutStorageFileName}."); + logger.Error(ex, $"Program/Main: Exception upgrading v1.0 shortcut file {oldShortcutsFile} to v2.0 shortcut file {ShortcutRepository.ShortcutStorageFileName}."); } // Warn the user about the fact we need a new DisplayProfiles_2.0.json StartMessageForm myMessageWindow = new StartMessageForm(); myMessageWindow.MessageMode = "rtf"; myMessageWindow.URL = "https://displaymagician.littlebitbig.com/messages/DisplayMagician1to2.rtf"; - myMessageWindow.HeadingText = "DisplayMagician v2.0.0 Upgrade Warning"; + myMessageWindow.HeadingText = "DisplayMagician v2.1.0 Upgrade Warning"; + myMessageWindow.ButtonText = "&Close"; + myMessageWindow.ShowDialog(); + } + // Check if it's an upgrade from DisplayMagician v2.0 to v2.1 + // and if it is then copy the old configs to the new filenames and + // explain to the user what they need to do. + // e.g. DisplayProfiles_2.1.json exists, but DisplayProfiles_2.0.json doesn't + else if (File.Exists(Path.Combine(AppProfilePath, "DisplayProfiles_2.0.json")) && !File.Exists(Path.Combine(AppProfilePath, "DisplayProfiles_2.1.json"))) + { + logger.Info($"Program/Main: This is an upgrade from DisplayMagician v2.0 to DisplayMagician v2.1, so performing some upgrade steps."); + // Warn the user about the fact we need a new DisplayProfiles_2.0.json + StartMessageForm myMessageWindow = new StartMessageForm(); + myMessageWindow.MessageMode = "rtf"; + myMessageWindow.URL = "https://displaymagician.littlebitbig.com/messages/DisplayMagician2.0to2.1.rtf"; + myMessageWindow.HeadingText = "DisplayMagician v2.1.0 Upgrade Warning"; myMessageWindow.ButtonText = "&Close"; myMessageWindow.ShowDialog(); }