SplitScreen-Me / splitscreenme-nucleus

Nucleus Co-op is an application that starts multiple instances of a game for split-screen multiplayer gaming!
https://www.splitscreen.me/docs/what-is-splitscreen-me
GNU General Public License v3.0
856 stars 50 forks source link

✨ Update button next to each handler #33

Closed Snailedlt closed 1 year ago

Snailedlt commented 2 years ago

I have searched through the issues and didn't find my problem.

Problem

Currently if you want to update a handler, you'll have to remove the old one, re-install it and point it to the .exe again. It would however be nice if there was just an update button next to each handler to update it to the newest version

Possible Solution

Quick and dirty solution

Juat a button to remove the selected handler, and download the latest version of it.

Steps to implement:

  1. Delete handler
  2. Download new handler version
  3. Automatically add it to the list using the stored .exe path in content/userprofile.json
  4. Restart nucles so the list refreshes

Better, but also more costly solution

One button to check if any of the handlers have updated version and a swcond button for each handler to download the newest version. The second button should only show if current version of the handler is not the latest version.

Steps to implement

FEATURE 1

Refresh button to check for updates on all handlers

  1. Get the handler id for all installed handlers
  2. Check the version (package id) of all the currently installed handlers.
  3. Search the hub for the handler, and see if the current package id is the same as the latest versions' id.
  4. Show an icon (update button) next to all the handlers which have updated versions available.

-- FEATURE 2 -- To update to newer versions:

  1. When a user clicks on the update button, go through the same steps from feature 1 to double check that the version hasn't changed.
  2. Download the latest version
  3. Delete the old handler along with the folder for it (if it exists).
  4. Unzip the new handler
  5. Re-add the handler using the stored .exe path in content/userprofiles.json
  6. Refresh the handler list (or restart nucleus)

Additional information

Potential Edge Cases

1. The Game.ExecutableName variable, or the path to the game .exe changes. If this happens, it won't be possible to add the new handler to the list again. A possible fix for this is to search through the new handler script, and see what the new .exe is, then change the content/userprofiles.json file to reflect the new .exe name.

**2. The path of the game changes Same as above, the game won't be added to the list. I don't see any simple fix for this, and think it's better to handle it on a game by game basis.

Mikou27 commented 1 year ago

Done.