tareqimbasher / NetPad

A cross-platform C# editor and playground.
MIT License
1.12k stars 60 forks source link

ScriptDirectoryPath could use protected folder #134

Closed sebastienros closed 3 months ago

sebastienros commented 8 months ago

In my domain the %userprofile%/Document folder is restricted and random application are not allowed to alter it. In my case it make NetPad hang on startup because it tries to create the Scripts folder.

Instead of using Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) maybe it could use the local app data folder too. Or detect that it's not allowed (timeout) and fallback to something else, or just skip this part.

As a mitigation I believe I can setup another folder in config.

tareqimbasher commented 7 months ago

I agree. Does it hang for some time and then eventually open or does it hang indefinitely?

You are correct, you can setup a different folder in the config. If you can't get to the UI to do it, you can edit the settings.json file (the scriptsDirectoryPath property).