From 46c64b01329efa0b41ca2d126755ac247b5104af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugen=20H=C3=B6glinger?= Date: Tue, 1 Jun 2021 17:08:23 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84nderung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Abfrage eingefügt, die den Button 'DLL-Info' unterdrückt, wenn die EXE und die DLLs in eine EXE gepackt sind. Das verhindert einen Fehler, weil keine DLL gefunden werden. --- AboutBox.sln | 2 +- AboutBox/AboutBox.cs | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/AboutBox.sln b/AboutBox.sln index 47cac6d..ff7e9e6 100644 --- a/AboutBox.sln +++ b/AboutBox.sln @@ -26,7 +26,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - RESX_NeutralResourcesLanguage = de-DE SolutionGuid = {15165E4A-C2AA-46F2-94D4-379F9DC52145} + RESX_NeutralResourcesLanguage = de-DE EndGlobalSection EndGlobal diff --git a/AboutBox/AboutBox.cs b/AboutBox/AboutBox.cs index e21aea1..73836d5 100644 --- a/AboutBox/AboutBox.cs +++ b/AboutBox/AboutBox.cs @@ -269,6 +269,8 @@ namespace Eugen.ESystem.Windows.Forms private void AboutBox_Load(object sender, EventArgs e) { DllInfoSelected = false; + + Appearance(); } protected string ProgramName { private set; get; } @@ -548,5 +550,23 @@ namespace Eugen.ESystem.Windows.Forms this.MaximumSize = new Size(width, hight); this.MinimumSize = new Size(width, hight); } + + private void Appearance() + { + //Sind im Startup Verzeichnis keine eigenen DLLs, dann ist die EXE und die DLLs wahrscheinlich gepackt. Den Button 'DLL-Info' ausblenden, weil es sonst zu Fehler kommt + bool dllExist = false; + + DirectoryInfo ParentDirectory = new DirectoryInfo(Application.StartupPath); + foreach (FileInfo fi in ParentDirectory.GetFiles()) + { + if (fi.Extension.ToLower() == ".dll") + { + dllExist = true; + } + } + + buttonDllInfo.Enabled = dllExist; + buttonDllInfo.Visible = dllExist; + } } }