Fix Windows shortcut detection for redirected shell folders#449
Merged
Fix Windows shortcut detection for redirected shell folders#449
Conversation
…uring uninstall The uninstaller hardcoded Desktop/Start Menu paths as %USERPROFILE%\Desktop, but the installer creates shortcuts using the Windows Shell API which resolves the actual folder location. On systems with OneDrive Desktop backup, these paths differ, causing the uninstaller to miss the shortcuts. Now uses ShellLink to resolve the real paths and checks both resolved and hardcoded locations. https://claude.ai/code/session_01JbZdEobUPQcnNkQ3idkYp4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves Windows shortcut detection and removal by using the Windows Shell API to resolve actual folder paths, which correctly handles redirected folders (e.g., OneDrive Desktop). Previously, the code relied on hardcoded paths that could fail when Windows folders were redirected to cloud storage or other locations.
Key Changes
resolveShellFolderPath()method that uses IzPack'sShellLinkAPI to resolve actual Windows Shell folder paths for Desktop, Start Menu, and Programs MenugetStartMenuPath(),getDesktopLink(), etc.) with multi-path methods that returnSet<File>containing both API-resolved and hardcoded fallback pathsremoveDesktopAlias(),removeStartMenuLink(), andremoveProgramsMenuLink()to search for shortcuts in all possible locationsinstallWindowsLink()to use the Shell API-resolved path when saving shortcuts, with fallback to hardcoded paths if resolution failsShellLink,LinkedHashSet, andSetimports to support the new functionalityImplementation Details
resolveShellFolderPath()method gracefully handles failures by catching exceptions and returning null, allowing the code to fall back to hardcoded pathsLinkedHashSetto maintain insertion order while avoiding duplicates when both API-resolved and hardcoded paths are the samehttps://claude.ai/code/session_01JbZdEobUPQcnNkQ3idkYp4