From ddd053e8b6da9ae524a8560d627a4ffcb0f354d8 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Fri, 1 Sep 2023 10:36:03 +0100 Subject: [PATCH] Fix bug with first-time install checking https://discord.com/channels/1099468797410283540/1147097708709040128 --- Bloxstrap/Bootstrapper.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 5628454..b55f8e1 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -496,16 +496,19 @@ namespace Bloxstrap ProtocolHandler.Register("roblox", "Roblox", Paths.Application); ProtocolHandler.Register("roblox-player", "Roblox", Paths.Application); - // in case the user is reinstalling - if (File.Exists(Paths.Application) && App.IsFirstRun) + if (Environment.ProcessPath is not null && Environment.ProcessPath != Paths.Application) { - Filesystem.AssertReadOnly(Paths.Application); - File.Delete(Paths.Application); - } + // in case the user is reinstalling + if (File.Exists(Paths.Application) && App.IsFirstRun) + { + Filesystem.AssertReadOnly(Paths.Application); + File.Delete(Paths.Application); + } - // check to make sure bootstrapper is in the install folder - if (!File.Exists(Paths.Application) && Environment.ProcessPath is not null) - File.Copy(Environment.ProcessPath, Paths.Application); + // check to make sure bootstrapper is in the install folder + if (!File.Exists(Paths.Application)) + File.Copy(Environment.ProcessPath, Paths.Application); + } // this SHOULD go under Register(), // but then people who have Bloxstrap v1.0.0 installed won't have this without a reinstall