Salome HOME
Extension to the case where APPLI points at a salome launcher file
[modules/kernel.git] / bin / salomeContextUtils.py.in
index 318c40c2bce17514f81f98d6612414f6678ead95..6971315d7da818150370e555a684526e0d9be525 100644 (file)
@@ -308,9 +308,9 @@ def formatScriptsAndArgs(scriptArgs=None):
 # If OMNIORB_USER_PATH is already set, only checks write access to associated directory ;
 # an exception is raised if check fails. It allows users for choosing a specific folder.
 # Else the function sets OMNIORB_USER_PATH this way:
-# - If APPLI environment variable is set, OMNIORB_USER_PATH is set to ${APPLI}/USERS.
-#   The function does not check USERS folder existence or write access. This folder
-#   must exist ; this is the case if SALOME virtual application has been created using
+# - If APPLI environment variable is set, and if ${APPLI}/USERS points at an existing 
+#   folder with write access, then OMNIORB_USER_PATH is set to ${APPLI}/USERS.
+#   This is the case if SALOME virtual application has been created using
 #   appli_gen.py script.
 # - Else OMNIORB_USER_PATH is set to user home directory.
 def setOmniOrbUserPath():
@@ -334,7 +334,9 @@ def setOmniOrbUserPath():
       #defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS")
       defaultOmniorbUserPath = homePath
       if os.getenv("APPLI"):
-        defaultOmniorbUserPath = os.path.join(homePath, os.getenv("APPLI"), "USERS")
+        appli_users_path=os.path.join(homePath, os.getenv("APPLI"), "USERS")
+        if os.access(appli_users_path, os.W_OK):
+          defaultOmniorbUserPath = appli_users_path
         pass
       os.environ["OMNIORB_USER_PATH"] = defaultOmniorbUserPath
 #