[BUG] DirectoryNotFoundException when GenerateDriveShortctus enabled and move root folder (#302), version 1.2.2.8

This commit is contained in:
Markus Hofknecht 2022-01-30 11:26:40 +01:00
parent 27a77d5b31
commit 27f2fed2f8
2 changed files with 11 additions and 3 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.2.2.7")]
[assembly: AssemblyFileVersion("1.2.2.7")]
[assembly: AssemblyVersion("1.2.2.8")]
[assembly: AssemblyFileVersion("1.2.2.8")]

View file

@ -30,7 +30,15 @@ namespace SystemTrayMenu.Utilities
foreach (char driveName in driveNamesToRemove)
{
string possibleShortcut = GetLinkPathFromDriveName(driveName.ToString());
System.IO.File.Delete(possibleShortcut);
try
{
System.IO.File.Delete(possibleShortcut);
}
catch (Exception ex)
{
Log.Warn($"Could not delete shortcut at path:'{possibleShortcut}'", ex);
}
}
}