Associate SGF files with GoGUI

For Unix/Linux/Ubuntu users the official GoGUI documentation clearly explains how to achieve this:

http://gogui.sourceforge.net/doc/invocation.html

For Windows users, the above documentation does not explain a full “double-click the SGF” solution, but rather how to open GoGUI from double-clicking the *.jar library. If you are a Windows user, you probably want to be able to just double click an SGF file and have that open GoGUI with the SGF file automatically.

To achieve this, you can associate SGF files with a CMD script file like shown below (but with paths corrected to match your Java Runtime Environment/GoGUI directories). The CMD script effectively calls on Java to call on GoGUI to open the SGF file.


REM Uses CMD script to call Java Runtime+GoGUI+filename argument so that this CMD script file can be associated with SGF files.
set JAVA="C:\Program Files (x86)\Java\jre6\bin\javaw.exe"
set GOGUI_JAR="C:\Users\Ero-Sennin\Desktop\Go_Programming\gogui-1.2.3\lib\gogui.jar"
%JAVA% -jar %GOGUI_JAR% %1

To associate SGF files with a CMD script file, right-click on an SGF file, and go to “Properties”. In the pop-up, choose the “Change…” button across from “Opens With” and then choose “Browse” to locate the *.cmd file you created.

The only drawback to this method is that a CMD window will be present until you close GoGUI. If you wish to hide this, you may take it one step further by associating the SGF files with a Visual Basic Script (*.vbs) file that calls upon the CMD file silently. For more details on doing this see Hiding CMD Script windows.

For a more detailed explanation of changing file associations in general see My Digital Life.