[bt-devel] Windows SVN Build
Matthew Talbert
ransom1982 at gmail.com
Tue Apr 7 07:59:30 MST 2009
> Curiously... should these things be set with compile-time options that
> are #ifdef'd for Windows/Mac/Linux or can I just use an installer
> system, like NSIS, to write a sword.conf to the installation
> directory? It seems that would be the most straightforward option --
> but I don't know if I could use something like %APPDATA%/ in a
> sword.conf to pick up that user's specific directory. I suppose I'll
> just have to get off my duff and start working with NSIS. Does anyone
> else have a preference for how this is done?
You can't (currently) use %APPDATA% in sword.conf. We don't even use a
sword.conf file, but use some #ifdef'd code to handle this. Here is
our code for this:
/* This will not overwrite SWORD_PATH in case it has
been set by some other program or set manually. In the case that
it hasn't been set, it is set to the localized equivalent of
C:/Documents and Settings/All Users/Application Data/Sword */
const gchar * const * strings;
strings = g_get_system_data_dirs();
g_setenv("SWORD_PATH", g_strdup_printf("%s\\Sword",
strings[0]),
FALSE);
/*it is necessary to explicitly set LANG, because we depend on that
variable to set the SWORD locale */
g_setenv("LANG", g_win32_getlocale(), FALSE);
/* we need an idea of $HOME that's convenient. */
/* this gives us linux-equivalent semantics. */
g_setenv("HOME", g_getenv("APPDATA"), TRUE)
Hope this helps,
Matthew
More information about the bt-devel
mailing list