Windows driver installer which installs java native libraries as well - java

Basically I'm looking to create a silent windows installer which will install Windows drivers and a Java native library (RXTX) which our program use to communicate with the device.
We have drivers for Windows XP, Vista and 7 32bits and 64bits to install. As for the Java native lib, it's only a single file but we have to read the registry first to get the JavaHome path in order to copy the dll at the right place (JavaHome/bin).
I heard about the DIFx framework but I don't know if it can browse the registry and extract a file path from the key. In the other hand, I might be able to just do this with a small C# software but I'm afraid I'll have problems installing the drivers which (AFAIK) needs to be installed in a driver store in Windows vista and 7 but not in windows XP.
Any idea what I could use in order to do this?

I ended up creating a small Visual C++ program which browse the registry using RegGetValue() to find the JavaHome and copy the Java native library in there. As for the driver installation, I used DifxAPI (DriverPackagePreinstall()).
For now I only tested this solution on Windows 7 64-bit but so far it's working as expected.

Most setup authoring tools offer driver support, and can even install Java libraries. Here is a list that can get you started: http://en.wikipedia.org/wiki/List_of_installation_software
After you decide on a tool, try to use it for your package. If you encounter problems you can then ask more specific questions.

Related

Exporting as stand alone application

I exported Processing application as a standalone application with embedded Java, but the exe does not work in computers where Java/Processing is not installed. Even if the Windows 64 bits works with Java embedded, the 32 bits does not work with Java embedded or not. The computers that do not have Java already installed open the Windows 64 bits exe but not the Windows 32 exe (with java embedded in its exporting process). Here's the post in Processing forum: https://forum.processing.org/two/discussion/25373/no-export#latest
Can it be resolved? Thanks.
You can only include the Java version for the type of machine you're running on.
If you're on a 64-bit Windows machine, then you can only include Java in the 64-bit Windows application. If you're on a 32-bit Linux machine, then you can only include Java in the 32-bit Linux application.
If you really want to include Java for a bunch of different machines, then your best bet is to find each type of machine and do the export from them. Find a 32-bit Windows machine and do the export there, then find a 64-bit Linux machine and do the export there, etc.
You might be able to hack something together by downloading the JRE for each type of machine and manually including it, but that might get pretty tricky. Note that this is not as simple as just copying a folder into your application directory. You're going to have to change the run script file as well.
Shameless self-promotion: I've written a tutorial on exporting applications from Processing available here.

Make Installer of java Application

I have tried this two setup for making installer of java application.
Exe4j
Inno setup
I have used these 2 setups for making a java application installer.but when I installed on another operating system (Microsoft OS) windows 7 or 8 then its gives error No JVM could be found on your system...
I am stuck in for 2 days.
java application store data into 2 text file and then on text file generate at run time and then delete generated file after some processing. I don't know how should I generate a setup for java application....please anyone?
This might be of interest launch4j. It's possible to wrap applications on Windows, Linux and Mac OS X and can be configured to search for a certain JRE version or use a bundled one
We also have a feature in Advanced Installer, Java edition, that can be used to package your Java application for Windows and for Mac OS.
Here is a 1 minute video that shows how easy it is to build your installer.
Advanced Installer also has the ability to bundle a specific JRE version inside your installer, so your application will use only that JRE, no matter if on the end user machine there is another version of JRE or none at all.

Java Application Correctly Referencing 3rd Party Libraries in Windows 7 But Not In Windows 2008 Server

I have developed a Java application that references a third party library. Let's call it SW_Lib and the sub folder containing relevant DLL and Lib files SW_Lib\lib.
The application works fine on Windows 7 Professional. I have used Windows 7 Professional for development and testing.
I wish to run the application in production on a Windows 2008 Server Standard (64 bit) operating system. And this is where I am encountering problems. While the application compiles fine, it complains at run time due to its inability to dynamically link the SW_Lib libraries.
In Windows 7 workstations, I have set the Path environment variable correctly to reference SW_Lib libraries. For my example, it simply says C:\Java\SW_Lib\lib. This works perfectly in the Windows 7 workstations.
In the Windows 2008 Server, I set the Path environment variable in exactly the same way and made sure that all directory structures are the same in both Windows 7 and Windows 2008 Server.
But my application simply cannot reference a particular DLL in SW_Lib\lib folder at run time in the server. I have looked at the internet for clues and it seems that setting the Path environment variable correctly should prevent me from having this issue, except that this is currently not working in Windows 2008 server.
I am using JDK 1.8 and am wondering if there are any backward compatibility issues with that and Windows 2008 Server. Many thanks.
Are you talking about native libraries or jars?
If native libraries, have you checked java.library.path System property in both environments?
Are both environments running same 32/64 bit architecture?

