Page 1 of 1

session_setup cmd mklink privileges

Published: January 23, 2019 - 03:19
by btravers
Hello,
I'm trying to create a package for Android Studio. This program requires additional 'SDK' files that exceed one gigabyte, and a download is necessary for each user. A workaround is possible by creating a symbolic link each time a new session is opened. I tried adding the `MKLINK` command to my package's `session_setup()` function, but I get an error because this command requires administrator privileges.
Is there a way to do this?

Thank you.

- Installed WAPT version (1.6.7)
- Server OS (Linux) and version (Debian Stretch - Repository: Windows Server 2016 R2)
- Administration/package creation machine OS (Windows 10)

Re: session_setup cmd mklink privileges

Published: January 25, 2019 - 3:26 PM
by dcardon
Hello Bastien,
btravers wrote: Jan 23, 2019 - 03:19 I'm trying to create a package for Android Studio. This program requires additional 'SDK' files that exceed one gigabyte, and a download is necessary for each user. A workaround is possible by creating a symbolic link each time a new session is opened. I tried adding the MKLINK command to my package in session_setup(), but I get an error because this command requires administrator privileges.
Indeed, the mklink.exe command requires elevated privileges... One way to obtain elevated privileges is to use a scheduled task. You can grant the task local system access for execution, and allow a user to initiate the execution. The task would then only launch mklink (it's a simplified version of sudo in Windows...). It's not elegant, but it works.

You can also check if it's possible to put the link in the Default profile (for new profiles), and to update the profiles already existing on the machine.

Another idea is to see if it works by putting it in the "All Users" profile (which is more or less merged with the user's profile when logging in).

In any case, we can look at it on Monday when you come to the office!

See you soon, and have a good weekend

Denis