Re: Dia (Installer?) Homedir (was : Re: 0.95-pre1 uploaded)



On 15.02.2006 00:37, Alan G Isaac wrote:
On Tue, 14 Feb 2006, Luc Cessieux apparently wrote:
1. I have XP but I had not the home in my path.


On 14.02.2006 20:29, Alan G Isaac wrote:
Often on XP %home% expands to %userprofile%, so installers that assume it expands directly to a directory fail.


On Tue, 14 Feb 2006, Hans Breuer apparently wrote:
AFAIK the installer does not mess at all with the 'home' dir (Steffen?). The code in GLib looks for both %HOME% as well as %USERPROFILE% - in that order. So did you see a concrete problem or did you just suspect one?


I suspected this might be what Luc was referring to.
(I could not tell from his post.)

Cheers,
Alan Isaac

PS Again, the problem with looking for %HOME% first is that it is often defined to be *literally* %USERPROFILE%, so that a 2nd expansion is necessary. (Odd but true.) If you look at %HOME% first, you need to check that you have been handed an actual directory. (E.g., by using os.path.isdir in Python.) See http://mail.python.org/pipermail/python-list/2005-February/263921.html

This is handled in  Glib for quite some time, at least since 2004!
http://cvs.gnome.org/viewcvs/glib/glib/gutils.c?r1=1.148&r2=1.149

      /* We check $HOME first for Win32, though it is a last resort for Unix
       * where we prefer the results of getpwuid().
       */
      g_home_dir = g_strdup (g_getenv ("HOME"));

      /* Only believe HOME if it is an absolute path and exists */
      if (g_home_dir)
        {
          if (!(g_path_is_absolute (g_home_dir) &&
                g_file_test (g_home_dir, G_FILE_TEST_IS_DIR)))
            {
              g_free (g_home_dir);
              g_home_dir = NULL;
            }
        }

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]