From 6d9aadecbafcd048702db67dab8c42cf6141712a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 31 Jul 2018 18:57:59 +0800 Subject: [PATCH 22/24] kernel32: Set environment variable %PUBLIC% on the process start-up. 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 --- dlls/kernel32/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 5aa245c..65b3091 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 ); } -- 1.9.1