Qt: Add Create game shortcut functionality#12746
Conversation
|
Shortcut creation has been implemented for Windows. 2025-05-30.22-32-22.mp4 |
43a2791 to
0e349b1
Compare
|
You can now include the launch arguments before creating the shortcut. 2025-05-31.17-16-06.mp4 |
|
Works great on Windows, incredible job. I am using a website with save files icons to add them manually. |
Thank you for testing! In regards to the icons, i decided to not continue exploring for options as its deemed unfeasible. Therefore users will have to manually add their own icons if they desired. |
|
Is it possible to make it create a start menu shortcut as well? I want to keep my desktop free of any icons (OLED monitor), but I like having start menu entries to run apps/games quickly. It's esssentially a matter of copying the generated shortcut to I think most of the time, when you create a desktop shortcut, you'll also want a start menu entry, so it's safe to do it automatically. People who don't want the desktop icon can remove it manually, and the start menu entry will still be available. |
b9d2f1a to
a729449
Compare
404f385 to
e4d061c
Compare
215453e to
da5a04e
Compare
|
very nice, works on windows! is it possible to add a menu when adding a shortcut to click the arguments like --fullscreen etc? looking forward |
https://pcsx2.net/docs/post/cli/ -fullscreen was always one dash and the most others now also with Qt GUI, just to make sure you are properly using the command-line arguments. |
chaoticgd
left a comment
There was a problem hiding this comment.
Found some issues. I haven't gone over the implementation of EscapeCmdLine yet.
chaoticgd
left a comment
There was a problem hiding this comment.
Did a proper review this time. Haven't checked some of the Windows API stuff, someone else should look over that.
|
where can I download this? |
Currently you need to build pcsx2 by yourself. |
JordanTheToaster
left a comment
There was a problem hiding this comment.
Works as expected on Windows.
chaoticgd
left a comment
There was a problem hiding this comment.
This is looking good on Linux now. The history is a bit messy, so it should probably be squashed.
I still haven't looked at a lot of the Windows API stuff, so someone else needs to review that. I'm particularly worried about how the command line arguments are escaped on Windows. The fact that environment variables are substituted implies it may be doing a trip through cmd.exe, although I'm not sure if there's any other quirks with how it's parsed, so someone else will have to look into it.
Squashed. |
I got asked to look into this, unfortunately I'm unfamiliar with this area of Windows, so most of what I've picked out was either testing or googling. While shortcuts do resolve environment variables, they don't seem to handle any cmd's metacharacters As an aside, Everyone quotes command line arguments the wrong way suggests that you need to escape As for the shortcut creation code, it seems to align with MS's example code. |
|
Addressed everything. |
TellowKrinkle
left a comment
There was a problem hiding this comment.
I assume you've tested this with paths that contain all the characters you escape (so \, $, %, ", and ` on Linux) to make sure the escaping is parsed properly by the system?
|
After further testing, turns out there were MORE cases that were unexpectedly handled incorrectly. whoowee i sure do love FreeDesktop Desktop Entry's simple specification! Drafting for now. |
|
I tested them again and while PCSX2's CLI parser doesn't seem to work with all of them yet, the .desktop file output does seem to work. |
GovanifY
left a comment
There was a problem hiding this comment.
First, let me preface that I don't really want to let this PR stay in forever limbo and so I'm putting all of this as comments and I'm not requesting formally changes.
The special character handling seems a bit too complex for my liking, the strcspn usage seems like it could easily break, although unsure if it does in this current situation.
WriteLnFmt feels like it could be abused if the name contains format specifies and is then piped to printf.
Also, why do we need an async wanring at all? I assume if a shortcut creation fail, you can just call the warning and then return.
There's a bunch of code duplication in EscapeShortcutCommandLine where the ifdef shouldn't apply to most of the code.
Besides that it looks like a bunch of work went into this PR so kudos! Just make sure to test with a bunch of weird names on purpose to see if you can break the implem
GovanifY
left a comment
There was a problem hiding this comment.
I'm assuming everything got tested; If so probably good enough to merge for now and fix later should issues arise
|
A few hours of trial and error can save you 10 minutes of windows testing |
|
Looks like the same issue as before. It was probably accidentally reverted somehow. |
Whoops, fixed. |
|
Advienne que pourra |


Description of Changes
This PR adds in the ability to automatically create a desktop shortcut for a game. macOS are not included.
To use: Right click on a game in the game list -> Create Game Shortcut
Closes #8349
Preview:
Rationale behind Changes
QoL Improvements and accessibility
Suggested Testing Steps
Test creating shortcut, and see if it loads PCSX2 and the game properly.
Did you use AI to help find, test, or implement this issue or feature?
Nada