- 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 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!