Details
Description
If:
1. an installer is created with the run-privileged tag
2. and the installer is launched with an administrative user that is currently unprivileged
3. the installer is launched with an XML passed as parameter in order to perform an automatic install
Then:
1. the installer launches sees it needs privilege escalation
2. the installer prepares a ProcessBuilder that will invoke the native executable run-with-privileges-on-osx
3. the ProcessBuilder is constructed BUT the parameter that was passed with the XML file is ignored
4. the run-with-privileges-on-osx launches the installer again, with the correct privileges BUT without the XML argument
5. the installer runs in full GUI mode
I solved the problem by doing the following:
1. In the Installer class, before creating the AutomatedInstaller object, I store the argument in a system property => System.setProperty("izpack.cmdline_argument", args[0]);
2. In the PrivilegedRunner class, in the method relaunchWithElevatedRights() I read the system property and use it to complete the command line that is used in the ProcessBuilder.
Attached you can find the patch.
However I don't recommend using it... It's a quick hack and things should probably be done in a different way.
The patch does not apply cleanly.