Skip to content
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

Feat: Highly experimental JAR auto update #3

Merged
merged 8 commits into from
Jun 21, 2024
Merged

Conversation

EchoEllet
Copy link
Collaborator

Currently, the auto-update feature is highly experimental, and might be removed, or changed at any time.
And for now, this feature has the following known issues:

  1. It will always update even if the next version has breaking changes
    that can't be automatically migrated.
  2. It will always update even if the next version is not a stable release;
    we haven't implemented an update channel for now (e.g., stable, beta, alpha, development, etc...).
  3. Once the update is finished, the application will close with
    exit code 1 which will indicate an error by the launcher.
    The user will have to launch once again to run the updated JAR.
  4. Currently, it lacks the ability to check for updates, such as on a weekly basis.
  5. Lacks the option to ask if the user wants to update or skip.
  6. At the moment we have minimized JAR and the fat JAR,
    the update process will always update to the minimized JAR.

We haven't planned on how this will be implemented, this is an experimental implementation that is disabled by default and is not recommended if you want something that is stable

Due to how file locking on Windows, the implementation is a bit different as it will generate a batch script that will run after 2 seconds, and in that time, the batch script expects the application to be closed. the application will not wait for the batch script to finish so we can remove, overwrite, or rename the current JAR file.

We could have implemented this with auto-updater, launcher, or a separate script, we didn't solve it this way for many reasons:

  • The Minecraft launcher expects the JAR file name to be the same after the script update, if we include the project version in the file, this will complicate things for the user and require different implementations that depend on the launcher, which can change at any time and make the support for the auto-update feature limited to some launchers, we want to make it easy so we can just copy the command and paste it anywhere on any Minecraft Launcher
  • The update launcher can't update itself, we will have to update the sync script and the sync script will update the update launcher that updates the sync script

@EchoEllet EchoEllet marked this pull request as ready for review June 21, 2024 23:55
@EchoEllet EchoEllet merged commit 211a4b9 into main Jun 21, 2024
1 check passed
@EchoEllet EchoEllet deleted the feat/jar-auto-update branch June 21, 2024 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant