Skip to content

Commit

Permalink
Update Program.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheXorog committed Apr 14, 2023
1 parent 77b4c47 commit a330846
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BeatRecorder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using BeatRecorder.Util.BeatSaber;
using BeatRecorder.Util.OBS;
using BeatRecorder.Util.OpenVR;
using System.Reflection;

namespace BeatRecorder;

Expand Down Expand Up @@ -42,9 +43,10 @@ private async Task MainAsync(string[] args)
{
await Task.Delay(1000);

if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)).Length > 1)
{
_logger.LogError("Only one instance of this application is allowed");
await Task.Delay(1000);
Environment.Exit(0);
return;
}
Expand Down

0 comments on commit a330846

Please sign in to comment.