[BUG]: Shortcut creation doesn't work with OneDrive-synced Desktop folder
Describe the Bug
%USERPROFILE%\Desktop may not exist on Microsoft accounts using OneDrive sync. Instead, desktop folder can (most of the time, but not always) be found at %USERPROFILE%\OneDrive\Desktop.
Reproduction Steps
- Open PCSX2 on a Microsoft account with OneDrive sync setup.
- Try to create a desktop game shortcut with default settings.
Expected Behavior
Shortcut creation should not result in a path not found error.
PCSX2 Revision
v2.5.258
Operating System
Windows 11
If Linux - Specify Distro
No response
Logs & Dumps
No response
It's advised to not use One Drive anyway as it's known to cause issues outside of this.
OneDrive is a reason the Desktop may not be in the normal location but it is not the only reason. Windows lets you set it to any directory, and we shouldn't fail because of that.
OneDrive is a reason the Desktop may not be in the normal location but it is not the only reason. Windows lets you set it to any directory, and we shouldn't fail because of that.
I'm thinking instead of automatically putting the shortcut file directly on the desktop folder, upon saving we open up a save dialog (that defaults to the desktop folder) but the user can still choose to decide ultimately where to save the shortcut. Does that sound reasonable?
We should probably be using SHGetKnownFolderPath
We should probably be using SHGetKnownFolderPath
I'm currently working on a cleanup of the shortcuts code that should be done within the next few days if it can wait until then. I'm trying to fix the known bugs and tidy the code.