diff --git a/GPUPrefSwitcher/Switcher.cs b/GPUPrefSwitcher/Switcher.cs index 9c3055d..59f28fc 100644 --- a/GPUPrefSwitcher/Switcher.cs +++ b/GPUPrefSwitcher/Switcher.cs @@ -230,10 +230,11 @@ private static async Task RunUpdateLogic() WriteRegistryToXML(); } - WriteXMLToRegistry(currentPowerLineStatus); - + //This NEEDS to come before (XML -> Registry) and after (Registry -> XML) (XML -> Registry depends on this) UpdateSeenInRegistryStatuses(); //sets the SeenInRegistry entry accordingly + WriteXMLToRegistry(currentPowerLineStatus); + AppEntrySaveHandler appEntrySaveHandler = await appEntryLibrarian.Borrow(); Task swaps = BeginFileSwapLogic(currentPowerLineStatus, appEntrySaveHandler.CurrentAppEntries); appEntryLibrarian.Return(appEntrySaveHandler); @@ -491,7 +492,7 @@ internal static void WriteXMLToRegistry(PowerLineStatus powerLineStatus) foreach (AppEntry appEntry in appEntries) { - if (appEntry.PendingAddToRegistry) + if (appEntry.PendingAddToRegistry && !appEntry.SeenInRegistry) { Logger.inst.Log($"Pending registry add detected: {appEntry.AppPath}");