Skip to content
⌘ NSIS Forum Archive

Java Launcher question

4 posts

mykell#

Java Launcher question

Hi,
I used the java launcher script (http://nsis.sourceforge.net/A_slight..._Java_Launcher) to create an exe for my application and it worked great. however now it turns out I cannot pass arguments to it.

running my application without the lanucher would usually look like this:
java MyApp ARGUMENT

Now with the lanucher I would like to pass the arguments in the same way, but it doesn't seem to work:
MyApp.exe ARGUMENT

How do I modify the script for the lanucher or how do I pass the arguments to it (I actually only need one argument).

Thanks in advance
Best regards,
Mike
Comperio#
I have not used the Java EXE wrapper, so I can only assume that it would work as any standard EXE would, such as:

Exec '"$INSTDIR\someprogram.exe" some parameters'
Does the same command work from a Windows RUN box? If so, then the above example should work. If not, then you'll probably have to lauch it using the java command as shown in your original example. (Unless there's an extra command in the Java launcher script utility to allow parameters.)
kookh#
See chapter 3 in the NSIS User Manual about command line usage. Get the arguments passed to your installer and then pass them to your java (.class ?) file.
mykell#
Thanks guys
I used this script (http://nsis.sourceforge.net/Get_command_line_parameters), merged it with the java launcher and everthing works great.

now I only have to merge the lancher with the installation script... but that's a different story🙂

best regards
mike