[sword-devel] InstallMgr question
niccarter at mac.com
Tue Jul 24 00:36:31 MST 2012
Heya guys, quick InstallMgr question to do with thinking of switching PS to start using two different module locations.
I am about to switch PS to have 2 places where you can install modules to:
1) The first will be where so-called "built-in" modules are installed to, which will be to the caches location as defined by the OS. These modules won't be backed up, as they will be backed up when the app itself is backed up (they come pre-bundled in the app, so to speak) & will be re-installed as required from the app bundle. These include, for example, KJV & Strong's modules that are installed by default when the app is launched for the first time...
2) The second will be where user-downloaded modules are installed, to the app's sandboxed documents location, as defined by the OS. These will be backed up to iCloud &/or iTunes. This could include, for example, LEB & SME modules... :)
let's skip that, so just bear with me. The above is what we are going with. Yes, messy. Yes, a pain. Yes, we're just gonna go with this. :P
Let's call the first location $CACHES & the 2nd location $DOCS
So, I think I may want to create a sword.conf file to specify these two locations. It seems that it perhaps may be the correct way forward, given that support is built into the SWORD lib... But can I use one sword.conf file to point to two locations on disk of where modules are located?
Can the locations in sword.conf (DataPath in [Install]) be a relative path? Or do they need to be an absolute path? Do I need one "DataPath" and one "AugmentPath"?
Secondly, if I have one SWMgr instance pointing to my sword.conf, can I then specify in my InstallMgr instance which location to install modules to? Where will it by default install modules to? my $CACHES location or my $DOCS? and how does it choose each time? Will it always install in the "DataPath" location and never in the "AugmentPath"?
Or do I basically have to create two SWMgr instances, one for each location? That way I could then create my own wrapper around those so that I can specify which location to be installing different modules to...? Or would I create 3 SWMgr instances: one for each location & then the 3rd would be for both, using the first 2 instances for installing purposes (hence only creating them when required, when the user is installing a module) and the 3rd for general usage/reading of different modules?
Yes, I have taken a look at the src, but it wants to install modules to SWMgr->prefixPath, which seems to be the container folder of the mods.conf file? I am using the
SWMgr::SWMgr(const char *iConfigPath, bool autoload, SWFilterMgr *filterMgr, bool multiMod, bool augmentHome)
method to create my SWMgr instance & hence manually pointing to the location of our modules, as it doesn't make sense in our case to be trying to use SWMgr::findConfig()
Any pointers/comments/suggestions/remarks/corrections would be appreciated. :)
Thanks heaps, ybic
ps: sorry if that is confusing & well done if you have read through and understood it all! That probably means you're able to answer my messy questions :D
More information about the sword-devel