I am trying to run shell scripts in Windows XP using Java. I found that we can run shell scripts using cygwin in Windows, but what if it is not installed on the system?
I want to check whether it is installed on machine, if it is not installed - add that software as a part of my application and install it.
If cygwin complains with windows installer standards then when you install it you should be able to find a registry entry for this program.
You should check the registry for something like localmachine/software/cygwin.... this validation can be done using RegistryKey class in c#.
To include this program as a dependency you must provide the way you are installing your app, visual studio windows installer? Inno installer?
Related
I am starting a Windows Server AMI and would need to have java 8 installed after boot. I already have an instance-setup.txt script to install the codedeploy-agent automatically (from here: http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-set-up-new-instance.html), but would need to install Java 8 at the same time. I have no idea how to automatize this though, did anyone manage to do it successfully by any chance ?
Thanks !
Emmanuel
The Java installers for Windows provide the ability to run an installation in silent mode via the command line or a script. If you package a Java installation executable with your deployment you can run a silent install like this:
jre-8-windows-i586.exe /s
Check out the documentation on Windows Installer Options for Java for more information and other available options: http://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_installer_options.html
I have the java program which will be triggered from windows .bat file (having call to java program and requires JRE 1.6 on the client machine(calling machine) to run the java program.
Is that possible to configure this job on control-M? I am not sure how the control- M configuration of a job will be done, hence wanted to know if we will be able to install JRE 1.6 or above on the Control-M machine and is possible to run the .bat file from control-M.
Yes, It's possible to run a bat from Control-M and get the return code to stablish the ending state of the Job.
Complete information about how it works in the BMC Control-M Manual: http://www.scheduler-usage.com/document/Version/630/Books/MAW620300AG52365.pdf
JRE Must be installed in the machine before to work with good performance and with a correct environment.
You probably can check if JRE 1.6 is installed in the bat and install it but it's a complicated process with probably thirdparty tools and use of silent JRE install. Not recommended, it's better to have JRE installed as requirement to run the job.
I want to install the JDK in cygwin on my windows machine. I am downloading the linux version of JDK from oracle site using wget command. Here is the list of commands I am running to install JDK:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.rpm.bin
chmod a+x jdk-6u31-linux-x64.rpm.bin
./jdk-6u31-linux-x64.rpm.bin
All these instructions are same as suggested by Oracle for installing JDK over here but I am getting the following errors:
Firstly, those messages indicate that what you are trying to execute is an HTML document! In other words, the download has failed and given you an error page rather than an installer.
However, assuming that you succeed in downloading the (Linux) installer, it is unlikely that it will install properly, and there is about ZERO chance that the installed tools will run. Applications that have been compiled for Linux don't run on Cygwin.
What you need to do is to download and install the JDK for Windows, and then tweak your cygwin profile a bit. This page explains: http://horstmann.com/articles/cygwin-tips.html.
(If you Google for "java cygwin" there are various other tips for making Java work from Cygwin. However, in my experience there are a few rough edges ... due to the fact that the Windows Java utilities expect to have been called with windows-style arguments, pathnames, classpaths, etcetera.)
Our users work on Mac OS-X and new versions of OS-X have no Java pre-installed.
Further I do not want to bother them with installing Java.
Is there a user friendly way to install programs with IZPack?
Can I create a zip with the installer.jar and JRE together?
Any samples?
Since it's a Mac, I can think of 2 ways to skin this cat.
Using the Mac wrapper from launch4j. Link: http://sourceforge.net/projects/launch4j/files/launch4j-3/3.1.0-beta2/
This will prompt the user to download the JRE if it is not present or embed the JRE to the installer.
Downloading a portable version of a JRE for Mac and create your own Application.app folder that can execute the installer
Note that in any case, you must have a JRE to run the installer which will make your installer fatter or will prompt the user for action.
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.