Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

About Backwards Compatibility

Süleyman Yasir KULA edited this page Mar 5, 2020 · 4 revisions

SimplePatchTool receives new updates every now an then and sometimes, it becomes inevitable to break backwards compatibility while fixing bugs or adding new features. Please note that if an update is not backwards compatible, its commit message will definitely indicate it. So, if you already published your app, when you update SimplePatchTool to a non-backwards compatible version, your existing users will no longer be able to update their apps. But worry not, there is a workaround for this situation:

Basically you'll now have two VersionInfo's: one for your existing users who have the old version of SimplePatchTool installed (let's say VersionInfoOld) and one for the new users who have the new version of SimplePatchTool installed (let's say VersionInfoNew). VersionInfoOld will have one last patch that updates the app to the newer version that uses VersionInfoNew. Afterwards, your users will receive new updates from VersionInfoNew.

  1. So, let's say that version 0.9 of your app uses the old version of SimplePatchTool and in the 1.0 update of your app, you want to update SimplePatchTool to the latest version, which is unfortunately not backwards compatible. Currently, your patch files look like this on the server:
PatchFilesServer/
├── VersionInfo.info
├── RepairPatch/
├── InstallerPatch/
└── IncrementalPatch/
  1. You should create another directory on the server (let's say PatchFilesServerNew) and create a new VersionInfo.info in it (it can be blank right now):
PatchFilesServer/
├── VersionInfo.info
├── RepairPatch/
├── InstallerPatch/
└── IncrementalPatch/

PatchFilesServerNew/
└── VersionInfo.info
  1. Your application was fetching the VersionInfo from PatchFilesServer/VersionInfo.info. Now, you should change that to PatchFilesServerNew/VersionInfo.info. In other words, when your users update their apps to this new version, they'll start receiving their patches via the new VersionInfo
  2. Keep a copy of the current SimplePatchTool somewhere because we'll be creating the 0.9 to 1.0 patch with the old version of SimplePatchTool (remember, the new version of SimplePatchTool is not backwards compatible, so version 0.9 of your app can't understand the patches generated with that new SimplePatchTool version):
    • if you are using the console app to create patches, move that console app and any of its dependencies like SimplePatchTool.dll to some other place
    • or, if you are using the Unity plugin, create an empty Unity project and move the SimplePatchTool plugin to there so that you can use that new empty project to generate the patch
  3. Update SimplePatchTool to the latest version in your app
  4. Use the old SimplePatchTool console app/Unity plugin to generate a patch for the new version (1.0) of your app
  5. As usual, upload the patch files to PatchFilesServer and update PatchFilesServer/VersionInfo.info (so, don't touch PatchFilesServerNew yet)
  6. Great! Now your users will be able to update their apps from version 0.9 to version 1.0 which has the up-to-date version of SimplePatchTool integrated
  7. You can get rid of the old version of SimplePatchTool now, we won't be using that old console app/Unity plugin anymore
  8. It is time to fill PatchFilesServerNew/VersionInfo.info. To do so, we'll create a new patch with the new version of SimplePatchTool:
    • simply create a new patch for version 1.0 of your app, but this time using the new version of SimplePatchTool instead of the old version (so, use the latest version of the console app or the Unity plugin)
    • upload the patch files to PatchFilesServerNew
    • update the VersionInfo at PatchFilesServerNew/VersionInfo.info
PatchFilesServer/
├── VersionInfo.info
├── RepairPatch/
├── InstallerPatch/
└── IncrementalPatch/

PatchFilesServerNew/
├── VersionInfo.info
├── RepairPatch/
└── InstallerPatch/
  1. All done! From now on, you should push new patches to PatchFilesServerNew and don't touch PatchFilesServer ever again. Of course, if you are sure that all your users have updated their apps to version 1.0, then you can delete the PatchFilesServer directory on the server
Clone this wiki locally