cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Peston
Level 3

Symlinks in speedfolders

I would like to use a speedfolder to install my project because my product has a reasonably complicated directory structure. Within the directory structure there are some symlinks which point to different areas - for instance within the 'lib' directory there are symlinks which point to actual libraries because they logically live as a separate module in a different directory (but still all under the main project directory)

I have tried using a speedfolder to install the product, but I find that symlinks are not preserved. Instead I end up with two copies of the same object, rather than one copy and a symlink. Is there a way to get speedfolders to recognise symlinks? The UNIX tar command can do this without problems, and I imagine that InstallAnywhere would be far more powerful than that.

Thanks in advance for any help that you can offer.
Labels (1)
(7) Replies
pv7721
Level 20

SpeedFolders are jar files, so I'm not sure if jar has support for storing symlinks (instead of files pointed by those links) or maybe if it has, then IA doesn't pass the correct parameters when creating the .jar files. What you may want is to use the Expand Archive action which supports .tar files.
0 Kudos
Peston
Level 3

Thank you for the reply. Jar file do not support symlinks (on the basis that not all platforms support them), so that explains why it doesn't work. I'm interested in your comment about tar files. The documentation and the GUI both say that supported file types are:

• ZIP files (.zip)
• Java archives (.jar)
• WAR files (.war)
• Enterprise archives (.ear)

Which does not include tar files. I have found that tar files can be made to work, but I have been reluctant to use them because I have not found a support claim for them. Do you have any insight on this? Also, the way that I got a tar to work was to rename it as a zip file. Do you know of a way to add a tar file and still retain the .tar extension?
0 Kudos
pv7721
Level 20

Oh, I might have been wrong about .tar files then. But what could prevent you from using zip instead of tar? I personally use something like:
zip -9vryT filename.zip parent_folder/

whereas y does exactly that, stores symlinks as such in the resulting .zip file.
0 Kudos
Peston
Level 3

That's a good idea. This works quite well using command line zip on my Linux machine, however it doesn't work using the "Expand Archive" function of InstallAnywhere. Instead of symlinks, it creates files whose contents are the file name which the symlink should have pointed at.
0 Kudos
weelyn
Level 5

For what it's worth, to work around this limitation, I turn symbolic links into .SYMLINK files which contain the link text. For instance:

ls -l
lrwxrwxrwx ... foo -> bar


I convert this way:

ls -l
-rw-r--r-- ... foo.SYMLINK

cat foo.SYMLINK
bar


Then I have a bit of Java code which scans the install dir for .SYMLINK files, for each file it reads the contents and use "ln -s ..." to create the right symlink. Not very elegant but it works.
Peston
Level 3

It's a clever way to work around the problem. I'm of the opinion that the problem shouldn't be there in the first place. "tar" has been doing symlinks for over 20 years and I would expect a product with the words "Anywhere" and "2010" in it's title to be able to cope too. Perhaps we may get better in 2011?
0 Kudos
weelyn
Level 5

IMHO the problem is Java. Jave is missing a few features like symlinks, chmod, getpid() (although there's a trick to get the pid)... Sure, these features are not always available on all operating systems; but saying "if it's not available on all OS it's not in Java" is seriously limiting Java as a system tool (and byt the way I think all OS have getpid()). Java for applications: OK. Installers: could be better.

That being said, InstallAnywhere does an impressive job demonstrating that Java can be used to make installers anyway.

Now InstallAnywhere could indeed provide some "actions", or even just code sample, to deal with symlinks and other OS oddities. Well, that's what is forum is for, isn't it? 😉