-
-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support adding desktop and start menu shortcuts on windows #725
Support adding desktop and start menu shortcuts on windows #725
Conversation
const shortcutOptions = { | ||
target: launchWithProtocol, | ||
icon: `${gameInfo.install.install_path}\\${gameInfo.install.executable}`, | ||
iconIndex: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the icon must be either from a DLL, the game exe file, or a .ico file, I couldn't use the same getIcon function used for linux
} | ||
case 'win32': { | ||
desktopFile = `${app.getPath('desktop')}\\${gameTitle}.lnk` | ||
menuFile = `${app.getPath('appData')}\\Microsoft\\Windows\\Start Menu\\Programs\\${gameTitle}.lnk` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though in spanish the Start menu is Menú Inicio
, both Start Menu
and Menú Inicio
work, Windows understands Start Menu
and Programs
independent of the current system language
Let me know when this is ready for review 👍🏽 |
hey @flavioislima this is ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good.
Also like the refactoring, things are more clear and easy to understand. Nice.
If you have tested well on Linux and Windows we can merge it.
I won't be able to test it today, but I can do it tomorrow.
yes! I tested it in windows 10 and linux mint, adding shortcuts manually and uninstalling games after and things are added and removed correctly I'm happy if anybody wants to test it though, I'm not really sure how to add an automated test for this |
<--- Put the description here --->
This PR implements the functionality of adding shortcut icons on Windows when the user clicks the
Add shortcut
action in the game page.It also implements removing the shortcuts when the game is uninstalled.
I tried to make the
Add desktop shortcuts automatically
andAdd games to start menu automatically
settings work but there's some issue on Windows with the install callback that is not fired properly and it was getting too complicated to do both things on 1 PR so I decided to leave that for another moment.I'm not really sure how to add tests for this since it's too tied to the system.
Closes #724
Use the following Checklist if you have changed something on the Backend or Frontend: