userenv: Set the ProgramFiles(x86) and CommonProgramFiles(x86) environment variables.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6a079faf70
commit
99dc0e0eeb
@ -104,6 +104,8 @@ static void test_create_env(void)
|
|||||||
{ "USERPROFILE" }
|
{ "USERPROFILE" }
|
||||||
};
|
};
|
||||||
static const struct profile_item common_win64_vars[] = {
|
static const struct profile_item common_win64_vars[] = {
|
||||||
|
{ "ProgramFiles(x86)" },
|
||||||
|
{ "CommonProgramFiles(x86)" },
|
||||||
{ "ProgramW6432" },
|
{ "ProgramW6432" },
|
||||||
{ "CommonProgramW6432" }
|
{ "CommonProgramW6432" }
|
||||||
};
|
};
|
||||||
|
@ -171,11 +171,20 @@ static void set_wow64_environment(WCHAR **env)
|
|||||||
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_wow64 && get_reg_value(*env, hkey, L"ProgramFilesDir (x86)", buf, sizeof(buf)))
|
if (get_reg_value(*env, hkey, L"ProgramFilesDir (x86)", buf, sizeof(buf)))
|
||||||
{
|
{
|
||||||
RtlInitUnicodeString(&nameW, L"ProgramFiles");
|
if (is_win64 || is_wow64)
|
||||||
RtlInitUnicodeString(&valueW, buf);
|
{
|
||||||
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
RtlInitUnicodeString(&nameW, L"ProgramFiles(x86)");
|
||||||
|
RtlInitUnicodeString(&valueW, buf);
|
||||||
|
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
||||||
|
}
|
||||||
|
if (is_wow64)
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(&nameW, L"ProgramFiles");
|
||||||
|
RtlInitUnicodeString(&valueW, buf);
|
||||||
|
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the CommonProgramFiles variables */
|
/* set the CommonProgramFiles variables */
|
||||||
@ -195,11 +204,20 @@ static void set_wow64_environment(WCHAR **env)
|
|||||||
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_wow64 && get_reg_value(*env, hkey, L"CommonFilesDir (x86)", buf, sizeof(buf)))
|
if (get_reg_value(*env, hkey, L"CommonFilesDir (x86)", buf, sizeof(buf)))
|
||||||
{
|
{
|
||||||
RtlInitUnicodeString(&nameW, L"CommonProgramFiles");
|
if (is_win64 || is_wow64)
|
||||||
RtlInitUnicodeString(&valueW, buf);
|
{
|
||||||
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
RtlInitUnicodeString(&nameW, L"CommonProgramFiles(x86)");
|
||||||
|
RtlInitUnicodeString(&valueW, buf);
|
||||||
|
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
||||||
|
}
|
||||||
|
if (is_wow64)
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(&nameW, L"CommonProgramFiles");
|
||||||
|
RtlInitUnicodeString(&valueW, buf);
|
||||||
|
RtlSetEnvironmentVariable(env, &nameW, &valueW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user