As the late, great Agatha Christie wrote:
I don’t think necessity is the mother of invention — invention, in my opinion, arises directly from idleness, possibly also from laziness. To save oneself trouble.
As I was working on my MacBook Pro, adjacent to a less attractive (and currently off) PC, I decided to run z-Tree. As purveyors of fine (or bland) economic experiments will know, z-Tree is currently Windows only. As I am too lazy and disinterested in my PC to fire it up and run z-Tree on it, I decided to get it running on my Mac and share with you how easy it actually is.
We will be installing Xcode, Command Line Tools, MacPorts, and Wine. So, if you have any of these installed feel free to skip the relevant sections. This tutorial assumes you have a copy of ztree.exe and zleaf.exe. If you do not have these files, you will need to request them via snail-mail using the license contract here or find a friend with a copy.
Download and install Xcode from the App Store [EDIT: If you are on OS X 10.6, follow the instructions for Snow Leopard here]
Click “Install” to install the Command Line Tools
Command+,
Using MacPorts makes it a snap to download and install open-source software on OS X.
Wine allows you to run Windows applications within OS X (and Linux) without requiring a copy of Microsoft Window.
Command+Space
, type ”terminal
”, then press Return
/Enter
,terminal
”, then press Return
/Enter
sudo port install wine-devel
Open a terminal, navigate to the folder containing “z-tree.exe” (i.e., use) and enter the following command:
wine ztree.exe
This will launch the z-Tree program.
automator
”, then press Return
/Enter
)shell
” where your cursor is (in the search field that says)./opt/local/bin/wine /path/to/ztree/ztree.exe
Be sure to change “/path/to/ztree/” with the actual path to your copy of “ztree.exe”.zTree can now be launched just as you would any other application.
Command+C
to copy the icon.and press Command+V
to paste the icon.
Congratulations! Now you have zTree running in Mac and it looks native!
To run a zleaf for testing purposes enter the following command into a terminal while in the directory containing zleaf.exe:
wine zleaf.exe /name test1
where ”test1
” is the name you assign to the zleaf. You can then create another zleaf by changing
”test1
” to ”test2
” in order to test a 2-subject experiment.
automator
”, then press Return
/Enter
)ask
” where your cursor is (in the search field that says).Type a name for this zleaf.
”shell
” where your cursor is (in the search field that says).cat
” with/opt/local/bin/wine /path/to/ztree/zleaf.exe "$@"
Be sure to change ”/path/to/ztree/
” with the actual path to your copy of “zleaf.exe”.
Your Automator should look like this.For an application that launches multiple zLeafs at once, replace the above shell command (the section that used to say) with the following:
for i in $(seq 1 $@) do /opt/local/bin/wine /path/to/ztree/zleaf.exe /name "Player $i" & done
Again, remember to replace ”/path/to/ztree/
” with the actual path to your copy of “zleaf.exe”. You should also
change the prompt in the
“Ask for Text” section to something like ”How many zLeafs would you like to run?
”. I also changed the
“Default Answer” to ”1
”. Save this application as “zLeafs”.
To change the icons follow the instructions above and use the following icons:
I hope my efforts will help some of you. Please let me know if you have any questions or problems related to this tutorial in the comments section below.
Quick Links
Legal Stuff
Social Media