Port Java6 along with application

I have a Java desktop application for Mac, and we are porting Java along with the application. The issue, is that the Java we are using is strictly Java6 and not Java7 (Because Java7 does not have -d32 mode).
So I downloaded Java6 jdk from the apple developer site and have bundled it in the package. And it all works well. But when I try running on other Mac's, then it throws the following error:
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
$ ./java -version
dyld: Library not loaded: #rpath/libjli.jnilib
Referenced from: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/./java
Reason: image not found
Trace/BPT trap: 5
As per this, it tries searching for the respective directory at /Library/Java/JavaVirtualMachines/ and not in the folder I ported along. How can I solve this issue?
How should I port Java6 along with the application.
Secondly, the Java6 I have used is jdk as I could not find the Jre of Java6. It will be appreciated if someone can provide or share Jre6.
Does Apple licensing even allow their JRE to be redistributed with a third-party app?
I think you are making things harder than they need to be. If a user does not have Java 6 installed (possible in OS X 10.7 and 10.8), the Mac OS will automatically prompt the user to download and install it the first time a Java application tries to run. It will then automatically continue launching your app once it's installed.
Just make sure you are bundling your app appropriately for Java 6 (e.g., using the old Mac Jar Bundler app or manually creating an equivalent Info.plist) and not Java 7 (e.g., using the new Oracle appbundler.jar).

Java server jvm installation on windows 32 bit systems

I am trying to bundle java as a part of a java product that should be installed silently with a single click and are having some issues:
My installation has the following requirements:
Has no be silent and require no user input or action excpect a doubleclick on the installation file (no configuration and post install steps)
Has to setup java so that JAVA_HOME points to a Java SE installation with a server jvm
Is this at all possible to do this on a win32 system with sun java installers? I know that by default the jre does not contian a server jvm. But even when installing the jdk the public jre which is installed (and mapped to JAVA_HOME) does not contain a server jvm. In sun own README file (Sun README) they suggest copying the files:
jre\bin\server\
On Microsoft Windows platforms, the JDK includes both
the Java HotSpot(TM) Server VM and Java HotSpot Client VM.
However, the Java SE Runtime Environment for Microsoft Windows
platforms includes only the Java HotSpot Client VM. Those wishing
to use the Java HotSpot Server VM with the Java SE Runtime
Environment may copy the JDK's jre\bin\server folder to a
bin\server directory in the Java SE Runtime Environment.
But this solution is difficult to automate gracefully in a silent install. There has to be a better way to do this without repackaging the entire java distrubution. Has anyone encountered the same problem and come up with a more elegant solution?
For the past years, I manage Java like this: I download the installer, install it somewhere, package all files into a ZIP and then use that ZIP file to deploy Java anywhere. The installer will leave a lot of stuff in the registry and %WinDir%, etc. which you don't really need. This also allows me to move some files around (like the bin\server\jvm.dll or security related settings).
That way, I can even embed Java inside the application directory, independent of any already installed version of Java.
Just set JAVA_HOME in a small batch script before starting your application and you're good. You can use %~dp0 to make it completely position independent (%~dp0 expands to the path leading to the batch file).
Make your own installer.
I use inno setup compiler, works well for my purpose.
If you need the registry entries, you can export them, include them in the installer, include the files, and a little change here and there and you're done. Silent installer that configures things to the exact specifications you need.
It comes with an easy to use script wizard.
I mention a specific one because it's free. Ultimately, making your own installer is the solutions.

Categories