Änderung

- 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.
This commit is contained in:
Eugen Höglinger 2021-06-01 17:08:23 +02:00
parent 6a8932b1d4
commit 46c64b0132
2 changed files with 21 additions and 1 deletions

View File

@ -26,7 +26,7 @@ Global
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
RESX_NeutralResourcesLanguage = de-DE
SolutionGuid = {15165E4A-C2AA-46F2-94D4-379F9DC52145} SolutionGuid = {15165E4A-C2AA-46F2-94D4-379F9DC52145}
RESX_NeutralResourcesLanguage = de-DE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -269,6 +269,8 @@ namespace Eugen.ESystem.Windows.Forms
private void AboutBox_Load(object sender, EventArgs e) private void AboutBox_Load(object sender, EventArgs e)
{ {
DllInfoSelected = false; DllInfoSelected = false;
Appearance();
} }
protected string ProgramName { private set; get; } protected string ProgramName { private set; get; }
@ -548,5 +550,23 @@ namespace Eugen.ESystem.Windows.Forms
this.MaximumSize = new Size(width, hight); this.MaximumSize = new Size(width, hight);
this.MinimumSize = 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;
}
} }
} }