[Feature] Show message if target not exists (#257), version 1.1.1.5"

This commit is contained in:
Markus Hofknecht 2021-11-29 20:22:16 +01:00
parent ab91572424
commit 7ebdb01934
2 changed files with 10 additions and 4 deletions

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.1.4")]
[assembly: AssemblyFileVersion("1.1.1.4")]
[assembly: AssemblyVersion("1.1.1.5")]
[assembly: AssemblyFileVersion("1.1.1.5")]

View file

@ -6,6 +6,7 @@ namespace SystemTrayMenu.Utilities
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@ -104,10 +105,11 @@ namespace SystemTrayMenu.Utilities
};
p.Start();
}
catch (Exception ex)
catch (Win32Exception ex)
{
Warn($"fileName:'{fileName}' arguments:'{arguments}'", ex);
if (ex.Message == "The system cannot find the file specified.")
if (ex.NativeErrorCode == 2 || ex.NativeErrorCode == 1223)
{
new Thread(ShowProblemWithShortcut).Start();
static void ShowProblemWithShortcut()
@ -120,6 +122,10 @@ namespace SystemTrayMenu.Utilities
}
}
}
catch (Exception ex)
{
Warn($"fileName:'{fileName}' arguments:'{arguments}'", ex);
}
}
}
}