Skip to content

Windows fix for Documents folder not being in the default location. - #51

Merged
MCMi460 merged 1 commit into
MCMi460:developmentfrom
HotaruBlaze:WindowsPathFix
Nov 3, 2022
Merged

MCMi460 merged 1 commit into
MCMi460:developmentfrom
HotaruBlaze:WindowsPathFix

Conversation

@HotaruBlaze

@HotaruBlaze HotaruBlaze commented Nov 2, 2022 •

Copy link
Copy Markdown
Contributor

Windows allows you to move/store a users subfolders, such as Documents in a different location, This could be another hard drive to make reinstalling not as tedious.
explorer_3INTsJl4U0
The below code however assumes that these are only stored in the default location, such as C:\Users\Username.

os.path.expanduser('~/Documents/NSO-RPC')

This commit resolves this by wrapping the path in a getAppPath() function, and attempting to get the path from Windows and falling back on the above method if it fails or not on windows.

Attempting to use the Default location can cause strange behavioural issues in windows, depending on how the locations were setup. as well as how the application handles it.


I also believe this could have affected #10 however this issue is stale and I haven't tested Windows 11

Edit: This PR should resolve errors such as
vmconnect_ipqU8ZLmMW

@MCMi460
MCMi460 merged commit 495a012 into MCMi460:development Nov 3, 2022
@MCMi460

MCMi460 commented Nov 3, 2022

Copy link
Copy Markdown
Owner

Thank you so much for doing this!
I also added commit e1731d8 to use this function for logging files and temporary token files. Thank you again for spending time on helping me with this problem.

@HotaruBlaze
HotaruBlaze deleted the WindowsPathFix branch November 5, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants