[sword-devel] New website - installation instructions

DM Smith dmsmith555 at yahoo.com
Fri Dec 19 07:06:30 MST 2008

On Dec 19, 2008, at 12:44 AM, Troy A. Griffitts wrote:

> The appropriate response to where modules are officially found on  
> any OS by the SWORD engine (should also be with JSword as well) is:

Perhaps, I should have read through the full thread before  
responding ....

> http://crosswire.org/svn/sword/trunk/INSTALL
> under the DETAILS section.

JSword looks in all these places, in this order and handles sword.conf  
appropriately. The first writable location is assumed by JSword to be  
the proper module installation location. This is different than SWORD,  
which takes the first location, whether writable or not.

JSword does not assume that it is the first or only SWORD app  
installed on a system. For this reason, all the other locations that  
found are added to AugmentDataPath. This too is different than SWORD.

But I think these two differences are harmless.

The bigger difference is what JSword does if it does not find a  
writable SWORD module folder. It uses a location that is appropriate  
for the OS according to the guidelines for that OS.

Both MacSword and JSword will set the install location to ~/Library/ 
Application Support/Sword.

On Windows, JSword will use $APPDATA/Sword. I'll be happy to add  
$ALLUSERSPROFILE/Sword before looking here. I think this is a good  
idea. I was unaware of $PUBLIC, so I'll have to do some reading here.

Besides this addition to SWORD's lookup, JSword looks at OS locations  

JSword also "guesses" that BibleCS is installed in the default  
location and looks for C:\Program Files\CrossWire\The SWORD Project 
\mods.d (from memory, so I may not have the path right). It looks here  
before looking at ./sword.conf.

The other difference is that JSword looks for a sword.conf in each of  
these locations. And if found, processes it first.

> We should stay unified on this (and other things).

I agree.

But I feel strongly that SWORD should stay abreast with OS standard  
guidelines for installation of application data. I've argued for this  

There are several fundamental flaws in the lookup order of SWORD:
The first place it looks is ./sword.conf. But this is relative and  
thus private to the application. I don't know about other OSes and  
programming languages, but the current working directory (CWD) means  
so many different things. On Linux, if I run the program from the  
command line after having changed my CWD all bets are off. Java has no  
notion of a CWD. On Windows, I think the CWD evaluates to the same  
directory as the executable.

The second place it looks is ./mods.d. This has the same CWD problem.

The third location is ../library/mods.d. I think this was added so  
that on Windows the library location would be:
c:\Program Files\CrossWire\library\mods.d
This is what JSword assumes. Note that '..' has the same problems as  

The fourth location $SWORD_PATH/mods.d works just fine. The BibleCS  
installer sets SWORD_PATH to be the location that the user selects for  

The fifth location is $HOME/.sword/sword.conf. While this is fine on  
Unix, this is problematic on Mac and Windows. On the Mac, using hidden  
UNIX directory and file names is just plain wrong. I think the same is  
true on Windows. The file is not hidden and a user cannot create a  
file or directory from the command line or from the Explorer that  
begins with a '.'. I have tried renaming such a directory and could  
not. (JSword used to hold its config in $HOME/.jsword. So this is more  
a comment about the problem we had with it.)

The next location /etc/sword.conf makes sense on UNIX but not on  
Windows or Mac. A Mac does not have a visible /etc. Instead it has / 
private/etc to which /etc points. From all appearances, it contains  
configuration files that are hardwired into BSD Unix programs that Mac  
OS supplies. On UNIX this is problematic in that it usually points to / 
usr/share/sword, which is probably not writable.

The final location $HOME/.sword/mods.d suffers the same Mac/Windows  
issues, but is the standard location for UNIX.

I understand that .sword will be part of the lookup whether it is  
appropriate for Windows or Mac. And that all of this lookup will  
remain. But I think a few changes need to be made:

1) The lookup for an install directory should include and prioritize  
the OS standard locations.

2) The lookup for an install directory should be for the first  
existing writable location. Failing that it uses an OS standard  
location to create a directory.

3) AugmentDataPath should include all the folders in which mods.d is  
found in all the locations for which an install directory could be  
found. In other words, I don't think the lookup for mods.d should stop  
on the first that is found, but instead should note the first writable  
location as the install location and keep going looking for all other  
readable folders as AugmentDataPath.

In Him,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20081219/23aa61e1/attachment.html>

More information about the sword-devel mailing list