diff --git a/GoAwayEdge.Helper.Package/GoAwayEdge.Helper.Package.assets.cache b/GoAwayEdge.Helper.Package/GoAwayEdge.Helper.Package.assets.cache new file mode 100644 index 0000000..ac9ed90 Binary files /dev/null and b/GoAwayEdge.Helper.Package/GoAwayEdge.Helper.Package.assets.cache differ diff --git a/GoAwayEdge.Helper.Package/GoAwayEdge.Helper.Package.wapproj.user b/GoAwayEdge.Helper.Package/GoAwayEdge.Helper.Package.wapproj.user new file mode 100644 index 0000000..b3cb3d6 --- /dev/null +++ b/GoAwayEdge.Helper.Package/GoAwayEdge.Helper.Package.wapproj.user @@ -0,0 +1,18 @@ + + + + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + C:\Users\jonas\Pictures\GoAwayEdge.png + SideloadOnly + False + x64|arm64 + False + + \ No newline at end of file diff --git a/GoAwayEdge.sln b/GoAwayEdge.sln index ba8f399..6beb6e7 100644 --- a/GoAwayEdge.sln +++ b/GoAwayEdge.sln @@ -31,34 +31,22 @@ Global {95F3960E-372B-45F3-85D8-CD06F4D8B271}.Release|x86.ActiveCfg = Release|Any CPU {95F3960E-372B-45F3-85D8-CD06F4D8B271}.Release|x86.Build.0 = Release|Any CPU {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Debug|ARM64.Build.0 = Debug|Any CPU {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Debug|x64.ActiveCfg = Debug|x64 - {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Debug|x64.Build.0 = Debug|x64 {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Debug|x86.ActiveCfg = Debug|x86 - {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Debug|x86.Build.0 = Debug|x86 {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Release|ARM64.ActiveCfg = Release|Any CPU - {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Release|ARM64.Build.0 = Release|Any CPU {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Release|x64.ActiveCfg = Release|x64 - {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Release|x64.Build.0 = Release|x64 {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Release|x86.ActiveCfg = Release|x86 - {A1CB967D-9105-47AF-BBB1-F2BA694014F1}.Release|x86.Build.0 = Release|x86 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|ARM64.Build.0 = Debug|ARM64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|ARM64.Deploy.0 = Debug|ARM64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|x64.ActiveCfg = Debug|x64 - {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|x64.Build.0 = Debug|x64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|x64.Deploy.0 = Debug|x64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|x86.ActiveCfg = Debug|x86 - {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|x86.Build.0 = Debug|x86 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Debug|x86.Deploy.0 = Debug|x86 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|ARM64.ActiveCfg = Release|ARM64 - {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|ARM64.Build.0 = Release|ARM64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|ARM64.Deploy.0 = Release|ARM64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|x64.ActiveCfg = Release|x64 - {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|x64.Build.0 = Release|x64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|x64.Deploy.0 = Release|x64 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|x86.ActiveCfg = Release|x86 - {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|x86.Build.0 = Release|x86 {6B1C2331-6097-4559-9D50-62D3E906E2E6}.Release|x86.Deploy.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution diff --git a/GoAwayEdge/App.xaml.cs b/GoAwayEdge/App.xaml.cs index bbe450e..9f9355c 100644 --- a/GoAwayEdge/App.xaml.cs +++ b/GoAwayEdge/App.xaml.cs @@ -50,7 +50,7 @@ public void Application_Startup(object sender, StartupEventArgs e) IsDebug = true; if (IsAdministrator() == false) { - ElevateAsAdmin(); + ElevateAsAdmin(); Environment.Exit(0); return; } @@ -70,7 +70,7 @@ public void Application_Startup(object sender, StartupEventArgs e) { if (IsAdministrator() == false) { - ElevateAsAdmin(string.Join(" ", args)); + ElevateAsAdmin(string.Join(" ", args)); Environment.Exit(0); return; } @@ -124,7 +124,7 @@ public void Application_Startup(object sender, StartupEventArgs e) if (IsAdministrator() == false) { - ElevateAsAdmin(string.Join(" ", args)); + ElevateAsAdmin(string.Join(" ", args)); Environment.Exit(0); return; } @@ -191,7 +191,7 @@ public void Application_Startup(object sender, StartupEventArgs e) ifeoMessageUi.ShowDialog(); if (ifeoMessageUi.Summary == "Btn1") - ElevateAsAdmin("--update"); + ElevateAsAdmin("--update"); Environment.Exit(0); } @@ -207,7 +207,7 @@ public void Application_Startup(object sender, StartupEventArgs e) ifeoMessageUi.ShowDialog(); if (ifeoMessageUi.Summary == "Btn1") - ElevateAsAdmin("--update"); + ElevateAsAdmin("--update"); Environment.Exit(0); } @@ -226,7 +226,7 @@ public void Application_Startup(object sender, StartupEventArgs e) Environment.Exit(0); } - private void ElevateAsAdmin(string arguments = null) + private static void ElevateAsAdmin(string? arguments = null) { // Restart program and run as admin var exeName = Process.GetCurrentProcess().MainModule?.FileName; diff --git a/GoAwayEdge/Common/Debugging/Logging.cs b/GoAwayEdge/Common/Debugging/Logging.cs index d4b7c83..b58f51b 100644 --- a/GoAwayEdge/Common/Debugging/Logging.cs +++ b/GoAwayEdge/Common/Debugging/Logging.cs @@ -37,12 +37,10 @@ public static void Initialize() // Fetching the current log file _logFile = Path.Combine(LogPath, $"log_{DateTime.Now:yyyy-MM-dd}.txt"); - if (!File.Exists(_logFile)) - { - var version = Assembly.GetExecutingAssembly().GetName().Version!; - Log($"GoAwayEdge {version.Major}.{version.Minor}.{version.Build} (Build {version.Revision})"); - Log("Logging system initialized"); - } + + var version = Assembly.GetExecutingAssembly().GetName().Version!; + Log($"GoAwayEdge {version.Major}.{version.Minor}.{version.Build} (Build {version.Revision})"); + Log("Logging system initialized"); // Delete old log files DeleteOldLogFiles(); diff --git a/GoAwayEdge/Common/Installation/Removal.cs b/GoAwayEdge/Common/Installation/Removal.cs index b778fbb..f728b61 100644 --- a/GoAwayEdge/Common/Installation/Removal.cs +++ b/GoAwayEdge/Common/Installation/Removal.cs @@ -139,6 +139,8 @@ public static bool RemoveMsEdge() } var edgeUpdateDevKey = Registry.LocalMachine.CreateSubKey($@"SOFTWARE{node}\Microsoft\EdgeUpdateDev"); edgeUpdateDevKey.SetValue("AllowUninstall", 1, RegistryValueKind.DWord); + var edgeUpdateKey = Registry.LocalMachine.CreateSubKey($@"SOFTWARE{node}\Microsoft\EdgeUpdate"); + edgeUpdateKey.SetValue("AllowUninstall", 1, RegistryValueKind.DWord); } } } @@ -233,19 +235,28 @@ public static bool RemoveMsEdge() timeoutStopwatch.Stop(); if (timeoutStopwatch.Elapsed.TotalSeconds >= 60) + { + Logging.Log("Removal of Edge Updater failed: Timeout after 60 seconds."); return false; // Timeout + } + if (proc.ExitCode != 0 && proc.ExitCode != 19) + { + Logging.Log($"Removal of Edge Updater failed: Unknown error has occurred (exited with error code {proc.ExitCode})"); return false; // Unknown error? + } } using (var proc = new Process()) // Remove Edge via setup file { + const string removalArgs = "--uninstall --msedge --system-level --verbose-logging --force-uninstall"; var psi = new ProcessStartInfo { FileName = edgeSetupPath, - Arguments = "--uninstall --msedge --system-level --verbose-logging --force-uninstall", + Arguments = removalArgs, RedirectStandardOutput = true }; + Logging.Log($"Executing \"{edgeSetupPath}\" {removalArgs}"); proc.StartInfo = psi; proc.Start(); proc.WaitForExit(); @@ -259,9 +270,16 @@ public static bool RemoveMsEdge() timeoutStopwatch.Stop(); if (timeoutStopwatch.Elapsed.TotalSeconds >= 60) + { + Logging.Log("Removal of Edge failed: Timeout after 60 seconds."); return false; // Timeout + } + if (proc.ExitCode != 0 && proc.ExitCode != 19) + { + Logging.Log($"Removal of Edge via Setup file failed: Unknown error has occurred (exited with error code {proc.ExitCode})"); return false; // Unknown error? + } } } } diff --git a/GoAwayEdge/Common/Installation/Updater.cs b/GoAwayEdge/Common/Installation/Updater.cs index 3fc89f5..d57f734 100644 --- a/GoAwayEdge/Common/Installation/Updater.cs +++ b/GoAwayEdge/Common/Installation/Updater.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.IO; using System.Net; +using System.Net.Http; using System.Reflection; using System.Security.Cryptography; using Microsoft.Toolkit.Uwp.Notifications; @@ -13,14 +14,14 @@ internal class Updater { public class GitHubRelease { - public string tag_name { get; set; } - public List assets { get; set; } + public string? tag_name { get; set; } + public List? assets { get; set; } } public class GitHubAsset { - public string browser_download_url { get; set; } - public string name { get; set; } + public string? browser_download_url { get; set; } + public string? name { get; set; } } @@ -143,15 +144,18 @@ public static void ModifyIfeoBinary(ModifyAction action) var appVersion = Assembly.GetExecutingAssembly().GetName().Version!; var currentVersion = new Version(appVersion.Major, appVersion.Minor, appVersion.Build); - using var client = new WebClient(); - client.Headers.Add("User-Agent", $"GoAwayEdge/{currentVersion} valnoxy.dev"); - var json = client.DownloadString(url); + using var client = new HttpClient(); + client.DefaultRequestHeaders.UserAgent.ParseAdd($"GoAwayEdge/{currentVersion} valnoxy.dev"); + + var response = client.GetAsync(url).Result; + response.EnsureSuccessStatusCode(); + var json = response.Content.ReadAsStringAsync().Result; var releases = JsonConvert.DeserializeObject(json); if (releases is { Length: > 0 }) { var tagName = Convert.ToString(releases[0].tag_name); - var tagVersion = tagName[1..]; + var tagVersion = tagName![1..]; var latestVersion = new Version(tagVersion); if (currentVersion < latestVersion) @@ -165,7 +169,7 @@ public static void ModifyIfeoBinary(ModifyAction action) return null; } } - + /// /// Download and run the new version of GoAwayEdge. /// @@ -178,29 +182,42 @@ public static bool UpdateClient() var appVersion = Assembly.GetExecutingAssembly().GetName().Version!; var currentVersion = new Version(appVersion.Major, appVersion.Minor, appVersion.Build); - using var client = new WebClient(); - client.Headers.Add("User-Agent", $"GoAwayEdge/{currentVersion} valnoxy.dev"); - var json = client.DownloadString(url); + using var client = new HttpClient(); + client.DefaultRequestHeaders.UserAgent.ParseAdd($"GoAwayEdge/{currentVersion} valnoxy.dev"); + + var response = client.GetAsync(url).Result; + response.EnsureSuccessStatusCode(); + var json = response.Content.ReadAsStringAsync().Result; var releases = JsonConvert.DeserializeObject(json); if (releases is { Length: > 0 }) { var assetUrl = string.Empty; - foreach (var asset in releases[0].assets.Where(asset => asset.name == "GoAwayEdge.exe")) + foreach (var asset in releases[0].assets!.Where(asset => asset.name == "GoAwayEdge.exe")) { assetUrl = asset.browser_download_url; } - - var tempFolder = Path.GetTempPath(); + if (string.IsNullOrEmpty(assetUrl)) { return false; } - if (File.Exists(Path.Combine(tempFolder, "GoAwayEdge.exe"))) - File.Delete(Path.Combine(tempFolder, "GoAwayEdge.exe")); - client.DownloadFile(assetUrl, Path.Combine(tempFolder, "GoAwayEdge.exe")); - Process.Start(Path.Combine(tempFolder, "GoAwayEdge.exe")); + var tempFolder = Path.GetTempPath(); + var tempFilePath = Path.Combine(tempFolder, "GoAwayEdge.exe"); + + if (File.Exists(tempFilePath)) + { + File.Delete(tempFilePath); + } + + using (var downloadStream = client.GetStreamAsync(assetUrl).Result) + using (var fileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.None)) + { + downloadStream.CopyTo(fileStream); + } + + Process.Start(new ProcessStartInfo(tempFilePath) { UseShellExecute = true }); return true; } } @@ -208,9 +225,11 @@ public static bool UpdateClient() { return false; } + return false; } + private static string CalculateMd5(string filename) { using var md5 = MD5.Create(); diff --git a/GoAwayEdge/Common/Localization.cs b/GoAwayEdge/Common/Localization.cs index 38cfea4..81dbfc6 100644 --- a/GoAwayEdge/Common/Localization.cs +++ b/GoAwayEdge/Common/Localization.cs @@ -57,7 +57,16 @@ public static string LocalizeValue(string value) try { var localizedValue = (string)Application.Current.Resources[value]!; - return string.IsNullOrEmpty(localizedValue) ? value : localizedValue; + + if (string.IsNullOrEmpty(localizedValue)) + return value; + + if (localizedValue.Contains("\\n")) + { + return localizedValue.Replace("\\n", "\n"); + } + + return localizedValue; } catch (Exception ex) { @@ -70,11 +79,17 @@ public static string LocalizeValue(string value, params object[]? args) { var localizedValue = LocalizeValue(value); - if (args is not { Length: > 0 }) return localizedValue; - + if (args is not { Length: > 0 }) + return localizedValue; + try { localizedValue = string.Format(localizedValue, args); + + if (localizedValue.Contains("\\n")) + { + localizedValue = localizedValue.Replace("\\n", "\n"); + } } catch (FormatException ex) { @@ -84,5 +99,6 @@ public static string LocalizeValue(string value, params object[]? args) return localizedValue; } + } } \ No newline at end of file diff --git a/GoAwayEdge/Common/Runtime/ArgumentParse.cs b/GoAwayEdge/Common/Runtime/ArgumentParse.cs index 39f644d..d28b3a3 100644 --- a/GoAwayEdge/Common/Runtime/ArgumentParse.cs +++ b/GoAwayEdge/Common/Runtime/ArgumentParse.cs @@ -48,7 +48,7 @@ public static void Parse(string[] args) { var appId = match.Groups[1].Value; Logging.Log($"Opening PWA App with ID {appId}"); - if (appId == copilotAppId) + if (appId == copilotAppId && Common.Configuration.AiProvider != AiProvider.Default) { DebugMessage.DisplayDebugMessage("GoAwayEdge", $"Opening AI Provider '{Configuration.AiProvider}' (PWA) ..."); UserInterface.CopilotDock.InterfaceManager.ShowDock(); diff --git a/GoAwayEdge/Common/Runtime/Weather.cs b/GoAwayEdge/Common/Runtime/Weather.cs index b045b10..2e1e1fd 100644 --- a/GoAwayEdge/Common/Runtime/Weather.cs +++ b/GoAwayEdge/Common/Runtime/Weather.cs @@ -9,11 +9,11 @@ public class Weather { public class GeoData { - public string L { get; set; } // City - public string R { get; set; } // Region - public string C { get; set; } // Country - public string I { get; set; } // Short Country code - public string G { get; set; } // Country code (lowercase) + public string? L { get; set; } // City + public string? R { get; set; } // Region + public string? C { get; set; } // Country + public string? I { get; set; } // Short Country code + public string? G { get; set; } // Country code (lowercase) public double X { get; set; } // longitude public double Y { get; set; } // latitude } @@ -42,7 +42,7 @@ public class GeoData var placeholders = new Dictionary { { "country-code", language }, - { "short-country-code", locObject.I }, + { "short-country-code", locObject.I! }, { "latitude", lat }, { "longitude", lon } }; diff --git a/GoAwayEdge/GoAwayEdge.csproj b/GoAwayEdge/GoAwayEdge.csproj index b70bedb..9c60563 100644 --- a/GoAwayEdge/GoAwayEdge.csproj +++ b/GoAwayEdge/GoAwayEdge.csproj @@ -12,7 +12,7 @@ GoAwayEdge Exploitox valnoxy - 2.0.0.257 + 2.0.0.258 Copyright © 2018 - 2025 Exploitox. All rights reserved. https://github.com/valnoxy/GoAwayEdge https://github.com/valnoxy/GoAwayEdge diff --git a/GoAwayEdge/Localization/ResourceDictionary.de-DE.xaml b/GoAwayEdge/Localization/ResourceDictionary.de-DE.xaml index 7f5c64b..46a2194 100644 --- a/GoAwayEdge/Localization/ResourceDictionary.de-DE.xaml +++ b/GoAwayEdge/Localization/ResourceDictionary.de-DE.xaml @@ -6,6 +6,8 @@ Ja Nein Standard + Warnung + Abbrechen Willkommen Das Installationsprogramm führt alle notwendigen Schritte durch, um GoAwayEdge auf Ihrem System zu installieren. Nach der Installation werden alle Edge-Aufrufe an Ihren Browser weitergeleitet. Bitte wählen Sie die gewünschte Option, um fortzufahren. @@ -35,6 +37,8 @@ Bitte geben Sie die Anfrage-URL der Suchmaschine ein. Microsoft Edge (Stabil) entfernen Entferne Microsoft Edge vollständig von Ihrem System. + Das Entfernen von Microsoft Edge kann zu schwerwiegenden Systemproblemen führen, da es tief in Windows integriert ist und für viele Funktionen, einschließlich Updates, Hilfedateien und einige Anwendungen, unerlässlich ist. Das Löschen kann zu Instabilität oder defekten Funktionen führen.\n\nFahren Sie nur fort, wenn Sie sich der Risiken bewusst sind und über eine zuverlässige Sicherung oder einen Wiederherstellungspunkt verfügen. + Microsoft Edge entfernen Installation läuft ... Bitte warten Sie, bis die Installation abgeschlossen ist. diff --git a/GoAwayEdge/Localization/ResourceDictionary.xaml b/GoAwayEdge/Localization/ResourceDictionary.xaml index 8e5db0b..8250d6c 100644 --- a/GoAwayEdge/Localization/ResourceDictionary.xaml +++ b/GoAwayEdge/Localization/ResourceDictionary.xaml @@ -8,6 +8,8 @@ Yes No Default + Warning + Cancel Welcome @@ -43,6 +45,8 @@ Remove Microsoft Edge completely from the system. Install Control Panel Install the Control Panel to configure GoAwayEdge more easily. + Removing Microsoft Edge can cause serious system issues, as it’s deeply integrated into Windows and essential for many features, including updates, help files, and some apps. Deleting it could result in instability or broken functionality.\n\nOnly proceed if you fully understand the risks and have a reliable backup or restore point in place. + Remove Microsoft Edge Installation in progress ... diff --git a/GoAwayEdge/Properties/PublishProfiles/FolderProfile.pubxml.user b/GoAwayEdge/Properties/PublishProfiles/FolderProfile.pubxml.user index c610a64..95c27a5 100644 --- a/GoAwayEdge/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/GoAwayEdge/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2024-08-13T17:39:30.3814052Z;True|2024-08-13T19:35:07.3638159+02:00;True|2024-08-13T01:10:27.4137217+02:00;True|2024-08-13T01:06:17.9215774+02:00;True|2024-08-13T00:56:54.4657665+02:00;True|2024-08-13T00:49:21.1156303+02:00;True|2024-08-13T00:45:56.3970427+02:00;True|2024-08-13T00:25:23.5481220+02:00;True|2024-08-12T22:11:19.4188626+02:00;True|2024-08-12T22:10:38.2923046+02:00;True|2024-08-12T22:08:45.6517147+02:00;True|2024-07-30T00:22:22.2984409+02:00;True|2024-07-30T00:18:17.4366719+02:00;True|2024-07-30T00:17:49.8084336+02:00;True|2024-07-22T18:41:59.8117684+02:00;True|2024-06-18T00:28:22.3138517+02:00;True|2024-06-18T00:16:46.9788815+02:00;True|2024-06-09T20:14:23.6305404+02:00;True|2024-06-09T19:02:49.2570274+02:00;True|2024-06-09T18:47:29.9573023+02:00;True|2024-06-09T18:46:39.8011527+02:00;False|2024-06-09T18:46:05.6633541+02:00;False|2024-06-09T18:45:59.2563619+02:00;True|2024-02-18T17:16:27.0408261+01:00;True|2024-02-18T17:15:41.3961034+01:00;True|2024-02-18T17:11:58.7761728+01:00;True|2024-02-18T17:08:57.9390623+01:00;True|2024-02-18T17:08:26.6377454+01:00;True|2024-02-18T17:07:45.2050537+01:00;True|2024-02-18T17:05:12.7495146+01:00;True|2024-02-18T17:02:32.4549017+01:00;True|2024-02-18T16:48:25.3074382+01:00;True|2023-10-19T00:00:28.0962969+02:00;True|2022-11-13T02:33:03.7406004+01:00;True|2022-11-13T02:19:07.9073988+01:00;True|2022-11-13T02:18:35.3043045+01:00;True|2022-11-12T20:05:07.6366825+01:00;False|2022-11-12T20:04:52.3576134+01:00;True|2022-11-12T19:36:12.8480978+01:00; + True|2024-12-25T16:22:09.8471194Z||;True|2024-08-13T19:39:30.3814052+02:00||;True|2024-08-13T19:35:07.3638159+02:00||;True|2024-08-13T01:10:27.4137217+02:00||;True|2024-08-13T01:06:17.9215774+02:00||;True|2024-08-13T00:56:54.4657665+02:00||;True|2024-08-13T00:49:21.1156303+02:00||;True|2024-08-13T00:45:56.3970427+02:00||;True|2024-08-13T00:25:23.5481220+02:00||;True|2024-08-12T22:11:19.4188626+02:00||;True|2024-08-12T22:10:38.2923046+02:00||;True|2024-08-12T22:08:45.6517147+02:00||;True|2024-07-30T00:22:22.2984409+02:00||;True|2024-07-30T00:18:17.4366719+02:00||;True|2024-07-30T00:17:49.8084336+02:00||;True|2024-07-22T18:41:59.8117684+02:00||;True|2024-06-18T00:28:22.3138517+02:00||;True|2024-06-18T00:16:46.9788815+02:00||;True|2024-06-09T20:14:23.6305404+02:00||;True|2024-06-09T19:02:49.2570274+02:00||;True|2024-06-09T18:47:29.9573023+02:00||;True|2024-06-09T18:46:39.8011527+02:00||;False|2024-06-09T18:46:05.6633541+02:00||;False|2024-06-09T18:45:59.2563619+02:00||;True|2024-02-18T17:16:27.0408261+01:00||;True|2024-02-18T17:15:41.3961034+01:00||;True|2024-02-18T17:11:58.7761728+01:00||;True|2024-02-18T17:08:57.9390623+01:00||;True|2024-02-18T17:08:26.6377454+01:00||;True|2024-02-18T17:07:45.2050537+01:00||;True|2024-02-18T17:05:12.7495146+01:00||;True|2024-02-18T17:02:32.4549017+01:00||;True|2024-02-18T16:48:25.3074382+01:00||;True|2023-10-19T00:00:28.0962969+02:00||;True|2022-11-13T02:33:03.7406004+01:00||;True|2022-11-13T02:19:07.9073988+01:00||;True|2022-11-13T02:18:35.3043045+01:00||;True|2022-11-12T20:05:07.6366825+01:00||;False|2022-11-12T20:04:52.3576134+01:00||;True|2022-11-12T19:36:12.8480978+01:00||; \ No newline at end of file diff --git a/GoAwayEdge/UserInterface/CopilotDock/InterfaceManager.cs b/GoAwayEdge/UserInterface/CopilotDock/InterfaceManager.cs index 123209a..c7dcb2f 100644 --- a/GoAwayEdge/UserInterface/CopilotDock/InterfaceManager.cs +++ b/GoAwayEdge/UserInterface/CopilotDock/InterfaceManager.cs @@ -48,7 +48,7 @@ public static void ShowDock() Logging.Log($"Message received: {message}"); if (message.Contains("BringToFront")) { - WindowManager.ShowCopilotDockAsync(Common.Configuration.ShellManager, AppBarScreen.FromPrimaryScreen(), AppBarEdge.Right, 500, mode); // Dummy data + WindowManager.ShowCopilotDockAsync(Common.Configuration.ShellManager!, AppBarScreen.FromPrimaryScreen(), AppBarEdge.Right, 500, mode); // Dummy data } }; @@ -57,7 +57,7 @@ public static void ShowDock() Logging.Log($"Error occurred: {ex.Message}", Logging.LogLevel.ERROR); }; - WindowManager.ShowCopilotDockAsync(Common.Configuration.ShellManager, + WindowManager.ShowCopilotDockAsync(Common.Configuration.ShellManager!, AppBarScreen.FromPrimaryScreen(), AppBarEdge.Right, 500, // temporary size diff --git a/GoAwayEdge/UserInterface/Setup/Pages/RedirectOrRemove.xaml.cs b/GoAwayEdge/UserInterface/Setup/Pages/RedirectOrRemove.xaml.cs index f7195c1..3160bc6 100644 --- a/GoAwayEdge/UserInterface/Setup/Pages/RedirectOrRemove.xaml.cs +++ b/GoAwayEdge/UserInterface/Setup/Pages/RedirectOrRemove.xaml.cs @@ -1,4 +1,5 @@ using System.Windows; +using GoAwayEdge.Common; using GoAwayEdge.Common.Debugging; using Wpf.Ui; using Wpf.Ui.Controls; @@ -18,6 +19,8 @@ public RedirectOrRemove() private void InstallBtn_Click(object sender, RoutedEventArgs e) { + Configuration.UninstallEdge = false; + Installer.SettingPage = new Settings(); Installer.ContentWindow!.FrameWindow.Content = Installer.SettingPage; Installer.ContentWindow!.NextBtn.IsEnabled = true; } @@ -26,21 +29,27 @@ private async void UninstallBtn_Click(object sender, RoutedEventArgs e) { var contentDialogService = new ContentDialogService(); contentDialogService.SetDialogHost(Installer.ContentWindow!.RootContentDialogPresenter); + var warningTitle = LocalizationManager.LocalizeValue("Warning"); + var cancelBtn = LocalizationManager.LocalizeValue("Cancel"); + var removeBtn = LocalizationManager.LocalizeValue("SettingsUninstallEdgeBtn"); + var contentValue = LocalizationManager.LocalizeValue("SettingsUninstallEdgeWarningDescription"); + var result = await contentDialogService.ShowSimpleDialogAsync( new SimpleContentDialogCreateOptions { - Title = "Warning", - Content = "Removing Microsoft Edge can cause serious system issues, as it’s deeply integrated into Windows and essential for many features, including updates, help files, and some apps. Deleting it could result in instability or broken functionality.\n\nOnly proceed if you fully understand the risks and have a reliable backup or restore point in place.", - PrimaryButtonText = "Remove Microsoft Edge", - CloseButtonText = "Cancel" + Title = warningTitle, + Content = contentValue, + PrimaryButtonText = removeBtn, + CloseButtonText = cancelBtn } ); - - if (result == ContentDialogResult.Primary) - { - Logging.Log("User pressed 'Remove Microsoft Edge'"); - } + if (result != ContentDialogResult.Primary) return; + + Logging.Log("User pressed 'Remove Microsoft Edge'"); + Configuration.UninstallEdge = true; + Installer.SettingPage = new Settings(); + Installer.ContentWindow!.FrameWindow.Content = Installer.SettingPage; } } } diff --git a/GoAwayEdge/UserInterface/Setup/Pages/Settings.xaml.cs b/GoAwayEdge/UserInterface/Setup/Pages/Settings.xaml.cs index c6eb1dc..3c6628e 100644 --- a/GoAwayEdge/UserInterface/Setup/Pages/Settings.xaml.cs +++ b/GoAwayEdge/UserInterface/Setup/Pages/Settings.xaml.cs @@ -86,6 +86,12 @@ public Settings() Configuration.Uninstall = false; Configuration.InstallControlPanel = true; ControlPanelSwitch.IsChecked = true; + + if (Configuration.UninstallEdge) + { + CopilotStackPanel.IsEnabled = false; + WeatherStackPanel.IsEnabled = false; + } } private void EnableNextBtnValidation()