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 May 24, 2019 · 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 have a published app that uses SimplePatchTool, creating a new patch with the new version of SimplePatchTool will prevent your existing users from updating 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 for 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. Also update SimplePatchTool to the latest version in your app. But before doing that, keep a copy of the current SimplePatchTool somewhere because we'll be creating this patch with the old version of SimplePatchTool:
    • e.g. 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. After keeping a copy of the old SimplePatchTool version somewhere and then updating SimplePatchTool to the latest version in your app, use that old SimplePatchTool console app/Unity plugin to generate a patch for the new (1.0) version of your app
  4. As usual, upload the patch files to PatchFilesServer and update PatchFilesServer/VersionInfo.info (so, don't touch PatchFilesServerNew yet)
  5. 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
  6. You can get rid of the old version of SimplePatchTool now, we won't be using that old console app/Unity plugin anymore
  7. Remember that version 1.0 of your app fetches VersionInfo from PatchFilesServerNew/VersionInfo.info? We shouldn't leave that VersionInfo blank because then SimplePatchTool in version 1.0 of your app will complain about VersionInfo being empty. To fill that VersionInfo, we'll create a new patch with the new version of SimplePatchTool:
    • simply create a new patch for the 1.0 version 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