You've exposed some softness in my thinking in this patch. Like I mentioned in the comments for it, _SHExpandEnvironmentVariables exists because the environment isn't actually set up during wine install time. I didn't think to look up the values in the registry.
I also didn't register some of the "environment" variables that I use, and probably should have.
You might rewrite it just to look at the registry. You probably want to look in HKLM\System\Current Control Set\Session Manager\Environment if the value you're looking for isn't in HKCU, and some variables should probably not be overridable in HKCU either (SystemRoot, for example).
--Juan
__________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com
Juan Lang juan_lang@yahoo.com writes:
You've exposed some softness in my thinking in this patch. Like I mentioned in the comments for it, _SHExpandEnvironmentVariables exists because the environment isn't actually set up during wine install time. I didn't think to look up the values in the registry.
The proper fix is to ensure that the environment is set up properly; shell32 shouldn't have to duplicate the environment registry support.
--- Alexandre Julliard julliard@winehq.org wrote:
The proper fix is to ensure that the environment is set up properly; shell32 shouldn't have to duplicate the environment registry support.
Yes, but it's a chicken-and-egg problem. The registry for the environment has been set up right, but the environment variables themselves have not yet been set when shell32 is being registered. shell32 and the environment are registered at roughly the same time, and shell32 uses the registry at registration time to create the default profile directories.
Are you suggesting setupapi special case registry value setting so that if it recognizes the key as affecting the environment, it should set the variable on the spot? Or do you have another suggestion?
--Juan
__________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com
Juan Lang juan_lang@yahoo.com writes:
Are you suggesting setupapi special case registry value setting so that if it recognizes the key as affecting the environment, it should set the variable on the spot? Or do you have another suggestion?
No, setupapi should respect the environment variables if they are already set (which I believe it does, at least for USERPROFILE). Then the user who wants different directories should define the proper variables before running wineprefixcreate.
Le Mardi 02 Novembre 2004 21:03, Juan Lang a écrit :
--- Alexandre Julliard julliard@winehq.org wrote:
The proper fix is to ensure that the environment is set up properly; shell32 shouldn't have to duplicate the environment registry support.
Yes, but it's a chicken-and-egg problem. The registry for the environment has been set up right, but the environment variables themselves have not yet been set when shell32 is being registered. shell32 and the environment are registered at roughly the same time, and shell32 uses the registry at registration time to create the default profile directories.
Are you suggesting setupapi special case registry value setting so that if it recognizes the key as affecting the environment, it should set the variable on the spot? Or do you have another suggestion?
--Juan
Excuse me to reactivate this debate, but I had'nt understood all your thoughts. Has there been a consensus on this spot ? Should I resend the patch, change it or get rid of it ?
Regards,
Fabrice Ménard menard.fabrice@wanadoo.fr
--- Fabrice M�nard menard.fabrice@wanadoo.fr wrote:
Excuse me to reactivate this debate, but I had'nt understood all your thoughts. Has there been a consensus on this spot ? Should I resend the patch, change it or get rid of it ?
No need to apologize. Alexandre's most recent suggestion is the correct one, IMO:
No, setupapi should respect the environment variables if they are already set (which I believe it does, at least for USERPROFILE). Then the user who wants different directories should define the proper variables before running wineprefixcreate.
The impact would be, shellpath.c should just call ExpandEnvironmentVariablesW, and only if this doesn't expand all the environment variables should it try to do so itself. (I'm guessing %USERPROFILE% will be set if it's overridden in the config file? I don't know.)
Btw, your patch abuses the use of an HRESULT. It uses it as a BOOL. Please either use HRESULTs, or change the prototype to return BOOL.
--Juan
__________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com