Skip to content

Commit

Permalink
Fixed minor bug
Browse files Browse the repository at this point in the history
Fixed a bug where it would try to use System32 as a temp directory when restoring the icon when starting it from Windows Search.
  • Loading branch information
pogrammerX authored Sep 28, 2023
1 parent 4378d4f commit fa2cd09
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions DiscordIconChanger.GUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -108,4 +109,4 @@ private void button1_Click_1(object sender, EventArgs e)
}
}
}
}
}

0 comments on commit fa2cd09

Please sign in to comment.