Fehlend Versionsnummer

- Falls DLL keine Versionsnummer kennt, dann abfangen und '???' setzen
This commit is contained in:
Eugen Höglinger 2023-03-13 10:58:34 +01:00
parent 46c64b0132
commit d2c6421819
6 changed files with 32 additions and 4 deletions

View File

@ -458,9 +458,22 @@ namespace Eugen.ESystem.Windows.Forms
dlls.Clear();
}
string productVersion = "";
foreach (ProcessModule module in Process.GetCurrentProcess().Modules)
{
dlls.Add(module.ModuleName + Environment.NewLine + module.FileVersionInfo.ProductVersion + Environment.NewLine + module.FileName);
//Falls es keine Versionsnummer gibt, dann abfangen
try
{
productVersion = module.FileVersionInfo.ProductVersion;
}
catch (Exception)
{
productVersion = "???";
}
dlls.Add(module.ModuleName + Environment.NewLine + productVersion + Environment.NewLine + module.FileName);
}
dlls.Sort();

View File

@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AboutBox</RootNamespace>
<AssemblyName>heabox</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>false</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -30,6 +31,10 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -93,5 +98,8 @@
<CustomToolNamespace>Eugen.ESystem.Windows.Forms</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Bibliothek_HE.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

BIN
AboutBox/Bibliothek_HE.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -19,7 +19,7 @@ namespace Eugen.ESystem.Windows.Forms {
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Language {

View File

@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Test_AboutBox</RootNamespace>
<AssemblyName>Test_AboutBox</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>false</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -64,5 +65,8 @@
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

3
Test_AboutBox/app.config Normal file
View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>