Search code examples
installationlauncher

How do I create a launcher that updates my python game given a google drive url?


Ideally i'd love to have

installing from the internet using hardcoded url, creating shortcuts, checking form web page available application versions, showing older versions for rollback, allowing different versions installed simultaneously, allowing uninstallation.

I have the game as an exe with the exeption of the save data and I know how to make an installer for this exe that gives it a shortcut on the desktop

Is there a way to make such an installer and how would I go about doing so?


Solution

  • Nowadays many games do have some kind of a launcher.

    I'd start with the following approach. We need URL: - https://googledrive.com/version. Here you will store the latest version number and the difference in files which need to be updated and for previous updates. Like:

    [{ 
      "version": "1.21.1",
      "files": [
                  "path":"game_file_1.data", "checksum": '1289f81',
                  "path":"game_file_2.data", "checksun": '321321'
                ]
    },
    {
      "version": "1.21.0",
      "files": [...],
     }
     ...]
    
    1. Save version to one on the game files.
    2. Save the url of the server. When the launcher starts send the request to this url and in the response give back the version number and files for each 'patch'
    3. On the launcher side check whether the version number matches the one on the server. If it does not match download the file from the list. Before doing the actual download calculate checksum to make sure you won't download file twice if download process breaks.