[bt-devel] Windows Module Install bug

Troy A. Griffitts scribe at crosswire.org
Tue Apr 21 11:28:32 MST 2009


OK, Greg.  Doing some testing today I found the paths you are using 
below are 'almost' right, but not quite.

Apparently the proper way to construct the user home directory and thus 
the .sword directory under that, in which modules will be augmented to 
the available library, is as follows:

    SWBuf homeDir = getenv("HOME");
    if (!homeDir.length()) {
        // silly windows
        homeDir = getenv("HOMEDRIVE");
        if (homeDir.length()) {
            homeDir += getenv("HOMEPATH");
            homeDir += "/Application Data";
        }
    }
    if (homeDir.length()) {
        if ((homeDir[homeDir.length()-1] != '\\') && 
(homeDir[homeDir.length()-1] != '/')) {
            homeDir += "/";
        }
    }

    return homeDir;

But the good news is that this code is taken from the SWBuf 
SWMgr::getHomeDir() method, which is public and usable from Bibletime.

I've tested on my system and it places modules in the correct place (on 
my system:
C:\Documents and Settings\Scribe\Application Data\.sword\mods.d
) things modules seem to get 'found'.

Hope this helps.

    -Troy.




Greg Hellings wrote:
> So here's my setup:
>
> Modules in C:\Program Files (x86)\CrossWire\The SWORD Project\
> SWORD_HOME points to the above directory.
>
> BibleTime finds those files with no problems.
> I then used the module intsaller from within BibleTime and asked it to
> install FinPR to C:\Users\Greg\.sword, which is promptly did.
> No new modules appeared in my BookShelf so I restarted BibleTime.
> Still, no new modules.
> I opened C:\Users\Greg\.sword to find what might have happened and
> found the files are there, but they're just not showing up in
> BibleTime.
>
> On a possibly related bug note - I tried moving all my modules to
> C:\Users\Greg\.sword and also to C:\Users\Greg\AppData\Sword and
> C:\Users\Greg\Sword and pointing SWORD_HOME to the directory with the
> modules.  At startup I got the standard notice that BibleTime couldn't
> find mods.d or mods.conf and that I should point SWORD_HOME to the
> directory with that file.  I moved the modules back to Program Files
> and changed SWORD_HOME back to that and the modules appeared perfectly
> again.
>
> When I opened BibleTime as Administrator and pointed it to the Program
> Files directory, it was able to install the module there with no
> problem as well as locate it after install.
>
> --Greg
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>   




More information about the bt-devel mailing list