Skip to content

Auto Update

GodDragoner edited this page Jun 19, 2018 · 7 revisions

Enable auto-update support for a personality

For this to work you'll need to add/edit two variables to/in your personality.properties file:

updateDownloadZipLink=null
personalityPropertiesLink=null

The personalityPropertiesLink is required if you want to enable auto-update support for your personality locally. You'll need to assign a link to it that points at a raw version of your newest personality.properties file. For example: https://raw.githubusercontent.com/skier233/Mischevious/master/personality.properties

NOTE: It must be the raw version of the file, there must be no other html stuff on the website.

The updateDownloadZipLink option is required for auto-updating too. It is the link that determines what zip file it will download when it finds a newer version. The link is taken from the link that you are pointing the program at with personalityPropertiesLink which means the local link in the local properties file is irrelevant. Example for such a link: https://github.com/skier233/Mischevious/archive/master.zip

Example for a fully working personality.properties file with auto-update: https://github.com/skier233/Mischevious/blob/master/personality.properties

How to I push an update? Well you'll update the file that your personalityPropertiesLink link is pointing to. You just increment the version number to (for example) 1.1 instead of 1.0. You will also need to update the updateDownloadZipLink link in that file unless the link is still the same and you are updating the link differently (for example it points at a github repository). In the end you can use any direct link to a zip file however if you have your personality on github this is pretty easy. You just use the zip download link of your branch and point the personalityPropertiesLink at the raw version of the personality.properties file of said branch. In Mischevious case this is just the master branch, however feel free to create a branch like "released" that contains all changes that you want to release so you won't accidently change the version number in the master branch and rollout unfinished changes.

To sum it up:

The only thing that needs to be always static and matters locally is the personalityPropertiesLink. It will be used to fetch the newest personality.properties, which means the newest version and download link from a website and then compare versions with the local one and if the version has incremented it will fetch the update from the download link that is given in the ONLINE verison of your personality.properties file.

My personality stores custom user data and it is wiped when updating

The only folder that is not wiped on an update is the System folder inside your personality. If you are storing custom user data other than variables make sure to just put it into a subfolder inside the System folder inside your personality. This folder will always be automatically copied from the old version to the new version before the rest of your personality files are wiped. However the old version of your personality is always zipped and stored as a backup which means you can always revert to the old version by hand.