ZephyrBlu / zephyrus-autouploader

A small Electron Desktop app that automatically uploads StarCraft II replay files to Zephyrus
MIT License
1 stars 0 forks source link

Autouploader doesn't correctly identify the location of the Documents folder on Windows systems #5

Open hodgep opened 3 years ago

hodgep commented 3 years ago

hi,

On Microsoft Windows systems there is a feature to have the operating system use a different folder for well known folders, such as the Documents folder.

The Autouploader seems to work on the assumption that the documents folder is always in "/Users/${user}/Documents" however this is not always the case and StarCraft II will follow the documents folder to the location where the operating system says that the documents folder is.

I am not an electron developer but I have had a bit of a look though the code and I think I have identified the problem.

In replayWatcher.js we have the code (slightly edited as I couldn't figure out how to stop it escaping the code block) if (process.platform === 'win32') { accountPath = '/Users/${user}/Documents/StarCraft II/Accounts\'; }

I believe that this should be using the electron api app.getPath('documents') which will ask Windows the location of the documents folder. This will then respect user preferences and system configuration settings, always returning the correct location.

Alternatively, if you use the 'Change accounts directory' button, the app doesn't save the new directory for the next app launch requiring a change every time.

ZephyrBlu commented 3 years ago

Hey!

Thanks for pointing these out. I'm not an electron developer either :).

There are a couple of other things I wanted to change about the electron app (Remembering login details and implementing auto-updates), so I'll open a PR and start working on all of it soon.