PoE-TradeMacro / POE-TradeMacro

Price checking script for Path of Exile.
https://poe-trademacro.github.io/
GNU General Public License v3.0
935 stars 189 forks source link

Allow using custom directories to store data #753

Open NanoAi opened 6 years ago

NanoAi commented 6 years ago

Version: POE-TradeMacro-2.10.4 Windows Version: Windows 10 [ Version 1709 (OS Build 16299.492) ]

I keep all my Path Of Exile stuff in Documents/PathOfExile and it would be nice to be able to have everything in there, however the script seem to want to make a new folder in Documents for it self every time. I couldn't find any settings to change the folder location.

P.S. I'm not using the error reporting template because this is not an error but a feature request.

aRTy42 commented 6 years ago

That won't be possible or would bring other issues. The script updates by overwriting the main script folder, which means it would overwrite any user settings stored there. For that reason the script creates a folder just for the user settings at \Documents\PoE-TradeMacro. This location has to be fixed, because otherwise the script would not know where to look for them and you can't save the new location somewhere, because somewhere would be in exactly that same folder.

NanoAi commented 6 years ago

Wouldn't it work if you just set the directory to be relative to the installation directory? ie. '%A_ScriptDir%..\PoE-TradeMacro-Data\'

aRTy42 commented 6 years ago

The whole point is to not have it in the main folder, so the settings are not affected by overwriting the folder or switching to another A_ScriptDir. People often enough download a release and use a folder with the version number, so they end up with PoE-TradeMacro-2.10.4 or something. When they use the auto updater for the first time, that one creates a generic name by default, so that there won't be a new folder for every release, but instead the existing one gets overwritten, so a folder PoE-TradeMacro gets created and used for the future. Most importantly, updates move the existing folder to a backup location and create an entirely new folder with the new release data.

Consequently, you would need to copy the user folder from the old ScriptDir on every update and that isn't even always possible, since the macro can not always know where your old script was. As I wrote earlier, the reason for the documents folder is to have a fixed location that is independent of the ScriptDir.

NanoAi commented 6 years ago

Sorry my phone messed up the example directory... %A_ScriptDir%\..\PoE-TradeMacro-Data\* so let's say I put PoE-TradeMacro in a folder like Desktop/PoEStuff/PoE-TradeMacro, using the base script directory and then going back one level we'll be able to get just Desktop/PoEStuff/, where we make a new directory with a fixed name (Just like the current one in documents). That way you can move the 2 folders anywhere you want and it will persist working as expected, you could even take it with you on a USB and it would still work.

aRTy42 commented 6 years ago

Then you are still having a fixed location that someone else won't like. Having the user files in the Documents folder where other applications also store configs makes more sense to me than having a parallel folder. In particular it should be more intuitive for most people to be able to just move the script folder around on their PC and still having the script work fine, as opposed to actively having to care for two folders.

NanoAi commented 6 years ago

Don't most applications store configs in %appdata%/../local/? Also I guess you have a point there, however if I felt I wanted to make the change myself what lines would I need to edit, since for some reason even after changing things in resources/ahk it would still write into the same location.

Eruyome commented 6 years ago

We can have a huge debate about what the best path to use would be and others will have other opinions. Changing it yourself is pointless since every update will overwrite it again.

Can't you just ignore that the config folder exists in documents? Is it that "annoying" (or whatever word may be most suited here)?

dovry commented 4 years ago

Can't you just ignore that the config folder exists in documents? Is it that "annoying" (or whatever word may be most suited here)?

Yes, it is very annoying, LutBot creates its own directory in the My Documents directory as well. Imagine if all of the useful addons created their own folders.

Giving the user the option to set a default folder is a huge QOL, and is almost expected (or else this issue wouldn't exist).

At least be open to letting the users help you, such as suggesting where this might be located so users can create pull requests.

Eruyome commented 4 years ago

All right, I'll revisit this topic sometime later after league start.