Tuesday, September 25, 2007


Hello. Way too long since an update, let me get you up to speed...

School has been hell for this first month. Multiple schedule changes, annoying arguments with advisers/professors/secretaries, waiting around for distance courses to open up, submitting and resubmitting loan applications, etc etc etc. I've also been sick for going on a week now. The infection is beginning to go away (slowly) so by the end of the week I should be through it.

As some of you may have known, I was trying out for the BSU Bowling Team. I ended up making the team, so I'm excited about that. This doesn't really cut into my life too much, practice is only twice a week for about 3 hours, although I do bowl Friday and Saturday additionally.

The add/drop period is nearing for this term, so a lot of the annoying issues I'm dealing with will be out of the way regardless if I get them resolved or not. Hopefully then I can get back into a decent schedule of working on OpenMRS in some of my free time. I anticipate being able to get a lot of work done on some weekends when my other half goes back home to visit her family and work, so that should help me out a bit as far as scheduling is concerned.

So, I'm still here and my intentions are still the same. Expect some more iterations of the installer within the next few weeks. I look forward to getting them out there, that's for sure. Until then, take care.

Monday, September 3, 2007

Installer Progress Report

Hello, and happy Labor Day! I've been delayed in my "final post" due to a few reasons. First, I thought the deadline was Wednesday but it turned out to be Friday. Then, Friday I made my submission and worked with the guys a bit over a GoToMeeting session (very cool) to address some small issues with the installer, particularly the issues with Tomcat and environment variables. I spent the better half of the evening Friday addressing those issues, adding in the changes, and beginning to test them.

  • We now create a net user account for OpenMRS, and this is the account that Tomcat is run as. This solves the issue of the environment variable because we will now copy the properties file to "C:\Documents And Settings\openmrs\Application Data\OpenMRS" where "openmrs" is the net user account we create. The WAR file knows to look here for the properties file, so prior to a reboot it will be able to locate it here in a hard coded fashion, and then after a reboot the updates to the environment variable will be visible to Tomcat and it can resolve the location from there.
  • For now, you can no longer change the name of the webapp. This is sort of tied into the environment variable issue in that the naming convention for the properties file variable is that is should be prefixed with the webapp name. This is an issue because if the user does in fact change it to something other than "openmrs", then the WAR file can't find it.
  • Due to bullet point one, there is no "Reboot Required" dialog since we are circumventing the environment variable issue.
The one last issue I'm having with this is that the password for the net user account isn't getting stored properly and Tomcat is failing to start under the rights of our newly created net user. I didn't get a change to get as far into this as I'd have liked to due some unexpected events over this holiday weekend, but after some testing I believe it may just be an error within BitRock or my script, rather than something more annoying relating to the actual service configuration. Once I get that ironed out I can upload another iteration of this installer.

Also, I've been working with BitRock to resolve a tiny bug in the dependency checking code. I've had 3-4 correspondences with them over the past 4 days, and we are trying to figure out why the bug is occuring. It deals with the drop-down boxes for selecting the MySQL / Tomcat installations the user would like to use for OpenMRS as detected by the dependency checker. Once the user selects one and then hits next, if they were to hit the "Back" button and drop the box down again, they'd see an additional 2 empty lines in the box. That isn't really holding me up much as I'm trying to complete these new additions /changes with respect to the webapp, environment variable, and net user account in the naive installer before diving back into the smart installer.

I hope to have an update for you within a few days, so until then take care!

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!

Monday, August 20, 2007

Self Evaluation

As we near the end of the SoC program, I thought it would be helpful to conduct a self-review of myself. I think this is important because you should be your own worst critic. Anybody that is great at anything is always hard on themselves to succeed, and to continue to improve. I'm no different.

A good example would be bowling. I'll go to the "Cosmic" bowling (dark, black lights, loud music, teenagers, etc...) because it's cheap and I can get a lot of practice in. Everyone else is there to "have fun". I'll be bowling next to people that are struggling to break 60 in their games, and then you have me...cursing up and down every time I leave a 10 pin standing, on my way to shooting a 190.

