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

Fix #61 (insufficient rights to create symlink) #69

Closed
wants to merge 2 commits into from

Conversation

wschildbach
Copy link

On Windows 10, symlink creation is not allowed unless the process runs with elevated rights.

As per https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/#joC5tFKhdXs2gGml.97, starting with Windows 10 Insiders build 14972, symlinks can be created without needing to elevate the console as administrator.

To use this functionality, 0x2 needs to be set in the flags argument for the CreateSymbolicLinkW() call. This fixes #61 .

A separate patch for the integrated AddOnManager is forthcoming.

On Windows 10, symlink creation is not allowed unless the process runs with elevated rights. 

As per https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/#joC5tFKhdXs2gGml.97, starting with Windows 10 Insiders build 14972, symlinks can be created without needing to elevate the console as administrator.

To use this functionality, 0x2 needs to be set in the flags argument for the CreateSymbolicLinkW() call. This fixes FreeCAD#61
@wschildbach
Copy link
Author

Note that this still fails unless the user has activated developer mode. This should probably go into notes somewhere, or be printed when the symlink creation fails.

@luzpaz
Copy link
Collaborator

luzpaz commented Apr 16, 2018

@wschildbach do you mind opening a thread on the FC Forums in regard to this issue for more community discussion ? Thanks

@luzpaz
Copy link
Collaborator

luzpaz commented Jun 26, 2018

@sgrogan write in #61 (comment)

It should be good on Win10, I don't see a path to backwards compatibility on Win.

@yorikvanhavre
Copy link
Member

This will actually only serve pre-0.17 versions (in 0.17 onwards it is bundled with FreeCAD itself, and IIRC symlinks are not used anymore on win) so I think we can consider this macro as deprecated now. I don't know if it's better to apply this patch or not..

@luzpaz
Copy link
Collaborator

luzpaz commented Aug 1, 2018

is there a way to conditionally apply it if a user is running windows and pre-0.17 FC ?

@sgrogan
Copy link

sgrogan commented Aug 3, 2018

I don't think the patch will cause any problems. No need to conditionally apply it, the question is how long to maintain the macro.

The only utility I see is if a user is using 0.16-legacy and using add-ons. Don't know how many add-ons work with this version.

IMHO the macro is obsolete, superseded by built in functionality, and can be removed from the repo.

@luzpaz
Copy link
Collaborator

luzpaz commented Aug 3, 2018

Some on older machines still use 0.16 we've even seen 0.15 on the forums recently.
Maybe we can make a note to merge and then revisit removal when 0.18 is released ?

@yorikvanhavre
Copy link
Member

I think we could remove the macro, it probably doesn't even work anymore...

@sgrogan
Copy link

sgrogan commented Jun 29, 2019

Agreed

@wschildbach
Copy link
Author

Seems the question is more about deployment than the code behavior, but let me know if I can help by testing...

@yorikvanhavre
Copy link
Member

Okay we decided to remove the macro, because it is too old now, and, since the addon manager now seems to work for everybody, it would only be useful for pre-0.17 users, I don't think (I hope!) there are many left :) So this PR doesn't apply anymore... I'm closing it then, thanks anyway for the effort and help @wschildbach !

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.

Creating a symlink on windows requires admin rights
5 participants