WIP implement offline mode for installer #213
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP / prototype PR (which technically works), which allows you to run the installer in offline.
Normally I would just add this feature, but I'm probably going to be busy/not feel like working on this for a while, so I thought I should write it down before I forget. I'm writing this up very quickly, mostly as a reminder to myself.
Now, I would imagine very few people would want to run the installer completely in offline mode, but there are some circumstances where users can't connect to our servers (either github or 07th-mod) due to an SSL error or some other internet issue, but can otherwise use the internet normally. These users should be able to use the "manual download" option to manually download the files, however the current installer requires you have access to the internet for a couple things, which logically it shouldn't need as long as we take a snapshot of all the internet relient stuff every now and then.
Specifically, I had a MacOS user who had an error (related to SSL?) which prevented them from using the installer, even though they should have been able to. I sent my prototype version to them and they were eventually able to install it (they had some other issues, which I'm not sure were specific to their setup).
Also, should our website or github go down (perhaps permanently), it would be nice that the installer can still be used. Eg. you could archive the mod files and the mod installer together, and still be able to run it standalone.
This WIP PR relies on snapshots of anything that would be downloaded from the internet (such as the installData.json), and also some information about the file downloads (
cachedExtractableItems.json
). ThecachedExtractableItems.json
is regenerated when you run the installer in dev mode (when you run the installer from a cloned git repository), the same way we currently generate thecachedDownloadSizes.json
.Additionally, when the installer is built in github actions, a
cachedInstallData.json
(just a copy ofinstallData.json
) is included with the installer, which is used instead of downloading theinstallData.json
from github.Offline Mode
The reason for implementing an actual "mode" for offline use, is to provide predictable behavior when using the installer. If the user has working internet, and for some reason a file failed to download/be queried, I wouldn't want any offline-fallbacks to trigger, as there may be some conflict between the old offline information, and the new information, creating some unpredictable situations.
Therefore, once entering offline mode, the installer will continue to use offline resources, even if you regain an internet connection.
I also want to set the expectation lower for the offline mode, since some stuff might not work properly in the installer, and the user should be aware of this.
A proper "offline mode" (with a popup to inform the user) has not yet been implemented in this PR.
Known Problems
TODO: