Tuesday, August 28, 2007

Installer Progress Report

Hi again. It has been a while, for that I apologize. It seems the school year snuck up on me last Monday, and to say I wasn't prepared/aware of it would be a major understatement. This was a very hectic first week of school and I admittedly didn't get a whole lot accomplished. I feel more comfortable with that knowing that I will continue to contribute to my project well into the future; I'm not just leaving the people that hired me hanging in the wind. I did get some work accomplished tonight, however.
  • I updated the C++ code that checks dependencies and it now checks for Tomcat. The mechanism for this is actually sort of neat. You see, BitRock has built-in actions to test for the existence/execute-ability of files. So, in the C++ code I simply obtain a list of directories located inside of the standard installation location for Apache Products. Then, for every directory that it finds there, I verify that it has the text "Tomcat" in it, and also that it contains a decimal point. I check for both of these items because they are tell tale signs that there is a standard Tomcat installation located there. From here, I parse out the version number from the directory name and compare it to the minimum version number required by OpenMRS. If it satisfies this, the C++ code logs that installation as valid. Here's the neat part: Inside of BitRock when it provides the user with a drop-down box of all valid Tomcat installs that were detected, it only displays those install locations that also have a /bin/tomcat6.exe OR /bin/tomcat5.exe. This sort of thing would have been really complicated to do in the C++ code, but with BitRock's built-in actions it's simple.
  • As I was adding in the Tomcat checking, I noticed a bug in how I was handling version numbers with more than once decimal point. This is fairly common in software as there are major/minor releases. In the Math world, though, you can't make comparisons between 2 numbers unless they have a valid number of decimal points (0 or 1). The way I was handling this for MySQL was incorrect in that I was just assuming that by trimming the version at the last occurrence of the "." that I would be alright. That's all fine and well except for when there is only 1 decimal point... In that case, it was truncating it at the FIRST decimal point since find_first_of() and find_last_of() would point to the same location. I added in a simple 'if' statement to take care of that issue.
I'm currently waiting on a response from BitRock in regards to some advanced conditional evaluation logic that I need to implement. This is the code that is responsible for only displaying Tomcat installs that actually contain the tomcat5/tomcat6 binaries as opposed to just trusting that if the folder is there it's valid. The code I have in there is 90% correct, but the BitRock reference manual differs from the actual release so I'm having a tough time finding the "new" way of doing some of these things. They used to have a 'ruleGroup' in which you could group rules together and each would have their own 'ruleEvaluationLogic' being "and" or "or" but that seems to have since been removed. Once they get back to me on that, I will have enough of the dependency checking code completed that I'll feel satisfied using that in my final submission to my mentors.

I say "satisfied" because given the circumstances I've stated before, I believe I've really accomplished a lot. Not as much as I'd have liked to, but I can only look forward now. I've acknowledged my mistakes and I have already learned from them.

With that last bit of code in place, the heart of the dependency checking will actually be complete, only lacking in the testing area. Of course testing will reveal some small bugs, but the core code and logic is complete and in place. It will give me a very good base to work from during the upcoming future after the SoC program ends.

I'll make another post tomorrow after my final submission is complete and give an update on the project. I'm not sure how the updates will work once the program ends, but I feel it logical to continue to give the community updates on the installer project. Whether that happens through this blog or some other medium, I'm not yet sure.

Take care!

No comments: