QuickBooks Hack

Recently, at the old work place, I encountered a problem on one of our accountant’s workstations. On this station, starting up QuickBooks Pro 2008 caused the Windows Installer to pop up (usually locking somewhere around “Preparing to install…”, but sometimes making it to the install screen). Going through the installation (again) did not work. Intuit has a knowledgebase article on this (http://support.quickbooks.intuit.com/support/pages/knowledgebasearticle/1005515.html) that makes three suggestions:

  • Reregister QuickBooks’s DLLs with the reboot.bat script in the QuickBooks directory
  • Repair the .NET framework versions (1.1 and 2.0, in this case) for the QuickBooks version
  • Reinstall QuickBooks

In my case, none of these worked. A blog entry, which I cannot seem to find now, suggested uninstalling QuickBooks, removing the .NET framework and reinstalling. For good measure, it also recommended using some tools available for download through MSDN to completely nuke .NET from the system. This also, did not work. What I found did work, however, was running QuickBooks as another user on the same machine. Same permissions, mind you, as the accountant, but someone else. This worked, but was a pain in the neck, as I had to keep logging the user into QuickBooks. The final solution, was to wrap this little bit of hackery in a batch script, create a shortcut to it, and replace the user’s icons (desktop & start menu) with the shortcut to the batch script–oh, and change the icon for good measure.

The batch script follows, with the username expurgiated:

runas /savecred /user:equesada\Administrator “C:\Program Files\Intuit\QuickBooks 2008\QBW32Pro.exe”
runas /savecred /user:<someuser> "C:\Program Files\Intuit\QuickBooks 2008\QBW32Pro.exe"

After trying this several times, it appears to be working fine. My assumption is that the problem lies somewhere in the registry settings for that user’s profile. It isn’t some sort of broad permissions issue, since the user was able to start the program fine before. Even now, the only problem is that it loops into the installer. Several registry scans and cleanups failed to find the problem. Why does QuickBooks have to be such a pain in the neck?


I poked fun at Ant before. I applaud the devs for trying to develop a better development tool. I also see the usefulness of a less Unix-centric build tool when writing in Java (WORA, right?). The problem, as I see it, is that their cure is ultimately worse than the disease.

It is annoying to have to deal with hard tabs in Makefiles, but can anyone really claim that handwriting XML is more pleasant? I certainly cannot. A couple of commands in vim and the Makefiles are easy enough to work with. Nothing can take the pain of XML away–not even the hierarchical editors that are becoming common.

Another virtue of the Makefile is its beautiful simplicity. We have dependencies and then we have commands that can be used to update those dependencies that are automatically generated. An Ant build file, on the other hand, requires that all of its tasks be Java classes.

This makes Ant much less useful in the generic case. I have been playing with some literate programming lately and have to tangle the source out of the original Noweb file. In a Makefile, this is easy enough. In an Ant file, I have two choices: break out the Java compiler and write an Ant task to handle Noweb files cleanly. Or I can use the exec command (at least, I think that is what it is called–it is what NAnt calls it). If I do the former, I get a lot of overhead to do something simple. If I do the latter, I have an ugly XMLified Makefile.

In the final analysis, I think Ant would have been a lot more useful if it had kept the Makefile’s cardinal simplicity and removed the ugly parts (hard tabs). To make it truly platform independent, common shell commands (copy, delete, etc.) may have needed some massaging by the Make system.

Unixing away from phpMyAdmin

Here at the ol’ job, we use MySQL (something that I have blogged about before) and, naturally, have phpMyAdmin installed. I seldom use it as I prefer a a nice, CLI interface. It does provide a few amenities that have log me in even when I don’t strictly speaking need it. Some of these are the editing feature (yes, I am lazy enough that sometimes I would rather not sit down and write out an UPDATE query), the printing (which is much nicer than out-of-the-box lp or lpr on *nix machines), and dumping stuff to CSV or Excel (which is nice for one-off reports that I¬†occasionally¬†have to run).

The last couple of days, while working on some reconciliation type reports that get a little involved, I decided to take advantage of the Unix philosophy (a tool for every job, do one thing and do it well, etc.) and make my life quicker and easier from the MySQL command line. So, here is a look at the various tweaks I’ve made.

The first thing to look at is paging. The client doesn’t do any out of the box. After jacking off with a handful of pagers (less, more, most, and w3m) I decided on w3m for reasons that will soon become fairly clear. To make mysql page, simply run the command:

pager w3m

or more, less, most, etc. Whatever command you want to be the pager. This setting can be made permanent

Next up, we have printing. This is why I chose w3m. less and most provided no way that I could see to pass the piped-in text off to a printer. If some pager coniusseur would care to correct me on this score, I am all ears.


keymap C-p SAVE_SCREEN “| a2ps -r test.txt -1 -r -f 7pts”
keymap q EXIT
keymap C-p SAVE_SCREEN "| a2ps -1 -r -f 7pts"
keymap q EXIT

The second item maps q to exit without confirmation. Out of the box, w3m always prompts. I hate being prompted. Remove at your liking. The first line maps the sequence Control + P to a SAVE_SCREEN command (which is used to dump pages to files) and then pipes it to a2ps. You can look up the options for a2ps, but the end result is that, since no output file was specified, a2ps prettifies the text handed it and sends it off to the printer.

Finally, we have that little problem of dumping to Excel. We do not have to dump straight to .xls or .xlsx format. CSV will do, despite being a poor format in general. MySQL can do this part natively by running a query like so:

select * from foo
into outfile 'someplace.csv'
fields terminated by ',' lines terminated by '\n';

This is nice, but, speaking for myself, I usually review the results before dumping them out, just to be sure it looks roughly the way I want or expect. Another good way to do this, is to simply put the query into a file and run it like this:

mysql -uuser database < query.sql

When in noninteractive mode, the mysql client outputs the records in a tab delimited format. Piping this through sed and into a text file will create a simplistic CSV or opening it in tab-delimited form with a spreadsheet app (like Excel or OpenOffice Calc) will allow it to be exported to a more friendly format.

These Guys are Heroes

If you saunter on over to Vimperator.org, you will see some heroic members of the hacker race. From their website:

“Writing efficient user interfaces is the main maxim, here at Vimperator labs. We often follow the Vim way of doing things, but extend its principles when necessary.
Towards this end, we’ve created the liberator library for Mozilla based applications, to encapsulate as many of these generic principles as possible, and liberate developers from the tedium of reinventing the wheel.”

Also deserving of honorable mention are the denizens of “suckless.org“. Their philosophy is (again, from the website):

“Our project focuses on advanced and experienced computer users. In contrast with the usual proprietary software world or many mainstream open source projects that focus more on average and non-technical end users, we think that experienced users are mostly ignored. This is particularly true for user interfaces, such as graphical environments on desktop computers, on mobile devices, and in so-called Web applications. We believe that the market of experienced users is growing continuously, with each user looking for more appropriate solutions for his/her work style.”

In both cases, it reminds me of what I wrote about usability vs. learnability, which is, undoubtedly, why I like it. There are only a few safe havens for the advanced user. Most of the world is trying to build idiot-proof systems. Some of us want power tools. We want tools with pointy edges. We want to be able to do grand things–and this inevitably means having the ability to wreck our own systems.

Despite the small groups interested in a more advanced usability, the world will by and large never accommodate us. Part of the reason is, of course, numbers. I’d rather sell an application with a potential audience of 12 million than of 1200, wouldn’t you? But that is not the whole story. Small groups can and have sufficient buying power to warrant some attention. The biggest problem is that it is an audience that can create software to its own specifications and does not need some third party to build it. Worse still, if someone were to provide software for this exclusive market, anything creative or innovative would swiftly be copied into a new project, because the audience is made up of infernal tinkerers.

So, we come back to the place that we started from. Small, dedicated groups of people dedicated to creating truly usable software.