mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 19:02:32 +00:00
[SYSSETUP]
Set registry values 'PathName' and 'SystemRoot' in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion. This fixes bug #4414. svn path=/trunk/; revision=47784
This commit is contained in:
parent
3072b5dec6
commit
ca3bc68834
|
@ -855,6 +855,7 @@ InstallReactOS(HINSTANCE hInstance)
|
||||||
DWORD LastError;
|
DWORD LastError;
|
||||||
HANDLE token;
|
HANDLE token;
|
||||||
TOKEN_PRIVILEGES privs;
|
TOKEN_PRIVILEGES privs;
|
||||||
|
HKEY hKey;
|
||||||
|
|
||||||
InitializeSetupActionLog(FALSE);
|
InitializeSetupActionLog(FALSE);
|
||||||
LogItem(SYSSETUP_SEVERITY_INFORMATION, L"Installing ReactOS");
|
LogItem(SYSSETUP_SEVERITY_INFORMATION, L"Installing ReactOS");
|
||||||
|
@ -901,6 +902,29 @@ InstallReactOS(HINSTANCE hInstance)
|
||||||
|
|
||||||
if (GetWindowsDirectory(szBuffer, sizeof(szBuffer) / sizeof(TCHAR)))
|
if (GetWindowsDirectory(szBuffer, sizeof(szBuffer) / sizeof(TCHAR)))
|
||||||
{
|
{
|
||||||
|
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
|
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
|
||||||
|
0,
|
||||||
|
KEY_WRITE,
|
||||||
|
&hKey) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
RegSetValueExW(hKey,
|
||||||
|
L"PathName",
|
||||||
|
0,
|
||||||
|
REG_SZ,
|
||||||
|
(LPBYTE)szBuffer,
|
||||||
|
(wcslen(szBuffer) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
RegSetValueExW(hKey,
|
||||||
|
L"SystemRoot",
|
||||||
|
0,
|
||||||
|
REG_SZ,
|
||||||
|
(LPBYTE)szBuffer,
|
||||||
|
(wcslen(szBuffer) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
}
|
||||||
|
|
||||||
PathAddBackslash(szBuffer);
|
PathAddBackslash(szBuffer);
|
||||||
_tcscat(szBuffer, _T("system"));
|
_tcscat(szBuffer, _T("system"));
|
||||||
CreateDirectory(szBuffer, NULL);
|
CreateDirectory(szBuffer, NULL);
|
||||||
|
|
Loading…
Reference in a new issue