Skip to content

Commit

Permalink
Launch Minecraft: Bedrock Edition using Windows Explorer rather than …
Browse files Browse the repository at this point in the history
…Windows.System.Launcher.LauncherUriAsync.
  • Loading branch information
Aetopia committed Jun 10, 2024
1 parent 7e3e26b commit cc7ada7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Windows.Foundation;
using Windows.Management.Deployment;
using Windows.System;

class MainForm : Form
{
Expand Down Expand Up @@ -131,7 +131,12 @@ internal MainForm(IEnumerable<string> args)
}
}

await Launcher.LaunchUriAsync(new(preview ? "minecraft-preview://" : "minecraft://"));
Process.Start(new ProcessStartInfo
{
FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe"),
Arguments = preview ? "minecraft-preview://" : "minecraft://",
UseShellExecute = false
}).Dispose();
Close();
};
}
Expand Down

0 comments on commit cc7ada7

Please sign in to comment.