Forum Bugs

Pass license via command line parameter when in control mode

twouters
Hi,

It was suggested to us to pass the license to prince by making the <signature> element empty in the license file and then passing it as a command line parameter --license-key.
The provided java wrapper did not support extra command line parameters when running in control mode, so we added that. However, the license still doesn't seem to have any effect when running in control mode vs when running in normal executable mode.

Am I doing something wrong or is there a reason for this?

Thanks for your help.
mikeday
It works when I test it locally, would you be able to send me (mikeday@yeslogic.com) the modified Java code?
twouters
Hi,

The change is quite simple. I just added the following lines right before the return statement of getBaseCommandLine() method in Prince.java:

if (mOptions != null)
{
	for (String option : mOptions)
	{
		cmdline.add(option);
	}
}


The command line then looks like this:

princexml\bin\prince.exe --license-key=xxx --control

Could the order of the switches have an importance?

Edited by twouters

mikeday
Can you try running this exact command manually from the command-line with the --debug flag as well, then type "end" when it prompts for input and see what output log you get? For example:
$ prince --license-key=INVALID --control --debug
ver 11
Prince 12.4
end
msg|dbg||init locking for OpenSSL
msg|dbg||loading license: /usr/lib/prince/license/license.dat
msg|inf||loading document: /usr/lib/prince/license/license.dat
msg|dbg||loaded resource: /usr/lib/prince/license/license.dat
msg|dbg||loaded resource: type: no
msg|wrn|/usr/lib/prince/license/license.dat|invalid license file

Note the last line about invalid license file, which goes away when I specify the correct license key.
twouters
I got it to work. I'm not sure what I was doing wrong before. Thank you for your help.