symlinks work on Windows Vista and ahead only if the developer mode is on. I'm trying to write a function that detects the platform and then doesn't run if its Windows and the developer mode isn't on. Is there any way I can write code that automatically detects that?
Asked
Active
Viewed 168 times
0
-
What happens if you try to make a symlink and developer mode isn't on? Does it throw an exception? If so, you could just try it, and recover afterwards. – Ben Jun 04 '20 at 16:52
-
I think you could ask it on [superuser.com](https://superuser.com/) – jizhihaoSAMA Jun 04 '20 at 16:54
-
@Ben yes, symlinks just throw an error if developer mode is not on. Can you further illustrate what you're trying to say? P.S. I thought of exception handling, but it seems to get too complicated. – Isha Jun 04 '20 at 17:07
-
If I’m correct you don’t need developer mode to create symlinks. Without developer mode you need to elevate rights. Maybe you can use this explanation to elevate rights: https://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script – rfkortekaas Jun 04 '20 at 17:28
-
Regarding "developer mode", it was added in Windows 10. Support for unprivileged symlink creation in developer mode was added in build 14972, but it's still not supported by some calls such as `CopyFileExW`: `COPY_FILE_COPY_SYMLINK` and `CreateDirectoryExW` from a template directory that's a symlink. – Eryk Sun Jun 04 '20 at 19:05
-
FYI, obtaining the symlink privilege does not necessarily require elevation (administrator access and high integrity level). It's just that by default the privilege is only granted to administrators. It can be specifically granted to other users and groups, including well-known groups such as "Authenticated Users". – Eryk Sun Jun 04 '20 at 19:05
-
Additionally, *evaluation* of symlinks may be disabled at the system level via the L2L (local to local), L2R (local to remote), R2L, and R2R policies. By default the R2L and R2R policies are disabled, so remote symlinks can't be followed. It's reasonable to enable R2R, but R2L is silly (i.e. a remote symlink that targets a local path on the client machine). – Eryk Sun Jun 04 '20 at 19:10
-
Note that this question is asking about Windows' developer mode, not [Python's development mode](https://docs.python.org/3.9/library/devmode.html#devmode). – Flimm Oct 23 '20 at 13:47