Squirrel.Windows icon indicating copy to clipboard operation
Squirrel.Windows copied to clipboard

RemoveShortcutsForExecutable isn't removing an empty folder from start menu

Open Alonzzzo2 opened this issue 3 years ago • 0 comments

After removing the shortcut from the start menu, the folder in the start menu is now empty (most probably).

Here's a code fix for it:

if (f == ShortcutLocation.StartMenu) { var shortcutFileInfo = new FileInfo(file); var shortcutDir = shortcutFileInfo.Directory; this.ErrorIfThrows(() => { if (!shortcutDir.EnumerateFiles().Any()) shortcutDir.Delete(); }, "Couldn't delete directory: " + shortcutDir.FullName); }

In RemoveShortcutsForExecutable method

Alonzzzo2 avatar Mar 08 '21 20:03 Alonzzzo2