From c7a7feeebfffd8131d368cdbc6253495ca5dc673 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Wed, 24 May 2023 11:02:57 +0100 Subject: [PATCH] Add process ID to log filename #212 an attempt to mitigate a bug with rogold accidentally launching roblox twice when launching a game through one of its added features making bloxstrap error because both instances will have the same log filename don't want to just terminate any launched instances that encounter the same filename since there could be a case of someone intentionally launching roblox repeatedly this won't actually stop the double launching, there's not much way around that without being able to see the executing args of other bloxstrap instances, but it solves the error --- Bloxstrap/App.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 34a229c..2dc51ab 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -80,8 +80,9 @@ namespace Bloxstrap bool isUsingTempDir = IsFirstRun || IsUninstall; string logdir = isUsingTempDir ? Path.Combine(Directories.LocalAppData, "Temp") : Path.Combine(Directories.Base, "Logs"); string timestamp = DateTime.UtcNow.ToString("yyyyMMdd'T'HHmmss'Z'"); + int processId = Process.GetCurrentProcess().Id; - Logger.Initialize(Path.Combine(logdir, $"{ProjectName}_{timestamp}.log")); + Logger.Initialize(Path.Combine(logdir, $"{ProjectName}_{timestamp}_{processId}.log")); // clean up any logs older than a week if (!isUsingTempDir)