EtienneLamoureux / TQVaultAE

Extra bank space for Titan Quest Anniversary Edition
MIT License
287 stars 62 forks source link

Can't use any version of TQVault [System.IO.IOExceptions] #32

Closed Fagnerk closed 6 years ago

Fagnerk commented 6 years ago

I got this errors everytime i make any changes and click the exit button. Windows 10 and TQAE: Ragnarock (Steam)

https://imgur.com/a/REX93

EtienneLamoureux commented 6 years ago

Does the character have Ragnarök items?

Fagnerk commented 6 years ago

No. I didn't reach act 5 yet. I made some tests last night. If I make changes in vaults I created everything is ok. The error happens just when i make changes in the characters bag.

KenAlin commented 6 years ago

Hi, It seems there is an "old" backup directory in your game data.

Go to C:\Users\<username>\Documents\My Games\Titan Quest - Immortal Throne\SaveData\Main\<character name>

You'll find a directory named Backup-moved by TQVault. Rename it : add "_old" at the end, for example. I'm unsure if it's safe to delete it.

EtienneLamoureux commented 6 years ago

There's a logical issue in TQData.BackupStupidPlayerBackupFolder. I'll be able to fix this.

NorthFury commented 6 years ago

It is safe to delete all backup folders.

epinter commented 6 years ago

Seems to be the same problem as this issue: https://github.com/EtienneLamoureux/TQVaultAE/issues/35

The Directory.Delete exception can be caused by a antivirus, read-only folder, antiransomware (like Windows's Controlled Folder Access) or anything blocking a folder deletion.

We could stop moving the backup, or add a try-catch.

EtienneLamoureux commented 6 years ago

Deleting the folder could probably stay, but crashing the whole thing just sounds like bad error handling. We'll just have to verify that not being able to delete that folder doesn't cause any other problem.

epinter commented 6 years ago

Changed the BackupStupidPlayerBackupFolder method, maybe this helps with the problem: https://github.com/EtienneLamoureux/TQVaultAE/pull/52. Test build: [TQVaultAE-testbuild-20180101.zip] This build will create other directories(Backup-moved by TQVault(n)) when the access to "Backup-moved by TQVault" is denied, no deletion will be tried, so you will have more than one backup if you don't delete the problematic "Backup-moved by TQVault".

(https://github.com/EtienneLamoureux/TQVaultAE/files/1596201/TQVaultAE-testbuild-20180101.zip)

epinter commented 6 years ago

Solved with PR https://github.com/EtienneLamoureux/TQVaultAE/pull/52