Creating an update.json File

The update.json file serves a very important purpose. It provides our installation process with instructions to follow when installing your app.

First Version of Your App

If this is the first version of your app the update.json file is very simple.

  • Create a file named update.json
  • This file contains a json object with an AddOrUpdate array. Example below.
  • For each file in your app, include the file path where the app should be installed.
  • You must include a “/” at the beginning of the path.
  • The file must contain this array with at least one file path in it to be valid.
Example: http://www.jsoneditoronline.org/?id=92d887a97b1bb60ef7b207ef3a29ded7

New Version of Existing App

If you are creating an update.json file for a new version of an existing app you have more options available that you should understand.

With existing app customers in mind, you should create these instructions with care and test them to ensure their correctness. They should allow us to update the users of your app from one version to another without breaking their apps.

Options: When a user is updating from one app version to a newer one, there are four possible actions we can take for each file.

  1. Add or Update- This is essentially saving a file to the user’s site. If the file already exists it will be overwritten.
  2. Do Nothing - This will be used often. It means that there were no changes to the file since the last version and we don’t need to save it again.
  3. Copy and Move - This action is used when it existed in a previous version, but it’s location in your app has changed. It should be used when the file contains data that would be troublesome if the user loses it, like a json settings file.
  4. Delete - You can delete files or folders if they existed in a previous version of your app but are no longer needed for the app to work properly.

These options are used by putting your files in the appropriate array within your update.json file.

Example:

Here’s an example of an update.json file that uses every available option. Notice that the files and folders that should be deleted are placed in separate arrays.

http://www.jsoneditoronline.org/?id=d6d9fe807407b516bc0d6a9f21021411

update.json file requirements

  • You must have an AddOrUpdate array with at least one item in it.
  • Every file in your app must have it’s path in the update.json file.
  • File paths should have a leading “/” as shown in the example above.
  • Folder paths should have a leading and trailing “/” as shown in the example above.

Still need help? Contact Us Contact Us