Skip to content

Commit

Permalink
Merge pull request #18 from jimmyeao/dev
Browse files Browse the repository at this point in the history
Fixes #17  Add-on launcher does not recognise Steam WebApp version of…
  • Loading branch information
jimmyeao authored Aug 25, 2023
2 parents 8ad4b19 + 5a6be91 commit 8aeb3e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Elite Dangerous Addon Launcher V2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RootNamespace>Elite_Dangerous_Addon_Launcer_V2</RootNamespace>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.1.2.341</AssemblyVersion>
<FileVersion>1.1.2.341</FileVersion>
<AssemblyVersion>1.1.2.347</AssemblyVersion>
<FileVersion>1.1.2.347</FileVersion>
<ApplicationIcon>elite-dangerous-icon.ico</ApplicationIcon>
<PackageIcon>app.png</PackageIcon>
<PackageProjectUrl>https://github.com/jimmyeao/Elite-Dangerous-Addon-Launcher-V2</PackageProjectUrl>
Expand Down
27 changes: 21 additions & 6 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public void ShowWhatsNew()

List list = new List();

ListItem listItem1 = new ListItem(new Paragraph(new Run("Fixed bug with copying profiles")));
ListItem listItem1 = new ListItem(new Paragraph(new Run("Fixed bug with launching Elite as a webapp")));
list.ListItems.Add(listItem1);

// ListItem listItem2 = new ListItem(new Paragraph(new Run("Profile Options for import/export and copy/rename/delete")));
Expand Down Expand Up @@ -573,13 +573,27 @@ private void LaunchApp(MyApp app) // function to launch enabled applications
}
else
{
// yeah, that path didn't exist... are we launching a web app?
if (!string.IsNullOrEmpty(app.WebAppURL))
{
// ok, let's launch it in the default browser
UpdateStatus("Launching " + app.Name);
string target = app.WebAppURL;
Process.Start(new ProcessStartInfo(target) { UseShellExecute = true });
Process proc = Process.Start(new ProcessStartInfo(target) { UseShellExecute = true });

// If the app we're launching is via the steam URL, we anticipate that EDLaunch will run
if (target.Equals("steam://rungameid/359320", StringComparison.OrdinalIgnoreCase))
{
// Small delay to give time for the EDLaunch process to start after Steam starts
Thread.Sleep(2000);

// Find the EDLaunch process and attach the event handler
Process edLaunchProc = Process.GetProcessesByName("EDLaunch").FirstOrDefault();
if (edLaunchProc != null)
{
edLaunchProc.EnableRaisingEvents = true;
edLaunchProc.Exited += new EventHandler(ProcessExitHandler);
}
}

UpdateStatus("Launching " + app.Name);
}
else
{
Expand Down Expand Up @@ -1058,7 +1072,8 @@ private async void CheckEdLaunchInProfile()
return;
}
// Check if edlaunch.exe exists in the current profile
if (!currentProfile.Apps.Any(a => a.ExeName.Equals("edlaunch.exe", StringComparison.OrdinalIgnoreCase)))
if (!currentProfile.Apps.Any(a => a.ExeName.Equals("edlaunch.exe", StringComparison.OrdinalIgnoreCase)
|| a.WebAppURL?.Equals("steam://rungameid/359320", StringComparison.OrdinalIgnoreCase) == true))
{
// edlaunch.exe does not exist in the current profile Prompt the user with a dialog
// offering to scan their computer for it
Expand Down

0 comments on commit 8aeb3e9

Please sign in to comment.