pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[BUG]: Shortcut creation doesn't work with OneDrive-synced Desktop folder

Open HarmfulBreeze opened this issue 2 months ago • 5 comments

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

  1. Open PCSX2 on a Microsoft account with OneDrive sync setup.
  2. 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

HarmfulBreeze avatar Oct 28 '25 09:10 HarmfulBreeze

It's advised to not use One Drive anyway as it's known to cause issues outside of this.

JordanTheToaster avatar Oct 28 '25 09:10 JordanTheToaster

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.

TellowKrinkle avatar Oct 28 '25 15:10 TellowKrinkle

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?

kamfretoz avatar Oct 28 '25 15:10 kamfretoz

We should probably be using SHGetKnownFolderPath

TellowKrinkle avatar Oct 28 '25 15:10 TellowKrinkle

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.

TheTechnician27 avatar Oct 28 '25 16:10 TheTechnician27