Install4j Windows Gui app does not create log file - install4j

Problem
"Windows Archive" generates log file and "Windows" not.
Setup
I'm using install4j to generate a windows gui application. I only have one launcher and redirected stderr and stdout.
Then I create two media files: "Windows" and "Windows Archive".
If I use the "windows archive" type the log files are created and filed with content.
If I use the "windows" type the log files are not created.
I know that in both cases the same error happened, so there should be the same output in both cases.
Thanks in advance

If the redirection files are not writable, you have to specify a location where they can be written such as
${installer:sys.localAppdataDir}\mystderr.log
Redirection files for generated launchers are configured on the "Executable info->Redirection" step of the launcher wizard.

Related

What is the install4j default installation directory

Can someone confirm about the default installation directory for the install4j.
It seems like its Program file in windows as context.getVariable("sys.installationDir").toString() always returns Program File/myInstallerName. So just wanted to know where it is being set in the installer wizard and from where it is getting myInstallerName.
Thanks
The default installation directory is defined on the "Installer options" step of the media wizard. By default, it is set to ${compiler:sys.shortName}.

install4j launcher issue on Mac OSX app store application

We’re using install4j to create installers for our Java application, PDF Studio.
We’re currently trying to submit our application to the Apple store and for this, need a pkg file. We’ve created a pkg file from the Application folder that is created after running the dmg installer created by install4j and are working on removing one by one all the warnings and errors reported by the Apple store.
One issue we are having is that symlinks are not allowed by the Apple store and the JRE contains a symlink for a file called libjli.dylib.
When we try to remove the symlink or replace it with the actual file, the i4j launcher for our application is broken.
When we remove the file from the install folder:
rm /Applications/PDF\ Studio\ 2018.app/Contents/PlugIns/jre.bundle/Contents/MacOS/libjli.dylib
We get an error message on launch saying "Java SE 8" couldn't be loaded because it's executable couldn't be located."
If we try to copy the file to the symlink location:
cp /Applications/PDF\ Studio\ 2018.app/Contents/PlugIns/jre.bundle/Contents/Home/jre/lib/jli/libjli.dylib /Applications/PDF\ Studio\ 2018.app/Contents/PlugIns/jre.bundle/Contents/MacOS
Then the launcher fails with no error message dialog.
If we run with install4j log enabled:
INSTALL4J_LOG=yes /Applications/PDF\ Studio\ 2018.app/Contents/MacOS/JavaApplicationStub
Then it will print "Error: could not find libjava.dylib."
Has anyone tried to do this and made it work?
It seems like the launcher is looking under /MacOS/libjli.dylib. We think it is the JavaApplicationStub executable file that decides where to look which is created by install4j.
Is there is a way to set where the launcher looks for the jre.bundle executable libjli.dylib?
You can extract the DMG and edit the Info.plist file so that it contains
<key>CFBundleExecutable</key>
<string>../Home/jre/lib/jli/libjli.dylib</string>
We will check if we can do this in general.

NetBeans - where to find the IDE log?

I reported a bug to http://issues.apache.org I have to give them a IDE log, but I have no clue where to find it?
I searched in C:\Users\MyUser but there is no folder for netbeans.
I am on windows.
The logfile is stored in the "User Directory".
The location of the user directory is shown under "Help -> About".
Inside that directory the logfile itself can be found in the sub-directory var\log and is named messages.log
You can display the log file directly inside the IDE using "View -> IDE Log". The first view lines of the logfile also include the information about the user directory.
That is helpful if you just want to copy & paste a part of the logfile (e.g. the exception of the error you are reporting).
The NetBeans IDE keeps its log messages in a file called /var/log/messages.log in the NetBeans userdir.
Windows 7 : C:\Users\joe\AppData\Roaming\NetBeans\7.2\var\log\messages.log
Windows XP : c:\Documents and Settings\joe\Application Data\NetBeans\7.3\var\log\messages.log
Application Data directory is localised to your Windows XP installation language
Source : http://wiki.netbeans.org/FaqLogMessagesFile
For macOS it is located here:
/Users/{username}/Library/Application\ Support/NetBeans/{version}/var/log/messages.log

Jar file packaged in install4J has restrictive permissions

I'm testing out Install4J 5.1.5 and am running into a little issue. My original jar file I would like to distribute has full permissions-- anyone can open it (with something like 7zip)-- and modify/delete any entries in that jar. However this same jar-- when installed by install4j-- the permissions become essentially read-only. I can't modify/delete anything in the jar after installation-- gives me permissions issue.
The reason why I want to modify/delete is that there are a few properties files in the jar that get defined by the user during installation so I want to modify / delete whats already in there with the user's new files...
The only thing I can think of is that I set the default unix file and directory modes to 777. But this doesn't seem to work. Any ideas?
The installer has a helper process that runs with elevated permissions. This helper process is started by the "Request privileges" action that is by default added to the "Startup" node of the installer.
All actions whose "Action elevation type" property is set to "Elevate to maximum available privileges" are executed in the helper process.
If you want to modify the file in your application (i.e. not in the installer), you can use a "Add Windows file rights" action to make the file writable for everybody.

How to get the Log File Viewer working in install4j?

I'm trying to use the log file viewer in my install4j installation, and no matter what I do the text box is empty. The log file doesn't exist when the form is shown. When the user clicks next, a batch executable runs that calls a java process and that creates and writes out to this log file. I've successfully redirected stdout to a variable, and used the text display to show the updating variable contents but I can't get the log viewer to work for the actual log file.
I've tried several combinations of pointing to the file. No errors are ever present in the installation log.
I've used
${installer:sys.installationDir}/logs/logfile.log
logs/logfile.log
c:\program files\my app\logs\logfile.log
The problem was that relative files in the log file viewer form component were not resolved relative to the installation directory. This will be fixed in 8.0.3. In the meantime, you can prepend
${installer:sys.installationDir}/
to the "Log file" property or the "Log file viewer" form component, then it will work.