From 979ffcf8a41214a0fa7eeca4638851da91df3653 Mon Sep 17 00:00:00 2001 From: SGrottel Date: Sun, 16 Jun 2024 13:23:07 +0200 Subject: [PATCH] Replaced a hardcoded path, which was a development remnant --- Dib/DIBForm.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dib/DIBForm.cs b/Dib/DIBForm.cs index bcc9fe1..5dac41a 100644 --- a/Dib/DIBForm.cs +++ b/Dib/DIBForm.cs @@ -9,6 +9,7 @@ using System.Xml.Serialization; using System.Xml; using System.Runtime.Versioning; +using System.Reflection; namespace Dib { @@ -417,7 +418,13 @@ public class IconCollection : List { }; /// public DIBForm() { InitializeComponent(); - Icon = Icon.ExtractAssociatedIcon(@"C:\dev\tiny-tools\Dib\bin\Debug\net8.0-windows7.0\Dib.exe"); + try + { + Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); + } + catch + { + } try { this.filename = Microsoft.Win32.Registry.GetValue( filenameRegKeyPath, filenameRegKeyName, string.Empty)