From 0cbd073d9e7dc2383a738500a292fc8139a0cef0 Mon Sep 17 00:00:00 2001 From: Vichingo455 Date: Thu, 23 Oct 2025 08:58:08 +0200 Subject: [PATCH] work with some things --- Perfect11/Form1.cs | 2 + Perfect11/Library/Utilities.cs | 35 +++++++ Perfect11/Perfect11.csproj | 3 + Perfect11/packages.config | 1 + .../Perfect11.Inbox.Spotlight.csproj | 2 +- .../Properties/AssemblyInfo.cs | 8 +- tweaks/Perfect11.Inbox.Spotlight/Tweak.cs | 92 ++++++++++++++++++- 7 files changed, 136 insertions(+), 7 deletions(-) diff --git a/Perfect11/Form1.cs b/Perfect11/Form1.cs index 9eba2e3..4ee7eb6 100644 --- a/Perfect11/Form1.cs +++ b/Perfect11/Form1.cs @@ -36,7 +36,9 @@ namespace Perfect11 welcomePage.Theme = ThemeStyle.Dark; debloatPage.Theme = ThemeStyle.Dark; poisonLabel1.Theme = ThemeStyle.Dark; + poisonLabel1.ForeColor = Color.FromArgb(255,255,255); poisonLabel2.Theme = ThemeStyle.Dark; + poisonLabel2.ForeColor = Color.FromArgb(255, 255, 255); LblInstalledCount.Theme = ThemeStyle.Dark; LblRemoveCount.Theme = ThemeStyle.Dark; LstUWP.Theme = ThemeStyle.Dark; diff --git a/Perfect11/Library/Utilities.cs b/Perfect11/Library/Utilities.cs index d13eb5b..a21d509 100644 --- a/Perfect11/Library/Utilities.cs +++ b/Perfect11/Library/Utilities.cs @@ -1,4 +1,5 @@ using Microsoft.Win32; +using Newtonsoft.Json; using Perfect11.TweaksInterface; using System; using System.Collections.Generic; @@ -10,6 +11,12 @@ using System.Security.Principal; namespace Perfect11.Library { + public class AppInfo + { + public string Name { get; set; } + public string Id { get; set; } + public bool Install { get; set; } + } public class Utilities { public static bool IsWindows11() @@ -112,5 +119,33 @@ namespace Perfect11.Library string languageCode = CultureInfo.CurrentUICulture.Name; return languageCode.ToLower(); } + public static List LoadApps(string resourceName) + { + var assembly = Assembly.GetExecutingAssembly(); + + using (Stream stream = assembly.GetManifestResourceStream(resourceName)) + { + if (stream == null) + { + Console.WriteLine("❌ Risorsa non trovata: " + resourceName); + return new List(); + } + + using (StreamReader reader = new StreamReader(stream)) + { + string json = reader.ReadToEnd(); + try + { + var apps = JsonConvert.DeserializeObject>(json); + return apps ?? new List(); + } + catch (Exception ex) + { + Console.WriteLine("❌ Errore parsing JSON: " + ex.Message); + return new List(); + } + } + } + } } } diff --git a/Perfect11/Perfect11.csproj b/Perfect11/Perfect11.csproj index 6b7e615..c4a1aef 100644 --- a/Perfect11/Perfect11.csproj +++ b/Perfect11/Perfect11.csproj @@ -60,6 +60,9 @@ + + ..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll + ..\packages\ReaLTaiizor.3.8.1.3\lib\net48\ReaLTaiizor.dll diff --git a/Perfect11/packages.config b/Perfect11/packages.config index 8e37c80..211862b 100644 --- a/Perfect11/packages.config +++ b/Perfect11/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj b/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj index 9b0324e..ef9b420 100644 --- a/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj +++ b/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj @@ -23,7 +23,7 @@ 4 - pdbonly + none true bin\Release\ TRACE diff --git a/tweaks/Perfect11.Inbox.Spotlight/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.Spotlight/Properties/AssemblyInfo.cs index 55360e3..0254ebd 100644 --- a/tweaks/Perfect11.Inbox.Spotlight/Properties/AssemblyInfo.cs +++ b/tweaks/Perfect11.Inbox.Spotlight/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Perfect11.Inbox.Spotlight")] +[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Perfect11.Inbox.Spotlight")] -[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyCompany("Vichingo455")] +[assembly: AssemblyProduct("Perfect11")] +[assembly: AssemblyCopyright("Copyright © 2025 Vichingo455")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/tweaks/Perfect11.Inbox.Spotlight/Tweak.cs b/tweaks/Perfect11.Inbox.Spotlight/Tweak.cs index 2c90f9c..ee0d635 100644 --- a/tweaks/Perfect11.Inbox.Spotlight/Tweak.cs +++ b/tweaks/Perfect11.Inbox.Spotlight/Tweak.cs @@ -1,9 +1,10 @@ -using Perfect11.TweaksInterface; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Win32; +using Perfect11.TweaksInterface; namespace Perfect11.Inbox.Spotlight { @@ -14,7 +15,94 @@ namespace Perfect11.Inbox.Spotlight public string Category => "Annoyances"; public string Execute() { + bool IsNotWindowsSpotlight() + { + const string keyPath = @"SOFTWARE\Policies\Microsoft\Windows\CloudContent"; + const string valueName = "DisableWindowsSpotlightFeatures"; + try + { + using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyPath)) + { + if (key == null) + return false; + + object value = key.GetValue(valueName); + if (value == null) + return false; + if (value is int intValue) + return intValue == 1; + + string stringValue = value.ToString(); + if (int.TryParse(stringValue, out int parsed)) + return parsed == 1; + + return false; + } + } + catch (Exception) + { + return false; + } + } + if (!IsNotWindowsSpotlight()) + { + using (var key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Policies\Microsoft\Windows\CloudContent")) + { + key?.SetValue("DisableCloudOptimizedContent", 1, RegistryValueKind.DWord); + } + using (var key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Policies\Microsoft\Windows\CloudContent")) + { + key?.SetValue("DisableWindowsSpotlightFeatures", 1, RegistryValueKind.DWord); + key?.SetValue("DisableWindowsSpotlightWindowsWelcomeExperience", 1, RegistryValueKind.DWord); + key?.SetValue("DisableWindowsSpotlightOnActionCenter", 1, RegistryValueKind.DWord); + key?.SetValue("DisableWindowsSpotlightOnSettings", 1, RegistryValueKind.DWord); + key?.SetValue("DisableThirdPartySuggestions", 1, RegistryValueKind.DWord); + } + using (var key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager")) + { + key?.SetValue("ContentDeliveryAllowed", 0, RegistryValueKind.DWord); + key?.SetValue("FeatureManagementEnabled", 0, RegistryValueKind.DWord); + key?.SetValue("SubscribedContentEnabled", 0, RegistryValueKind.DWord); + key?.SetValue("SubscribedContent-338387Enabled", 0, RegistryValueKind.DWord); + key?.SetValue("RotatingLockScreenOverlayEnabled", 0, RegistryValueKind.DWord); + } + using (var key = Registry.CurrentUser.CreateSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel")) + { + key?.SetValue("{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", 1, RegistryValueKind.DWord); + } + return "Spotlight was disabled successfully."; + } + else + { + using (var key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Policies\Microsoft\Windows\CloudContent")) + { + key.DeleteValue("DisableCloudOptimizedContent", false); + } + using (var key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Policies\Microsoft\Windows\CloudContent")) + { + key.DeleteValue("DisableWindowsSpotlightFeatures", false); + key.DeleteValue("DisableWindowsSpotlightWindowsWelcomeExperience", false); + key.DeleteValue("DisableWindowsSpotlightOnActionCenter", false); + key.DeleteValue("DisableWindowsSpotlightOnSettings", false); + key.DeleteValue("DisableThirdPartySuggestions", false); + } + using (var key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager")) + { + key.DeleteValue("ContentDeliveryAllowed", false); + key.DeleteValue("FeatureManagementEnabled", false); + key.DeleteValue("SubscribedContentEnabled", false); + key.DeleteValue("SubscribedContent-338387Enabled", false); + key.DeleteValue("RotatingLockScreenOverlayEnabled", false); + } + using (var key = Registry.CurrentUser.CreateSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel")) + { + key.DeleteValue("{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", false); + } + return "Spotlight was enabled successfully."; + } } } }