Use temp dir in instance for mod file transactions#4462
Merged
Conversation
Pull Request Test Coverage Report for Build 19680585887Details
💛 - Coveralls |
180f71a to
1d4e11a
Compare
1d4e11a to
b2d58dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Cause
The
TxFileManagermakes a backup of each file before deletion, so they can be restored in case there is a problem that requires the transaction to be reverted. These backups are made inC:\Users\User\AppData\Local\Temp\CdFileMgr\. If the game is on the same drive, then the free space consumed by the backups is cancelled out by the deletion of the file. But if the game is on another drive, then the game's drive only experiences deletions, while C: just has more net space consumed. This can cause C: to run out of free space before the transaction completes.Changes
TxFileManagerreference is updated from https://www.nuget.org/packages/TxFileManager.NETStandard to https://www.nuget.org/packages/TxFileManager so we can use the changes from Support for custom temp path chinhdo/txFileManager#12.<GameRoot>/CKAN/TxFileMgr-fc4eed76ee9bas its file transaction temp dir (the weirdfc4eed76ee9bsuffix is fromTxFileManager, not us). This way, when a backup of a deleted file is made, the deletion cancels out the space consumed, and the drive should not fill up. A secondary advantage of this change is that the drive where the user chose to put the game is more likely to have a safe amount of free space anyway, so even if a single file is very large, this will still be safer than using C:.Fixes [Bug]: Uninstalling mods on alternate drive fails when they're larger than remaining space on primary drive #4461.