From 4cfe64067d770f65d1a9ec41babac1076148b553 Mon Sep 17 00:00:00 2001
From: WeeXnes <somtrigi@gmail.com>
Date: Sun, 4 May 2025 01:28:57 +0200
Subject: [PATCH] fixed crash on AppImage

---
 PS2_Manager/MainWindow.axaml.cs | 18 ++++++++++++++----
 PS2_Manager/PS2_Manager.csproj  |  2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/PS2_Manager/MainWindow.axaml.cs b/PS2_Manager/MainWindow.axaml.cs
index 514ea1a..d970548 100644
--- a/PS2_Manager/MainWindow.axaml.cs
+++ b/PS2_Manager/MainWindow.axaml.cs
@@ -138,10 +138,20 @@ public partial class MainWindow : Window
 
     private async void Control_OnLoaded(object? sender, RoutedEventArgs e)
     {
-        string fileVersion = FileVersionInfo
-            .GetVersionInfo(Assembly.GetExecutingAssembly().Location)
-            .FileVersion ?? "Unknown";
-        WelcomeTextTop.Text = "Welcome to the PS2 Games Manager v" + fileVersion;
+        string welcomeText = "";
+        try
+        {
+            welcomeText = FileVersionInfo
+                .GetVersionInfo(Assembly.GetExecutingAssembly().Location)
+                .FileVersion ?? "Unknown";
+            welcomeText = "Welcome to the PS2 Games Manager v" + welcomeText;
+        }
+        catch (Exception ex)
+        {
+            welcomeText = "Welcome to the PS2 Games Manager";
+        }
+
+        WelcomeTextTop.Text = welcomeText;
         Util.CheckDir(settings.library_path.GetValue<string>());
         Util.CheckDir(Path.Combine(settings.library_path.GetValue<string>(), "DVD"));
         Util.CheckDir(Path.Combine(settings.library_path.GetValue<string>(), "CD"));
diff --git a/PS2_Manager/PS2_Manager.csproj b/PS2_Manager/PS2_Manager.csproj
index 2faba62..6d1cc6e 100644
--- a/PS2_Manager/PS2_Manager.csproj
+++ b/PS2_Manager/PS2_Manager.csproj
@@ -8,7 +8,7 @@
         <ApplicationManifest>app.manifest</ApplicationManifest>
         <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
         <AssemblyVersion>1.0</AssemblyVersion>
-        <FileVersion>1.3</FileVersion>
+        <FileVersion>1.4</FileVersion>
     </PropertyGroup>
 
     <ItemGroup>