From fa2cd09080ee96585876b7eb67874faa5ea129a7 Mon Sep 17 00:00:00 2001 From: David Gerson <84614495+pogrammerX@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:42:04 +0200 Subject: [PATCH] Fixed minor bug Fixed a bug where it would try to use System32 as a temp directory when restoring the icon when starting it from Windows Search. --- DiscordIconChanger.GUI/Form1.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DiscordIconChanger.GUI/Form1.cs b/DiscordIconChanger.GUI/Form1.cs index 8a216b5..1cf7df9 100644 --- a/DiscordIconChanger.GUI/Form1.cs +++ b/DiscordIconChanger.GUI/Form1.cs @@ -82,9 +82,10 @@ private void Form1_Load(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e) { - File.WriteAllBytes(Environment.CurrentDirectory + "\\normal.ico", Properties.Resources.normal); - DIC.Perform(DiscordUtil.LocateDiscord(), Environment.CurrentDirectory + "\\normal.ico"); - File.Delete(Environment.CurrentDirectory + "\\normal.ico"); + string normalIcoPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\normal.ico"; + File.WriteAllBytes(normalIcoPath, Properties.Resources.normal); + DIC.Perform(DiscordUtil.LocateDiscord(), normalIcoPath); + File.Delete(normalIcoPath); MessageBox.Show("Restored!", "Discord Icon Changer", MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -108,4 +109,4 @@ private void button1_Click_1(object sender, EventArgs e) } } } -} \ No newline at end of file +}