On with the evaluation...

  • Dedication - OpenMRS definitely took priority over everything else this Summer, and I often found myself working on OpenMRS at all hours of the day/night, and every day of the week.
  • Focus - This was my downfall at the start. When I got started, I was overwelmed with all of the different things that had to be accounted for in the installer. I chose to start developing some code for Linux, as that is my comfort zone. I figured it would be more beneficial to me to get code working in a familiar environment and then port it to Windows rather than start off on unfamiliar grounds. This did prove beneficial, but I lost a lot of time trying to build my bridge out of steel without first laying the foundation in floss. (Hi Paul. =] )
  • Effort - I don't think I lacked in this at all. I gave this project all I had to give. This ties in to focus in that I was so concerned with everything working perfectly with the final grand scheme in mind that it hurt my progress a bit. I'd see potential problems with the temporary solutions to the point that I wouldn't even want to implement the temporary solutions. I wanted/want this installer to be as good as it can possibly be. I now know that consistent incremental progress is the only way to achieve this even if you will "waste" time with temporary solutions that get removed later. They help you understand the project better and assist your line of thought. It's not really a "waste" at all, but it may seem that way up front.
  • Follow Through - Currently, if a user has a completely bare system, my installer fits the bill (give or take a few small issues that are being resolved). By the end of this week I'll have a better idea of how far my dependency checking version has to go, but I feel it's very close to on task, I just haven't done the full round of testing on it as of yet.
There are a few areas that I would have liked to have been better...

  • I missed my release date a few times. I'm not one for excuses, so I'm not going to lay any on you here, but in software development, everything takes 5x longer than you probably initially planned for. Due to my lack of initial process due to lack of a focused plan, I had to play catch-up towards the end once I had my "floss" in place. This meant I was working on both the naive and smart installers at the same time, and addressing issues with both of them. This was a contributing factor in missing my release dates, but I felt/feel it was a necessary evil so that I could get the most production to the OpenMRS team for the money that I was paid.
  • I guess I'll say it again: The lack of focus early on hurt the overall progress of the project. This was my first experience as a paid software engineer, so it was a lesson learned; an invaluable one at that.
Overall, I grade myself at a B-.

Once the term ends, my contribution to OpenMRS won't change much. I plan to continue working on the installer. This goes back to my dedication and effort. I want to give the team the product that they need, and that I was hired to give them. If they wish to offer me some sort of employment in the future, I'd be honored and I'd of course jump at the opportunity. Regardless, my work on the installer does not end on August 31st. I like to take any project I start through the finish, and I'm really close at this point. Not to mention the fact that I've become friends with a lot of members of the community. Friendships aren't on deadlines, that stuff is forever.

Sunday, August 19, 2007

Installer Progress Report

Hello. Tonight I'm uploading a slight update to the naive installer. My mentors and I are still working on the issue with the runtime properties environment variable, and in parallel with that I've continued to make progress with merging the naive installer with the smart installer.

In my latest testing involving the environment variable issue, I've discovered the following things:

  • Despite what some websites say online, all changes to environment variables made by BitRock (whether newly created variables or changes to established variables) are immediately reflected without a reboot.
  • Tomcat does not seem to be able to access any new environment variables until after a reboot, despite Windows having refreshed them. The variables are being created/edited prior to anything else in the installer in terms of Tomcat, so that isn't the issue. Moreover, testing the existence of the environment variable in question AFTER the installation has completed and then restarting Tomcat yields the same result of failure to locate the variable.

  • Cleans up the post-install script to do away with some unnecessary variables that were being passed in. I had since changed the way those variables were used such that all work was done for them within BitRock instead of the post-install script.
  • Addressed an issue in which I was incorrectly renaming the WAR file to take on the name specified for the webapp. There was apparently some miscommunication here when this was done, but no worries it's fixed now.
  • Added a rename action within BitRock to place the WAR file into the webapps directory. We now no longer need to delete the WAR file in the post-install script
  • I've added a "Reboot Required" screen into BitRock to account for the environment variable issue with Tomcat. This is hopefully only a temporary fix as we'd like to not require a reboot.
  • Currently, you will have to reboot in order for the install to work.
  • The post-install script is still going to try and launch the web browser to the OpenMRS webapp. I left this in for testing purposes so that you can see right away if Tomcat installed properly. If you see a Tomcat error message, then Tomcat installed fine. If you get a failed connection error from your browser, Tomcat didn't get installed/started: Let me know.

That should be it, let me know how it goes for you though. There will probably be a number of updates this week as we're getting into crunch time, so stay tuned, but keep the feedback coming!


Thursday, August 16, 2007

Installer Progress Report

Hi. Been a while since my last update, I've had a hectic week. School starts up again on Monday, and I've had a lot of things to get organized as far as that is concerned in terms of class registration, loan applications, shifting money from checking/savings/credit/loans etc etc etc... Basically I hate this time of year with a passion because it's the most stressful, the most expensive, and the most busy. Anyways...

