ben-wallis / Filtration

The Path of Exile loot filter editor
GNU General Public License v2.0
262 stars 61 forks source link

Upgrading to a release when default POE user data directory does not exist results in prompt #139

Open ben-wallis opened 4 years ago

ben-wallis commented 4 years ago

When upgrading Filtration to a new version on a system that does not have the default POE user data directory present at C:\Users\<username>\Documents\My Games\Path of Exile, the user is incorrectly prompted to select their POE data directory.

This occurs because ItemFilterPersistenceService has the following code in its constructor:

ItemFilterScriptDirectory = Settings.Default.DefaultFilterDirectory;

As this is in the constructor, it runs during IoC container dependency resolution, which occurs before the settings migration for a new version has run. Therefore, the settings file it reads has the default settings instead of the migrated settings.

The fix for this is to make ItemFilterPersistenceService.ItemFilterScriptDirectory use a Lazy<string> backing field so that it is evaluated the first time it's called rather than during construction.

synicasm commented 4 years ago

Getting this as well on a fresh install. I'm guessing its the same issue.

Some info on this PC's state.. Had Path Of Exile installed Removed Path of Exile.
Noticed the Path of Exile folder in My Games.
Deleted the folder.

Filtration Gives Various errors trying to create a new filter or open an existing one...

Same Path Error... C:\Users\\Documents\My Games\Path of Exile

synicasm commented 4 years ago

Anyone else running into this issue.

Simply adding a folder for Path of Exile seems to satisfy it for now. C:\Users\Documents\My Games\Path of Exile