install4j Preserving symbolic links within included directories - install4j

Is it possible for install4j to preserve any symbolic links found within the specified build directories, without having to manually create said links programatically? My installer has to include a large directory structure of files, but there are a fair number of relative symbolic links within said files. When I install using the generated installer, all the symbolic links are missing.

As of install4j 7 this is not possible, the file collector does not pick up symbolic links during compilation.
You could tar the distribution directory, add the tar file to the distribution tree and use a "Extract a TAR file" action on the "Installation" screen of your installer, then a "Delete files and directories" action to delete the installed tar file.

Related

Using Data Files in Install4j

I'm having trouble getting the downloadable data files to work in Install4j. Here's what I'm doing. I expected to see the "phony_license_web.txt" in the AppData\Programs\myprogram folder.
Create a file "phony_license_web.txt" in Define Distribution Tree. It is added to the Default file set > Installation directory.
Go to Media > Windows > Data files
Specify a download URL "http://localhost/testsite". There is a file at http://localhost/testsite/phony_license_web.txt.
Check "Save downloaded files on Install files.
Build the project
Test the installer
I tried a Download Installation Components action but removed it since the documentation said Install Files would do this automatically.
Thanks,
Carl
Updated Test Case
Create a data file "license_web.txt" under an IIS folder with directory browsing turned on. Going to http://localhost/components displays the file item. Clicking on the link brings up the text file.
In the Installation Components, add an Installation Component "Data Files". Set the downloadable option. There are no files checked for this component.
In Media > Windows > Wizard, select Data files and check the downloadable radio button. Enter http://localhost/components.
Test the installer
Verify that the data file license_web.txt does not appear anywhere in the installation directory (subfolder of AppData\Programs)
Downloadable data files works with installation components, not with single files. You have to create an installation component on the
Files->Installation Components
step and mark it as downloadable. Then the compiler will create data files that you have to host on your web server under the specified URL.

Avoid creating installation directory for patch installation

Today I need a solution to avoid creating a installation directory by install4j version 6.1.3 in a context of a patch installation. I wrote an installer which contains some files to install them to an existing application installation. The files should be bundled together with the patch installer. At the install files action i deactivated the install runtime selection point but the installer still created the installation directory containing a folder called .install4j. In this folder there are only some install4j files. When I deactivate the whole install files action the folder will not be created but the bundles files will also be not extracted to the temp-dircetory, right? I also marked the installation directory as an excluded file at the media-wizard. Do I missed something?
Thanks in advance
I would recommend to use the "Add-on installer" installer type on the "Installer->Update options" step.
If you need to update the version number, an alternative solution would be to remove the "Install files" action and add a ZIP file files.zip on the "Installer->Custom Code & resources" step that contains the new files. In the "Installation" screen, add an "Install content of a ZIP file" action with the "Zip file" property set to ${installer:sys.resourceDir}/files.zip.

Read a file in the external distribution before installing the files in install4j

I have a requirement to read a file that is in the external distribution before the "install Files" action is called during the installation. is it possible to read the file during the startup action or extract the file to a temp location and read it before the installation process?
Found the answer, It can be included under Custom Code & Resource files if it needs to be available before the "install files" action has run.

Install4j create user data directory

Install4j has the system variable sys.docsdir that will create a data directory in the proper place. But I can not find an action to add to the installation that will create an empty directory. What is the action? If I need to create custom script, a sample would be awesome.
The installer variable sys.docsdir contains the path to the user-specific "Documents" folder on Windows, it does not create a directory.
To install files into a subfolder of the sys.docsdir directory, add a new root under Files->Define distribution tree with the name ${installer:sys.docsdir}/myfolder and add the files below that folder.
To install to a folder that is resolved at runtime, the name of the installation root can contain your own installer variable, like ${installer:myDataDir}. In that case, you have to define that variable (for example with a "Set a variable" action) before the "Install files" action runs.
You may find your answer here, in the following link:
http://blog.ej-technologies.com/2010/12/more-installation-options-with.html
Hope it helps you.

AppEngine with Eclipse - Common war/ resources

I have been creating Google AppEngine projects using Eclipse SDK 3.6.1.
In all of the projects I have a StyleSheet default.css (all seperate copies) that I have in the war folder.
I would like to keep this file in one place to be included in all of the projects.
I have created a copy in the workspace folder.
I have tried linking the file into the war folder, it shows up as a linked file, I can edit it, and all looks fine.
When I run the application I can see by the webpage created that it is not recognizing the linked file.
I hope that I am missing something simple, I do not like keeping multiple copies of a common resource.
Any ideas?
Thanks,
RRaney
Creating a symbolic link to the file will do the job.
For example, on a Windows 7/Vista machine, run a command like this from the shell (as an administrator) to link two folders:
mklink /D C:\workspace\YetAnotherAppEngineProject\war\shared C:\workspace\SharedResourcesProject\shared
I assume that when you wrote "I have tried linking the file into the war folder" you meant that you tried linking a file/folder into the war folder using Eclipse's linked file/folder functionality. These links are limited to the Eclipse IDE and managed by it (int the .project file) - the Google App Engine runtime doesn't recognize them since it accesses the file system directly and not through Eclipse.
A symbolic link is done at the file-system level, and Google App Engine will recognize and respect it properly.
To create a symbolic link, use the "ln" shell command on Linux. On Windows Vista/7 use "mklink" (earlier Windows versions only have "hard links" which are not as nice for this purpose but should also get the job done, see the "linkd" command).
Have you tried "Static Files and Resource Files"?