Skip to content
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

[Windows] Move user directory away from Documents? #566

Open
spoenemann opened this issue Jan 23, 2020 · 4 comments
Open

[Windows] Move user directory away from Documents? #566

spoenemann opened this issue Jan 23, 2020 · 4 comments
Assignees
Labels
os: windows Specific to Windows operating system topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@spoenemann
Copy link

Bug Report / Discussion

The Pro IDE issue arduino/arduino-pro-ide#179 is caused by a Windows 10 feature called Controlled Folders (see also PowerShell/PowerShell#8857). As a consequence, action is required by users who have this feature active on their Windows installations:

Controlled folder access works by only allowing apps to access protected folders if the app is included on a list of trusted software. If an app isn't on the list, Controlled folder access will block it from making changes to files inside protected folders.

Apps are added to the trusted list based upon their prevalence and reputation. Apps that are highly prevalent throughout your organization, and that have never displayed any malicious behavior, are deemed trustworthy and automatically added to the list.

Apps can also be manually added to the trusted list via SCCM and Intune. Additional actions, such as adding a file indicator for the app, can be performed from the Security Center Console.

(from the Microsoft Docs)

Maybe it would be better to use another user sketch / library directory in the future in order to avoid such hassle, e.g. $HOME\Arduino instead of $HOME\Documents\Arduino. However, that would also mean to provide migration utility, e.g. by offering to copy / move the existing sketches and libraries to the new location.

If the user directory stays the same, the CLI and Pro IDE documentation and FAQ should explain how to resolve problems related to Controlled Folders.

@rsora rsora added kind/bug os: windows Specific to Windows operating system labels Jan 24, 2020
@pra-dan
Copy link

pra-dan commented Mar 4, 2020

The simplified issue is: Controlled folder access sees Arduino as an untrusted application and hinders its access to the working/save directory HOME\Documents\Arduino.

Controlled folder access is especially useful in helping to protect your documents and information from ransomware that can attempt to encrypt your files and hold them hostage.

From the microsoft docs on Controlled folder, only Windows 10 and Windows Server 2019 users suffer from this.

Controlled folder access is supported on Windows Server 2019 as well as Windows 10 clients. It can be turned on via the Windows Security App, or from the Microsoft Endpoint Configuration Manager and Intune, for managed devices. Controlled folder access works best with Microsoft Defender Advanced Threat Protection, which gives you detailed reporting into controlled folder access events and blocks as part of the usual alert investigation scenarios.

Until the issue is solved by Arduino, simple hacks include

  • Adding Arduino IDE to trusted list

Apps can also be manually added to the trusted list via Configuration Manager and Intune. Additional actions, such as adding a file indicator for the app, can be performed from the Security Center Console.

  • Whitelist Arduino IDE

You can also allow or whitelist apps to give them access to the protected folders.

  • Disabling Windows Defender Antivirus real-time protection

Controlled folder access requires enabling Windows Defender Antivirus real-time protection.
Note: The above methods have not been tested on the Arduino IDE but quoted from Microsoft's site for general apps

@matthijskooijman
Copy link
Collaborator

Hm, this sounds annoying.

Moving the (default) sketchbook location outside of the Documents folder (i.e. one level up) does not seem a useful solution, because there it becomes less visible to to users. Sketches are documents, just like one could create a new text document and would want to save it in the documents folder.

How does this work for other applications? Is there a mechanism that if you use a standard Windows "Save file..." dialog to select a file that you can bypass this protection? Or is every Windows application in the future going to run into issues saving a user's documents? And will that then result in applications saving to random other locations resulting in a big mess?

I don't have too much right to speak here, not being a Windows user, but this seems like an issue that should maybe solved on the Windows (user) end rather than then by changing defaults on the arduino-cli side?

@per1234 per1234 reopened this Mar 30, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234
Copy link
Contributor

per1234 commented Apr 12, 2022

I haven't seen evidence so far that this is causing problems for a significant number of users.

I have been recording reports in my notes and I will transfer that information here so that it can be used in any future evaluation about whether the location needs to be moved or troubleshooting documentation produced:

@umbynos umbynos added the topic: documentation Related to documentation for the project label Oct 13, 2022
@umbynos
Copy link
Contributor

umbynos commented Oct 13, 2022

Since this is not affecting many users, I would prefer to have a troubleshooting guide in the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows Specific to Windows operating system topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

7 participants