This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cygwin lnk creation app


I've finished a small (one C file) Windows-link-creation app for possible
inclusion in Cygwin, maybe in utils. Here are some examples and a GPL
question.

Usage mklink.exe [OPTION]... TARGET
NOTE: All filename arguments must be in unix (POSIX) format
  -a|--arguments=ARGS   use arguments ARGS
  -h|--help             output usage information and exit
  -i|--icon             icon file for link to use
  -j|--iconoffset       offset of icon in icon file (default is 0)
  -n|--name             name for link (defaults to TARGET)
  -v|--version          output version information and exit
  -A|--allusers         use 'All Users' instead of current user for -D,-P
  -D|--desktop          create link relative to 'Desktop' directory
  -P|--smprograms       create link relative to Start Menu 'Programs'
directory

Some examples of what the app (which I've called mklink but could be called
winlnk--or anything else really) can do:
./mklink -DA /usr/local/ #creates a "local.lnk" on the All Users/Desktop
./mklink -n foo/bar -D /usr/local/bin #creates a "bin.lnk" in the folder foo
on current user's Desktop
./mklink -i /cygwin.ico -P http://www.cygwin.com #creates a
"www.cygwin.com.lnk" in user's SM Program Files dir
./mklink -n ~/foobar /bin/rxvt.exe #creates a foobar.lnk to rxvt (with no
options) in home dir
./mklink -a '-rv -tn rxvt -fn "FixedSys" -e /bin/bash --login -i' -n
"Internet Explorer.lnk" -i /c/WINNT/system32/SHELL32.DLL -j 106 /bin/rxvt #
creates a link in the PWD to rxvt with my favorite options--confusingly
titled and iconed to look like IE

This could be useful to package maintainers to use in shell scripts to
create, for example, a link in the SM Programs\Cygwin directory to the
Cygwin FAQ. It could also, at some convenient time in the future, replace
the link-creation routines currently in setup.exe.
The only the caveat is that currently setup.exe also checks whether the user
WANTS links all over their Start Menu.

Now, for the GPL question. I noticed that ln -s creates a symlink and a
winlink. At first I thought this would be as simple as putting the posix
path as a description, but that doesn't work. Now, so far all I've used are
the setup.exe sources mklink2.c and desktop.cc, both (c)RedHat, and MSDN
documentation of Shell Links. But the ln sources are (c)FSF. If I looked at
those sources for code I would not be able to assign this code to RedHat,
correct?
Thanks.
Joshua Daniel Franklin


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]