Making Wine work with COM Ports - An adventure with the Gallagher HR3 Reader, MyScale Pro, and CrossOver on a Mac

Unfortunately, companies such as Gallagher, Ruddweigh, and others that make NLIS (National Livestock Identification Scheme) tag management software are yet to enter the current era of modern computing. Their software is old, poorly written with strange UIs, and Windows-only.

This guide is how to make this software work on a Mac (or Linux) using CrossOver - Codeweaver's Wine distribution. This process should work on normal wine, but it's probably worth just paying the ~$50USD and saving a whole lot of hassle setting it up.

Solution:

Install the Required Software:

  1. Download and install Wine - CrossOver is assumed, but normal Wine should work as well.
  2. Create a Wine Bottle, installing .NET 3.5 into the bottle using the CrossOver tool or equivalent for vanilla Wine.
  3. Install MyScale Pro - https://am.gallagher.com/au/support/software-downloads

Install Drivers for the USB-to-Serial Converter:

The USB-to-Serial converter that was distributed with the HR3 reader that was used in this guide was a PL2303, which is a very common reader. If you don't have one of these (you can check by opening system information and seeing if the following is present):

(Source: http://plugable.com/2011/07/12/installing-a-usb-serial-adapter-on-mac-os-x/)

If you do have one of these, the driver is available here: http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41. If you don't have one of these, I suggest Googling for the manufacturer and even USB code shown in the above image.

Configure Wine for the USB-to-Serial Converter:

  1. Install appropriate driver, rebooting if the poorly written installer doesn't hotplug the module.
  2. Open up Terminal and symlink the COM port into place for wine to find (replacing [bottle-name] with the name of the bottle that you created):
    $ cd ~/Library/Application\ Support/CrossOver/Bottles/[bottle-name]/dosdevices
    $ ln -s /dev/tty.usbserial com1
    

    NB: If /dev/tty.usbserial doesn't exist, you should follow the guide here to find the correct device name.

  3. Edit ~/Library/Application\ Support/CrossOver/Bottles/[bottle-name]/system.reg, adding the following lines to the end:
    [Hardware\\Devicemap\\Serialcomm] 1231984861
    "Serial0"="COM1"
    

Additional Steps to Try If the Above Doesn't Work

(Source: Credit for figuring out these steps goes to Doug Brown from http://www.downtowndougbrown.com/2013/03/getting-x-ctu-in-wine-to-detect-your-serial-ports/. Many thanks!)

Some software tools try to automatically enumerate COM ports. If they don't find the COM ports after you've done the above steps, you may wish to try the below. In my case, these steps were required. You will need to run RegEdit (wine regedit or use "Run Command" from CrossOver)

Steps:

  1. Browse to the following section (that we will add subkeys to):
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum
  2. Create a subkey of Enum called SERIAL.
  3. Create a subkey of SERIAL called COM1.
  4. Create another subkey called COM1 (so you have subkeys like Enum->Serial->COM1->COM1)
  5. Add the following two string values to this final subkey:
    1. Name: ClassGUID Value: {4D36E978-E325-11CE-BFC1-08002BE10318}
    2. Name: FriendlyName Value: Serial Port (COM1)

NB: Note that the FriendlyName is really important. It must have the COM1 in parentheses after the nice name.

Good luck! Hopefully COM ports will eventually become a supported feature by CrossOver, or one day the mess of NLIS software (not to mention the website) will be modernised (and made cross-platform).