diff --git a/Bloxstrap/Installer.cs b/Bloxstrap/Installer.cs index 940abcd2..1ceaa59c 100644 --- a/Bloxstrap/Installer.cs +++ b/Bloxstrap/Installer.cs @@ -285,7 +285,6 @@ public static void DoUninstall(bool keepData) () => Directory.Delete(Paths.Downloads, true), () => Directory.Delete(Paths.Roblox, true), - () => Directory.Delete(Paths.Icons, true), () => File.Delete(App.State.FileLocation) }; diff --git a/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs b/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs index 8b000bc4..c8a85715 100644 --- a/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs +++ b/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs @@ -1,27 +1,28 @@ using System.Reflection; -using System.Windows.Markup; namespace Bloxstrap.Models.SettingTasks { public class ExtractIconsTask : BoolBaseTask { + private string _path => Path.Combine(Paths.Base, Strings.Paths_Icons); + public ExtractIconsTask() : base("ExtractIcons") { - OriginalState = Directory.Exists(Paths.Icons); + OriginalState = Directory.Exists(_path); } public override void Execute() { if (NewState) { - Directory.CreateDirectory(Paths.Icons); + Directory.CreateDirectory(_path); var assembly = Assembly.GetExecutingAssembly(); var resourceNames = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".ico")); foreach (string name in resourceNames) { - string path = Path.Combine(Paths.Icons, name.Replace("Bloxstrap.Resources.", "")); + string path = Path.Combine(_path, name.Replace("Bloxstrap.Resources.", "")); var stream = assembly.GetManifestResourceStream(name)!; using var memoryStream = new MemoryStream(); @@ -31,9 +32,9 @@ public override void Execute() File.WriteAllBytes(path, memoryStream.ToArray()); } } - else if (Directory.Exists(Paths.Icons)) + else if (Directory.Exists(_path)) { - Directory.Delete(Paths.Icons, true); + Directory.Delete(_path, true); } OriginalState = NewState; diff --git a/Bloxstrap/Paths.cs b/Bloxstrap/Paths.cs index 130d44be..36f81361 100644 --- a/Bloxstrap/Paths.cs +++ b/Bloxstrap/Paths.cs @@ -22,7 +22,6 @@ static class Paths public static string Integrations { get; private set; } = ""; public static string Modifications { get; private set; } = ""; public static string Roblox { get; private set; } = ""; - public static string Icons { get; private set; } = ""; public static string Application { get; private set; } = ""; @@ -38,7 +37,6 @@ public static void Initialize(string baseDirectory) Integrations = Path.Combine(Base, "Integrations"); Modifications = Path.Combine(Base, "Modifications"); Roblox = Path.Combine(Base, "Roblox"); - Icons = Path.Combine(Base, "Icons"); Application = Path.Combine(Base, $"{App.ProjectName}.exe"); } diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 2f0fa6df..cd58c8bf 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -3189,6 +3189,15 @@ public static string Menu_UnsavedChanges { } } + /// + /// Looks up a localized string similar to Icons. + /// + public static string Paths_Icons { + get { + return ResourceManager.GetString("Paths.Icons", resourceCulture); + } + } + /// /// Looks up a localized string similar to They'll be kept where Bloxstrap was installed, and will automatically be restored on a reinstall.. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index ed4c4fc3..5e2acb73 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -1230,4 +1230,8 @@ Would you like to enable test mode? Support us on Ko-fi! Call-to-action button + + Icons + Name of the folder that gets created according to the "create shortcut icons" option. Ensure that it is a valid folder name. + \ No newline at end of file