Skip to content

Commit 53e4b5d

Browse files
committed
Revert main branch
1 parent 6c26b92 commit 53e4b5d

File tree

5 files changed

+25
-40
lines changed

5 files changed

+25
-40
lines changed

GoAwayEdge/App.xaml.cs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace GoAwayEdge
2626
public partial class App
2727
{
2828
private static string? _url;
29-
public static bool Debug = false;
3029

3130
public void Application_Startup(object sender, StartupEventArgs e)
3231
{
@@ -64,8 +63,6 @@ public void Application_Startup(object sender, StartupEventArgs e)
6463
{
6564
if (args.Contains("-ToastActivated")) // Clicked on notification, ignore it.
6665
Environment.Exit(0);
67-
if (args.Contains("-debug"))
68-
Debug = true;
6966
if (args.Contains("-s")) // Silent Installation
7067
{
7168
foreach (var arg in args)
@@ -245,22 +242,12 @@ public static void RunParser(string[] args)
245242
#endif
246243
Console.WriteLine("Command line args:\n\n" + argumentJoin + "\n", ConsoleColor.Gray);
247244

245+
// Filter command line args
248246
foreach (var arg in args)
249247
{
250-
if (collectSingleArgument)
251-
{
252-
// Concatenate all remaining arguments into a single string
253-
singleArgument += (singleArgument.Length > 0 ? " " : "") + arg;
254-
continue;
255-
}
256-
257-
// Check for Copilot
258-
if (arg.Contains("microsoft-edge://?ux=copilot&tcp=1&source=taskbar")
259-
|| arg.Contains("microsoft-edge:///?ux=copilot&tcp=1&source=taskbar"))
248+
if (arg.Contains("microsoft-edge:"))
260249
{
261250
_url = arg;
262-
isCopilot = true;
263-
break;
264251
}
265252

266253
if (collectSingleArgument)
@@ -310,19 +297,17 @@ public static void RunParser(string[] args)
310297
copilotMessageUi.ShowDialog();
311298
#endif
312299
}
313-
p.StartInfo.FileName = _url;
314-
p.StartInfo.Arguments = "";
315-
p.Start();
316-
Environment.Exit(0);
317-
}
318-
319-
if (ignoreStartup)
320-
{
321-
if (Debug)
300+
else
322301
{
302+
var parsed = ParseUrl(_url);
303+
Console.WriteLine("Opening URL in default browser:\n\n" + parsed + "\n", ConsoleColor.Gray);
304+
#if DEBUG
323305
var defaultUrlMessageUi = new MessageUi("GoAwayEdge",
324306
"Opening URL in default browser:\n\n" + parsed + "\n", "OK", isMainThread: true);
325307
defaultUrlMessageUi.ShowDialog();
308+
#endif
309+
p.StartInfo.FileName = parsed;
310+
p.StartInfo.Arguments = "";
326311
}
327312
p.Start();
328313
}
@@ -370,6 +355,19 @@ private static SearchEngine ParseSearchEngine(string argument)
370355
};
371356
}
372357

358+
private static bool ContainsParsedData(IEnumerable<string> args)
359+
{
360+
var contains = false;
361+
var engineUrl = DefineEngine(Configuration.Search);
362+
363+
foreach (var arg in args)
364+
{
365+
if (arg.Contains(engineUrl))
366+
contains = true;
367+
}
368+
return contains;
369+
}
370+
373371
private static string ParseUrl(string encodedUrl)
374372
{
375373
// Remove URI handler with url argument prefix

GoAwayEdge/Common/Configuration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ public static string GetKey(string option, bool isUninstall = false)
135135
Console.WriteLine($"Value for key '{option}' not found in the registry.");
136136
return "";
137137
}
138-
Console.WriteLine($"Registry key '{RegistryPath}' not found.");
139-
return "";
140138
}
141139
catch (Exception ex)
142140
{

GoAwayEdge/Common/InstallRoutine.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,6 @@ public static void Uninstall(object? sender, DoWorkEventArgs? e = null)
322322
Logging.Log("Failed to remove uninstall data: " + ex, Logging.LogLevel.ERROR);
323323
}
324324

325-
// Remove Uninstall data
326-
try
327-
{
328-
RegistryConfig.RemoveSubKey(RegistryConfig.UninstallGuid, true);
329-
Shell32.SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero); // Notify Shell about uninstallation
330-
}
331-
catch
332-
{
333-
// ignore
334-
}
335-
336325
// Switch FrameWindow content to InstallationSuccess
337326
worker?.ReportProgress(100, "");
338327
Logging.Log("Uninstallation finished.");

GoAwayEdge/Common/Updater.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static int ValidateIfeoBinary()
6666
$"The Edge Hash ({edgeHash}) and Ifeo Hash ({ifeoHash}) are not identical. Validation failed!", "OK", isMainThread: true);
6767
messageUi.ShowDialog();
6868
}
69-
69+
#endif
7070
return edgeHash != ifeoHash ? 1 : 0;
7171
}
7272

GoAwayEdge/Properties/PublishProfiles/FolderProfile.pubxml.user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
3-
https://go.microsoft.com/fwlink/?LinkID=208121.
2+
<!--
3+
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
66
<PropertyGroup>

0 commit comments

Comments
 (0)