-
-
Notifications
You must be signed in to change notification settings - Fork 51
Recommended Project Structure
-
If your project has a self patcher, then it is recommended that you put its files inside a subdirectory called SPPatcher in your application directory. SimplePatchTool patches the contents of this directory immediately, just before running the self patcher. This way, it is possible to patch the self patcher itself. Also, you'll be able to call the PatchUtils.GetDefaultSelfPatcherExecutablePath function to retrieve the self patcher executable's path easily.
-
If you are planning to update/launch your app (main app) via a separate launcher app that can self patch, then you should first determine where the launcher should put the main app's files at (let's say inside a subdirectory called MainApp). In this case, while creating patch(es) for the launcher, you should add
MainApp/
to its ignored paths. This way, MainApp will not be seen as an obsolete directory while self patching the launcher and won't be deleted by mistake. Finally, while updating the main app via the launcher, you should use{APPLICATION_DIRECTORY}\MainApp
as the rootPath of the SimplePatchTool instance.
So, here's how your builds should be structured:
LauncherProject/
└── Versions/
├── 1.0/
│ ├── ...Launcher files (v1)...
│ └── SPPatcher/
│ └── ...Self patcher files...
└── 2.0/
├── ...Launcher files (v2)...
└── SPPatcher/
└── ...Self patcher files...
MainAppProject/
└── Versions/
├── 1.0/
│ └── ...Main app files (v1)...
├── 2.0/
│ └── ...Main app files (v2)...
└── 3.0/
└── ...Main app files (v3)...
And here's how you should distribute your app to the clients:
LauncherRootPath/
├── ...Launcher files (v2)...
├── SPPatcher/ (Optional, launcher can download the self patcher from the server while patching)
│ └── ...Self patcher files...
└── MainApp/ (Optional, launcher can download the whole main app from the server while patching)
└── ...Main app files (v3)...
In conclusion:
- (for self patching apps) put the self patcher inside SPPatcher subdirectory
-
(for self patching launchers) maintain two different patches: one for the launcher and one for the main app
- add
MainApp/
to the ignored paths of the launcher's patch
- add
- (for self patching launchers) inside your launcher, first check if a new version of the launcher is available. If so, patch it using self patching
-
(for launchers) if launcher is up-to-date, check if a new version of the main app is available (using
{APPLICATION_DIRECTORY}\MainApp
as root path). If so, patch it without using self patching