Friday, August 3, 2007

Installer Progress Report

Hello again. Well, I got cracking with Vmware this evening, and I have ironed out a few of the bugs with the "naive" installer.

  • When loading the MySQL package silently, some trickery is needed to set the root password since it is initially blank. This requires starting the MySQL server with the --skip-grant-tables (probably not exactly right, but that's the command in general) and then setting the password. After this process, the MySQL server needs to be restarted with the normal options prior to running the OpenMRS SQL scripts. This is something that I had missed earlier. Luckily, you can do process management on the command line with Windows XP; I never knew this. So, I added a "tskill mysqld" line to the BATCH file, and that problem is solved. I then found that the MySQL service was actually being installed properly via the BATCH file.
  • There were some hacky environment variable settings in use for this naive installer because at the time I added these features I was working on my production system on-site. Given that, I didn't want to un-install Java just to find out where the silent Java install was going to place the JRE (for use in setting the PATH variable, and the JRE_HOME variable for Tomcat's startup.bat). So, on-site I just hard coded the location of the current Java installation. This would explain why it wasn't working for Paul when he tested it, or myself in my Vmware image. I fixed that in terms of Java, but for some reason the environment variable for Tomcat doesn't seem to be taking effect.
Those are the 2 major things I was able to correct tonight. It took me a while to get the whole Vmware system up and running so I could take a decent snapshot of it. An important lesson I learned was to copy the installer exe from your primary source (flash drive/host operating system) to the Vmware image prior to running it. Otherwise, very strange things occurred with the file paths in Bitrock and there was an error generated, although the script seemed to execute fine.

The current issue is with Tomcat. For some reason it is requiring a JDK instead of just a JRE. My understanding up to this point was that OpenMRS only required the JRE... As I did some reading I learned that from Tomcat 5.X and up, Tomcat only requires a JRE and that you could set both JRE_HOME and JAVA_HOME to the location of a JRE's bin folder. This is contrary to the error startup.bat gives stating that JAVA_HOME must be set to a JDK and not a JRE. Feeling hopeful, I tried this, but it failed. If JDK is required instead of just a JRE, that changes things. A lot. The dependency checking code would have to be updated to search for the JDK command, which I believe is just "javac". Luckily the JDK bundles a JRE with it, so as long as the JDK was up to date, we could safely assume that the JRE was up to date as well. I would have to change the installer exe for the Java dependency to be that of the JDK instead of the JRE.

Once I get these questions answered, I'll move forward and get the Tomcat service issue fixed, and you guys will have a release of the "naive" installer tomorrow (Saturday). My goal is to release the dependency checking version on Sunday, but my mother has decided to come to town on Sunday, so it may be Monday depending on how well things go tomorrow with the "naive" installer.

As always I'll keep you updated. Thanks.

3 comments:

Ben Wolfe said...

Dirk may have to weigh in, but I think the previous installer only bundled the JRE with the installer. I am fairly certain people have had openmrs up and running without the jdk, but at the moment I'm not sure who that was. There must be some other variable you need to set.

Is there a way you can dive into Tomcat's setup file and see what they do if you only provide a link to a JRE?

private said...

Actually, as I recall he provided the JDK because I remember downloading the JRE installer and replacing his. I was tipped off to this when I tried to do a silent install with his exe and it failed; I then realized he provided the JDK exe. I thought about what you just commented last night, and I tried to install Tomcat with the install wizard and it also failed to start. I then went into the Services, and tried to start it there, it failed again. Once can only assume it's for the same reason since this clean machine does not have the JDK on it and every machine I've ever personally tested the installer on has had a JDK due to Netbeans.

private said...

Actually, scratch that. Dirk was providing the JRE. Regardless, I tried to use Tomcat's installer to install and load Tomcat on this clean machine, and it failed, and if I try to run "startup.bat" it says JAVA_HOME must be set to the path of a JDK...