except WindowsError:\r
return False\r
\r
-def getUserDefaultConfigPath():\r
- if isInstalledCopy():\r
- try:\r
- return os.path.join(shlobj.SHGetFolderPath(0, shlobj.CSIDL_APPDATA), "nvda")\r
- except WindowsError:\r
- pass\r
+\r
+def getUserDefaultConfigPath(useInstalledPathIfExists=False):\r
+ try:\r
+ installedUserConfigPath=os.path.join(shlobj.SHGetFolderPath(0, shlobj.CSIDL_APPDATA), "nvda")\r
+ except WindowsError:\r
+ installedUserConfigPath=None\r
+ if installedUserConfigPath and (isInstalledCopy() or (useInstalledPathIfExists and os.path.isdir(installedUserConfigPath))):\r
+ return installedUserConfigPath\r
return u'.\\userConfig\\'\r
\r
def getSystemConfigPath():\r
This initializes all modules such as audio, IAccessible, keyboard, mouse, and GUI. Then it initialises the wx application object and installs the core pump timer, which checks the queues and executes functions every 1 ms. Finally, it starts the wx main loop.\r
"""\r
log.debug("Core starting")\r
+ import config\r
+ if not globalVars.appArgs.configPath:\r
+ globalVars.appArgs.configPath=config.getUserDefaultConfigPath(useInstalledPathIfExists=globalVars.appArgs.launcher)\r
+ #Initialize the config path (make sure it exists)\r
+ config.initConfigPath()\r
log.info("Config dir: %s"%os.path.abspath(globalVars.appArgs.configPath))\r
log.debug("loading config")\r
import config\r
parser.add_option('-k','--check-running',action="store_true",dest='check_running',default=False,help="Report whether NVDA is running via the exit code; 0 if running, 1 if not running")\r
parser.add_option('-f','--log-file',dest='logFileName',help="The file where log messages should be written to")\r
parser.add_option('-l','--log-level',type="int",dest='logLevel',default=0,help="The lowest level of message logged (debug 10, info 20, warning 30, error 40, critical 50), default is warning") \r
-parser.add_option('-c','--config-path',dest='configPath',default=config.getUserDefaultConfigPath(),help="The path where all settings for NVDA are stored")\r
+parser.add_option('-c','--config-path',dest='configPath',default=None,help="The path where all settings for NVDA are stored")\r
parser.add_option('-m','--minimal',action="store_true",dest='minimal',default=False,help="No sounds, no interface, no start message etc")\r
parser.add_option('-s','--secure',action="store_true",dest='secure',default=False,help="Secure mode (disable Python console)")\r
parser.add_option('--no-sr-flag',action="store_false",dest='changeScreenReaderFlag',default=True,help="Don't change the global system screen reader flag")\r
if mutex: ctypes.windll.kernel32.CloseHandle(mutex)\r
sys.exit(1)\r
\r
-#Initialize the config path (make sure it exists)\r
-config.initConfigPath()\r
-\r
#os.environ['PYCHECKER']="--limit 10000 -q --changetypes"\r
#import pychecker.checker\r
#Initial logging and logging code\r