Author: rharabien
Date: Sun Mar 27 21:51:41 2011
New Revision: 51176
URL:
http://svn.reactos.org/svn/reactos?rev=51176&view=rev
Log:
[SYSSETUP]
Set HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate to install date.
Patch by Edijs Kolesnikovics <terminedijs at yahoo dot com> slightly modified by me
See issue #6044 for more details.
Modified:
trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Sun Mar 27 21:51:41 2011
@@ -1916,11 +1916,30 @@
static VOID
-SetupIsActive( DWORD dw )
+SetInstallationCompleted(VOID)
{
HKEY hKey = 0;
- if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SYSTEM\\Setup", 0, KEY_WRITE,
&hKey ) == ERROR_SUCCESS) {
- RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (CONST BYTE
*)&dw, sizeof(dw) );
+ DWORD InProgress = 0;
+ DWORD InstallDate;
+
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE,
+ L"SYSTEM\\Setup",
+ 0,
+ KEY_WRITE,
+ &hKey ) == ERROR_SUCCESS)
+ {
+ RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD,
(LPBYTE)&InProgress, sizeof(InProgress) );
+ RegCloseKey( hKey );
+ }
+
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE,
+ L"Software\\Microsoft\\Windows NT\\CurrentVersion",
+ 0,
+ KEY_WRITE,
+ &hKey ) == ERROR_SUCCESS)
+ {
+ InstallDate = (DWORD)time(NULL);
+ RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD,
(LPBYTE)&InstallDate, sizeof(InstallDate) );
RegCloseKey( hKey );
}
}
@@ -1951,7 +1970,7 @@
if (SetupData->UnattendSetup)
{
KillTimer(hwndDlg, 1);
- SetupIsActive(0);
+ SetInstallationCompleted();
PostQuitMessage(0);
}
}
@@ -1959,7 +1978,7 @@
case WM_DESTROY:
{
- SetupIsActive(0);
+ SetInstallationCompleted();
PostQuitMessage(0);
return TRUE;
}