Jump to content

External locking of mod directory causes mod install restart loop


Peter Han
  • Branch: Live Branch Version: Windows Known Issue

If the "Documents/Klei/OxygenNotIncluded/mods" directory has unusual permissions, or is locked externally by common client software like OneDrive, mods that fail to install can easily get stuck in a restart loop.

The culprit is this code in Mod.cs:image.png.1ea513641fcba7b04183d8b7e4cb2d6f.png

If the DeleteDirectory or CreateDirectory calls fail, the code silently swallows the exception and leaves the mod stuck in "Reinstall Pending" state, which causes the game to continually prompt for restarts. As this code installs mods before any other mods load, the victimized mod can do nothing to fix the issue, nor is it possible to work around in a mod like Mod Updater. Please consider adding proper handling for failures in this area (including in file_source.CopyTo), possibly including a popup with a link to the problems caused by OneDrive Documents Folder Sync and Protected Folder Access (the most common culprits).

Note that the attached log does not reproduce this issue as I do not have OneDrive enabled and cannot reproduce the bug locally.


Steps to Reproduce
  1. Install game on a device with OneDrive Documents Sync enabled
  2. Install a large number of mods
  3. Restart the game
  4. The game is likely to be stuck in a restart loop with some or all mods constantly sitting on "Reinstall Pending"
  • Like 4



User Feedback


Is there a manual workaround to this? Even if I edit the mods.json "status" it changes back. What else do I have to modify?

Sadly, I need to use OneDrive.

Share this comment


Link to comment
Share on other sites

A potential solution to OneDrive in particular would be to use `Application.persistentDataPath` instead of documents for all mod (and savegame) data.

This would put the files under `Appdata/LocalLow/Klei/Oxygen Not Included`, beyond the blocking reach of OneDrive 

It would also be useful if this could be configured ingame 

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...