Something like this already exists: Version CheckerNot sure if this is available or not, but I had an idea for a mod auto-updater that I don't think has been done before, it works like this:
Whaddya think?
- Mod authors opt-in by adding an attribute (I forget what the Java name for it is, but they go above the class definition and start with '@') to their main mod class, a string which holds a URL that points to a JSON file somewhere that they maintain.
- Each JSON file has at least one field named after a specific version of vanilla (ie: 1.7.10 or 1.4.7) and has three attributes: the latest version of the mod, the URL for said version, and the minimum required Forge version.
- The updater checks if the two versions line up, and if they don't, they give the user a prompt asking if they want to update (with a "Don't Ask Me Again" option that can be config'd should they change their mind) and if they say yes, it'll download the new version and get rid of the old one.
- Once all's said and done, if any updates were done, it'll tell the user that its restarting Minecraft to finish the updates and boom, done.
It can also auto-download