I'm going to be about a day late on my release this week due in part to the above reasons, but mainly due to the added complexity that adding dependency checking adds to the installer. I put in some good time tonight and am close to completing the puzzle.

  • Now, the post-install script checks variables passed from BitRock to determine which actions to take in terms of installing the MySQL/Tomcat services, starting/stopping those services, resetting the MySQL password, and installing the JRE silently. I can't remember exactly *why* we can't run the JRE silent install from inside of BitRock, but I do remember that we can't. If I get time, this is on my list of things to investigate.
  • I cleaned up some "/" vs "\" issues in the dependency code to make Windows happy.
  • I cleaned up a lot of logic in the dependency checking BitRock code to properly handle some of the environment variables, as well as the PATH variable.
  • As far as dialog screens are concerned, the dependency checking version matches that of the "naive" installer. I'm still holding off a bit on adding in the MySQL/Tomcat/War to cut down on build-times, but that will all come tomorrow after I sort out a few last bugs.
The other reason this release is delayed is due to a tiny bug we're having with the "naive" installer (although it would be an issue with the "smart" installer as well). The issue concerns Windows refreshing environment variables. This poses an issue when the user changes some of the default data, forcing OpenMRS to read the runtime properties files. The idea was that forcing a reboot would solve the issue, but in my efforts today, that wasn't the case. Rebooting refreshed the environment variable pointing to the runtime properties, but Tomcat still had an issue loading OpenMRS.

The guys have been out of town, so it's been a bit harder to get assistance with these issues due to our schedules, so hopefully when they get back IRC will be back in full swing and we can get this issue ironed out. In the meantime I'll continue to work on my dependency code. There are a few improvements that will probably have to wait until next week because they will involve major additions to the C++ code, but I'll have some version of the dependency checking code out within the next day or so.

Stay tuned!

Thursday, August 9, 2007

Another day, Another Installer Release

Hi folks. I had a super-productive day today during my visit to OpenMRS headquarters in Indianapolis. Below you'll find a changelog for this release and the link for the download (eventually).

  • Added Start Menu link to the OpenMRS website
  • Fixed the custom Tomcat port issue. Now, whichever port you specify will be the port used when launching the browser
  • Added support for changing the webapp name (the name that Tomcat uses to identify OpenMRS)
  • Added option to allow/disallow loading of modules through the webapp
  • Fixed the custom OpenMRS database name issue. Now, if you specify a different name for the OpenMRS database (not the default 'openmrs'), this change will actually be respected.
  • Added option to change the MySQL OpenMRS account (only used internally). Previously if you changed it, it would ignore you. Sorry.
  • Full support for the runtime properties file. Up to this point we weren't using it at all. Now, every relevant option is reflected in the runtime properties file such as MySQL username/password/port/database name, boolean module upload, etc...
  • Fixed the top-right logo that was out of proportion. Thanks Ben.
  • Tomcat is now installed as an automatic service instead of a manual service.

If you tried out my previous installer, follow these steps to obtain a "clean" system to test this one.
  • Open a command prompt - Start, Run, "cmd"
  • net stop mysql
  • sc delete mysql
  • net stop "apache tomcat"
  • sc delete "tomcat6"
That will stop both MySQL and Tomcat, as well as delete them as Windows Services. Those are the main testing points for the installer as the silent Java install never fails, so don't worry about it. It may also be a good idea to delete the previous installation directory after executing those commands. If you try to do it before hand, chances are MySQL and/or Tomcat will still be running and it will fail.

I think that's about it. A few issues to keep in mind...

  • Somtimes, for no reason at all (most likely a timing issue), Tomcat does not get installed as a service. This will cause the net start "apache tomcat" command to fail, clearly, since it hasn't been registered as a service. I'm working on this, but it's random and it I'm nearing cluelessness on this one...
  • Again, sometimes the MySQL database does not get created. I'm confident this is a timing issue because it only happens for me when I'm at home on my laggy VMware image. Today at OpenMRS HQ, the only thing that gave me trouble was the occasional failed Tomcat Service install. The MySQL worked every single time
  • Sometimes, the browser will launch prior to Tomcat finishing starting. In this case you will see an error that you can't connect. Wait a few minutes and refresh the screen. If you continue to get the unable to connect error, Tomcat probably never installed as a service and thus didn't start. If you see a Tomcat error page stating that OpenMRS could not be loaded, this means that the MySQL database wasn't created. Let me know either way and I'll help you out.
If you encounter either one of these issues, please let me know. I'll have you up and running with very little effort. If you encounter any other issues, or you have suggestions, please let me know those as well. Thanks!