-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add folder fallback to prevent app crash #135
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, otherwise LGTM
|
||
export const getSimbridgeDir = () => { | ||
try { | ||
return path.join(getPath('documents'), 'FlyByWireSim', 'Simbridge'); | ||
} catch (e) { | ||
Logger.warn('Could not get documents path via WinAPI, trying alternate method', e); | ||
Logger.warn( | ||
'Could not get documents path via WinAPI, Windows Controlled Folder Access is likely blocking the app. Using AppData as fallback', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we note here a documentation link to either MS or our docs for how to override WCFA if someone wants to do this? Note as a comment on the code, not the log message FYI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this ? No user is gonna look in the code and as a dev one should be able to use google :D Especially since that link will likely eventually go stale and will need updating. If anything I would suggest making a bot command for support that links to the relevant MS docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the console closes by default so only who either disabled the setting or opens it manually will see the error message. Bot command sounds fine to me
If Windows Controlled Folder access is enabled, it will prevent simbridge from accessing the documents folder and the app will crash. Added a fallback to use the appdata directory, which is not protected by default.
Note: the old workaround via powershell was removed, as the reason for platform-folders to fail was Windows blocking it as well. So it's not needed anymore IMO.
Fixes #134
Fixes #133
Fixes #130