Monday 11 March 2013

Classmaker on Linux

Recently, I spent the day recommissioning an ancient Windows 2000 box that has lain unused in the back of my office for years.  Periodically, it get's fired up for some experiment or other.  Last time it was used as the database server for ClassmakerLite, but, as none of you were using ClassmakerLite, it went back to sleep again.

This time it was supposed to be used by my children to play Minecraft, but I quickly discovered that nothing much is capable of running on Windows 2000 these days. None of the current crop of Web browsers can manage it except Qupzilla and it was painfully slow.  Earlier versions of Mozilla Firefox work, but they are also too slow.  The only browser that has any speed is Internet Explorer 5.0, but it can't render modern pages properly.  When I found the current release of Java wouldn't install... I gave up.

Thought I might give Classmaker a whirl while I had the box running.  I knew it would run quickly without any issue on Windows 2000 and it did.  But, I wondered, how might it run under Linux using Wine?  I've mused about this before, because I know that Fox-Toolkit uses emulation rather than native operating widget calls to build its GUI and Classmaker's GUI uses Fox-Toolkit exclusively, so in theory, Classmaker should be making very primitive calls into the Wine emulator - calls to routines that must have been present in Wine almost from it's beginning.

I installed Puppy Linux and then installed Wine. Puppy Linux is my favourite Linux distro.  Very easy to install and when you want to get rid of it again, which I invariably do with Linux distros, its a snap.  Took a while to understand how Wine works, but once I did, I had the client side of Classmaker running just fine.  As I already know that Isectd and FirebirdSQL work natively on Linux, although it's been many years since I've run them that way, I can now say that Classmaker as a whole can run on Linux without any code changes being necessary.  Not that I'm going to bother as I've never come across a teacher that uses Linux!  Apple Macs, yes, but I'm not interested in Macs.

The point of this post is to explain what this kind of portability across operating systems means:

1.    Your code base uses external libraries sparingly. The more external libraries your application depends on the higher the probability that the application won't port.
2.    Your code base isn't tied to a vendor specific library that is operating system specific.
3.    Your application uses common fonts and graphic formats.

So what did I have to do to get Classmaker working on Linux?

1.    Copy the following files to a directory somewhere on Linux... Classmaker.exe, isdio_dll.dll, Classmaker.ini  In my case, I just left them in C:\Classmaker\Remote since you usually install Linux on top of an existing Windows box.
2.    Edit Classmaker.ini so that it points to the remote server where Isectd and FirebirdSQL reside.  Here's what my file says:

[Readme]
This file is required so that clients know where the Isectd daemon
is located and what service they are requesting on it.

[IPConfig]
Host=robert-pc:5501
DatabaseService=aotea

3.    Open a Bash terminal and write the following line:

wine start /Unix /mnt/home/Classmaker/Remote/Classmaker.exe

Classmaker starts.

4.    The only thing that had me stumped for a while is Exporting and Importing Unit Plans.  These get written to and read from C:\Classmaker\Transfer.  Found out that Wine emulates the C: drive under /home/$USER/.wine/drive_c  Linux directories preceded by a dot are invisible directories, so I had to go into my home directory and press Ctrl H.  Immediately I could see ~/.wine/drive_c.  Once I added the directories Classmaker/Transfer below ~/.wine/drive_c importing and exporting worked fine.

No comments:

Post a Comment