I have a quarkus cli application I compile native. Now I want to implement a self-update feature. That is, the cli application should be capable of updating itself with the newest compiled version. What would be a good approach to realize this?

1 Reply 1

To my best knowledge

  1. On startup, call a function to check the latest version from GitHub or a URL where version info is served.
    Example: https://api.github.com/repos/ozkanpakdil/swaggerific/releases/latest

  2. If there’s a new version, ask the user to update (Y/n).

  3. If user hit Y, download the zip and overwrite the current install.

    • If it’s a native exe, overwriting may fail (especially on Windows).
    • In that case, trigger a bash script to handle download + overwrite.
  4. Be careful about the path the CLI needs correct access to write there.

  5. Restart the CLI with the same parameters so it continues what the user requested.

    • CLI updated itself, user request runs, happy end.

I saw this flow in 2009 in a windows application. If you have MSI to deliver this may change but steps will be similar. Here there are many different examples.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.