|
The Windows Executable Details
The windows executable created by the JExecutable wrapping system can be configured in many ways.
- The executable name is the most obvious parameter. This is simply the name of the win32 file created by JExecutable.
- The current directory can be modified to suit your needs. For instance, if you want your executable to be in a bin\ sub-directory, but still want it to access the resources as if it were in the base directory, it may be convenient to modifiy the current directory to be ...
- When this parameter is specified, the wrapper simply changes the current directory with the value "as is". For instance, to change the current directory to a res subdirectory, write res in the Current Directory field.
|
WARNING
When run as a Windows Application, the default current directory is always the directory of the executable binary. However, for a console wrapper, the default current directory is the path where the command line is currently tied.
- Changing the current directory for a console application is probably not what you want. A common issue is for a console application to find resources which are located in the file system (i.e not in the jar of the application). Lots of application work this way, but Java applications, unfortunately, do not have access to the information they need: the location of the binary executable they are launched from. A work-around is to use an environment variable specific to your application. This is was ANT does, for instance.
- You can do something equivalent with JExecutable without using an environment variable (which may be complicated to set under windows). Instead, define a Java Property, and set ${EXECUTABLEPATH} as its value. The effect of this is to pass to your application a java property that contains the directory where the executable is located. Just use System.getProperty() call to retrieve the value.
- For GUI application, it's easier: just enable the option "Sets the executable folder as current directory of the application" and define a standard file association in Windows. Alternatively, you can also use the JNI features of JExecutable to retrieve the executable path.
|
|
- The executable icon field specify the icon image that is associated to the executable, under Windows. The default configuration of JExecutableGen support Windows Icon files (.ICO) as well as the standard types supported by the JVM (GIF, PNG, and JPG files).
- The current implementation only sets up a single icon image in the executable. Here is a brief description on how JExecutableGen creates the executable icon:
- If the user selects a standard Windows icon (.ICO), it chooses first 32x32 icons, then 64x64, then 16x16.
- If the user selects any other recognized image file, the image is scaled to be 32x32, and quantized to fit in 256 colors. The color reduction is rough and it is always better to use an image processing software for the job.
|
|
The Executable panel
|