View Full Version : Create symbolic links in the Script Editor
LiquidIce
09-04-2014, 04:32 AM
Hey guys,
Is there any way to make the installer create SYMBOLIC links? I tried a "Run command line mklink /D "%USERPROFILE%\Google Drive\Desktop" %USERPROFILE%\Desktop" But it does not accept environment variables %USERPROFILE% because it says that its not defined. Is there a way to solve this?
Thank you!
linder
09-04-2014, 05:59 AM
Hello,
Because the percent sign is used to signify the value of a variable, you need to use two percent signs next to each other if you want to use a percent sign in the message text of a script command. %%USERPROFILE%% should work fine.
BTW, there is a "Get System Info" -> "Expand Environment Variable" script function to retrieve a specific Windows environment variable value (in case you need this).
Does this help?
Support for symbolic links (NTFS junctions) is planned for SetupBuilder 9.
Friedrich
LiquidIce
09-04-2014, 06:45 AM
Hello Friedrich,
First of all, thanks for the help. I tried running a console command doing this:
mklink /D "%%USERPROFILE%%\Google Drive\UZ-Desktop" %%USERPROFILE%%\Desktop
I wasn't sure this worked or not so what I did was add an output to, this:
mklink /D "%%USERPROFILE%%\Google Drive\UZ-Desktop" %%USERPROFILE%%\Desktop > %%USERPROFILE%%\Desktop\output.txt
But that did nothing. On both Run Command Line I activated Show Window, but it doesn't do anything. Here is a screenshot of where its placed in the Script Editor.
http://cl.ly/image/3Z1l1A2K1J0u/Screen%20Shot%202014-09-04%20at%2014.44.01.png
Any tips?
linder
09-04-2014, 07:01 AM
Hello Alejandro,
mklink is a subcommand of CMD.EXE. That means you have to launch the command interpreter and must be run "inside" of CMD.EXE
Something like:
cmd.exe /C mklink yada yada
Does this help?
Friedrich
LiquidIce
09-04-2014, 07:23 AM
Thanks Friedrich,
That worked perfectly, it even bypassed the fact that .bat or cmd files require administrator permissions to create a symbolic link.
I'll be having some questions in the future because we bought this software and now we're really using it a lot and I'm new to it.
Thanks and regards
linder
09-04-2014, 07:25 AM
Perfect! Glad it's working fine now.
Always ask if there is any question. I am here to help :)
Friedrich
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.