private void DeleteShortcuts(string fileName) { try { Log.WriteStart("Deleting menu shortcut"); string programs = Environment.GetFolderPath(Environment.SpecialFolder.Programs); string path = Path.Combine(programs, "WebsitePanel Software"); path = Path.Combine(path, fileName); if (File.Exists(path)) { File.Delete(path); } Log.WriteEnd("Deleted menu shortcut"); Log.WriteStart("Deleting desktop shortcut"); string desktop = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); path = Path.Combine(desktop, fileName); if (File.Exists(path)) { File.Delete(path); } Log.WriteEnd("Deleted desktop shortcut"); InstallLog.AppendLine("- Deleted application shortcuts"); } catch (Exception ex) { if (Utils.IsThreadAbortException(ex)) { return; } Log.WriteError("Delete shortcut error", ex); InstallLog.AppendLine("- Failed to delete application shortcuts"); throw; } }