-
-
Notifications
You must be signed in to change notification settings - Fork 51
About Backwards Compatibility
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.
- 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/
- 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
- Your application was fetching the VersionInfo from
PatchFilesServer/VersionInfo.info
. Now, you should change that toPatchFilesServerNew/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 -
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
- Update SimplePatchTool to the latest version in your app
- Use the old SimplePatchTool console app/Unity plugin to generate a patch for the new version (1.0) of your app
- As usual, upload the patch files to
PatchFilesServer
and updatePatchFilesServer/VersionInfo.info
(so, don't touchPatchFilesServerNew
yet) - 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
- You can get rid of the old version of SimplePatchTool now, we won't be using that old console app/Unity plugin anymore
- 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/
- All done! From now on, you should push new patches to
PatchFilesServerNew
and don't touchPatchFilesServer
ever again. Of course, if you are sure that all your users have updated their apps to version 1.0, then you can delete thePatchFilesServer
directory on the server