<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 19, 2008, at 12:44 AM, Troy A. Griffitts wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">The appropriate response to where modules are officially found on any OS by the SWORD engine (should also be with JSword as well) is:</span></blockquote><div><br></div><div>Perhaps, I should have read through the full thread before responding .....</div></div><div><br></div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br><br><a href="http://crosswire.org/svn/sword/trunk/INSTALL">http://crosswire.org/svn/sword/trunk/INSTALL</a><br>under the DETAILS section.</span></blockquote><div><br></div><div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>But I think these two differences are harmless.</div><div><br></div><div>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.</div><div><br></div><div>Both MacSword and JSword will set the install location to ~/Library/Application Support/Sword.</div><div><br></div><div>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.</div><div><br></div><div>Besides this addition to SWORD's lookup, JSword looks at OS locations first.</div><div><br></div><div>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.</div><div><br></div><div>The other difference is that JSword looks for a sword.conf in each of these locations. And if found, processes it first.</div><div><br></div></div><div><br></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br><br>We should stay unified on this (and other things).<br></span></blockquote><br></div><div>I agree.</div><div><br></div><div>But I feel strongly that SWORD should stay abreast with OS standard guidelines for installation of application data. I've argued for this before.</div><div><br></div><div>There are several fundamental flaws in the lookup order of SWORD:</div><div>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.</div><div><br></div><div>The second place it looks is ../mods.d. This has the same CWD problem.</div><div><br></div><div>The third location is ../library/mods.d. I think this was added so that on Windows the library location would be:</div><div>c:\Program Files\CrossWire\library\mods.d</div><div>This is what JSword assumes. Note that '..' has the same problems as '.'.</div><div><br></div><div>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 install.</div><div><br></div><div>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.)</div><div><br></div><div>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.</div><div><br></div><div>The final location $HOME/.sword/mods.d suffers the same Mac/Windows issues, but is the standard location for UNIX.</div><div><br></div><div>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:</div><div><br></div><div>1) The lookup for an install directory should include and prioritize the OS standard locations.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>In Him,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>DM<br></div><div><br></div><div><br></div><div><br></div><div><br></div><br></body></html>