This patch fixes an installer that has "[%PUBLIC]\Documents" entry for some of the targets being copied from a cabinet file. Under Windows %PUBLIC% environment variable is set to C:\Users\Public.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/kernel32/process.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 4e6ba1118e..280f406627 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -520,6 +520,7 @@ static void set_additional_environment(void) static const WCHAR computernameW[] = {'C','O','M','P','U','T','E','R','N','A','M','E',0}; static const WCHAR allusersW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0}; static const WCHAR programdataW[] = {'P','r','o','g','r','a','m','D','a','t','a',0}; + static const WCHAR publicW[] = {'P','U','B','L','I','C',0}; OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; WCHAR *profile_dir = NULL, *all_users_dir = NULL, *program_data_dir = NULL; @@ -560,6 +561,7 @@ static void set_additional_environment(void) if (p > value && p[-1] != '\') *p++ = '\'; strcpyW( p, all_users_dir ); SetEnvironmentVariableW( allusersW, value ); + SetEnvironmentVariableW( publicW, value ); HeapFree( GetProcessHeap(), 0, value ); }
Hi Dmitry,
On windows, these are set to different values.
ALLUSERSPROFILE=C:\ProgramData
PUBLIC=C:\Users\Public
Why have you made them the same?
Regards
Alistair.
On 31/07/18 20:57, Dmitry Timoshkov wrote:
This patch fixes an installer that has "[%PUBLIC]\Documents" entry for some of the targets being copied from a cabinet file. Under Windows %PUBLIC% environment variable is set to C:\Users\Public.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/kernel32/process.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 4e6ba1118e..280f406627 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -520,6 +520,7 @@ static void set_additional_environment(void) static const WCHAR computernameW[] = {'C','O','M','P','U','T','E','R','N','A','M','E',0}; static const WCHAR allusersW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0}; static const WCHAR programdataW[] = {'P','r','o','g','r','a','m','D','a','t','a',0};
- static const WCHAR publicW[] = {'P','U','B','L','I','C',0}; OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; WCHAR *profile_dir = NULL, *all_users_dir = NULL, *program_data_dir = NULL;
@@ -560,6 +561,7 @@ static void set_additional_environment(void) if (p > value && p[-1] != '\') *p++ = '\'; strcpyW( p, all_users_dir ); SetEnvironmentVariableW( allusersW, value );
}SetEnvironmentVariableW( publicW, value ); HeapFree( GetProcessHeap(), 0, value );
Alistair Leslie-Hughes leslie_alistair@hotmail.com wrote:
This patch fixes an installer that has "[%PUBLIC]\Documents" entry for some of the targets being copied from a cabinet file. Under Windows %PUBLIC% environment variable is set to C:\Users\Public.
On windows, these are set to different values.
ALLUSERSPROFILE=C:\ProgramData
PUBLIC=C:\Users\Public
Why have you made them the same?
Yes, I'm aware of that difference. However since Wine already has the code path to set ALLUSERSPROFILE=C:\Users\Public I decided to reuse it path to set PUBLIC=C:\Users\Public. Changing ALLUSERSPROFILE to point to another place is not the subject of my patch.
Hi Dmitry,
On 01/08/18 13:12, Dmitry Timoshkov wrote:
Yes, I'm aware of that difference. However since Wine already has the code path to set ALLUSERSPROFILE=C:\Users\Public I decided to reuse it path to set PUBLIC=C:\Users\Public. Changing ALLUSERSPROFILE to point to another place is not the subject of my patch.
Thanks. In other words, a bug with ALLUSERSPROFILE ;)
Alistair.
Dmitry Timoshkov dmitry@baikal.ru writes:
Alistair Leslie-Hughes leslie_alistair@hotmail.com wrote:
This patch fixes an installer that has "[%PUBLIC]\Documents" entry for some of the targets being copied from a cabinet file. Under Windows %PUBLIC% environment variable is set to C:\Users\Public.
On windows, these are set to different values.
ALLUSERSPROFILE=C:\ProgramData
PUBLIC=C:\Users\Public
Why have you made them the same?
Yes, I'm aware of that difference. However since Wine already has the code path to set ALLUSERSPROFILE=C:\Users\Public I decided to reuse it path to set PUBLIC=C:\Users\Public. Changing ALLUSERSPROFILE to point to another place is not the subject of my patch.
It would be more correct to retrieve it from the "Public" registry key, then the paths can be updated independently of each other.
Alexandre Julliard julliard@winehq.org wrote:
It would be more correct to retrieve it from the "Public" registry key, then the paths can be updated independently of each other.
Thanks for the suggestion, that's actually matches what Windows have in the registry. I sent another patch that uses this approach.
However, setting "Public" in the ProfileList registry key seems problematic. Currently ProfileList is populated with keys by shell32 for known folder ids, but unfortunately there is no an official folder id for C:\Users\Public. How would you suggest that should be handled?
Dmitry Timoshkov dmitry@baikal.ru writes:
Alexandre Julliard julliard@winehq.org wrote:
It would be more correct to retrieve it from the "Public" registry key, then the paths can be updated independently of each other.
Thanks for the suggestion, that's actually matches what Windows have in the registry. I sent another patch that uses this approach.
However, setting "Public" in the ProfileList registry key seems problematic. Currently ProfileList is populated with keys by shell32 for known folder ids, but unfortunately there is no an official folder id for C:\Users\Public. How would you suggest that should be handled?
There's no CSIDL constant, but there's FOLDERID_Public, which is more or less supported already. It shouldn't be hard to add the missing pieces.