set SystemSetupInProgress to 1 when 2nd stage setup is running
authorChristoph von Wittich <christoph_vw@reactos.org>
Wed, 9 Nov 2005 22:50:47 +0000 (22:50 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Wed, 9 Nov 2005 22:50:47 +0000 (22:50 +0000)
compile setup as UNICODE

svn path=/trunk/; revision=19107

reactos/subsys/system/setup/setup.c

index a68531d..2e4b4e5 100644 (file)
@@ -28,6 +28,7 @@
 #include <tchar.h>
 #include <syssetup/syssetup.h>
 #include <userenv.h>
+#include <tchar.h>
 
 #define NTOS_MODE_USER
 #include <ndk/ntndk.h>
@@ -57,6 +58,16 @@ LPTSTR lstrchr(LPCTSTR s, TCHAR c)
 }
 
 
+static VOID
+SetupIsActive( DWORD dw )
+{
+  HKEY hKey = 0;
+  if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SYSTEM\\Setup"), 0, KEY_WRITE, &hKey ) == ERROR_SUCCESS) {
+    RegSetValueEx( hKey, _T("SystemSetupInProgress"), 0, REG_DWORD, (CONST BYTE *)&dw, sizeof(dw) );
+    RegCloseKey( hKey );
+  }
+}
+
 static VOID
 RunNewSetup (HINSTANCE hInstance)
 {
@@ -75,7 +86,10 @@ RunNewSetup (HINSTANCE hInstance)
 
   DPRINT("Loaded 'syssetup'!\n");
 
+  SetupIsActive(1);
   InstallReactOS = (PINSTALL_REACTOS)GetProcAddress (hDll, "InstallReactOS");
+  SetupIsActive(0);
+
   if (InstallReactOS == NULL)
     {
       DPRINT("Failed to get address for 'InstallReactOS()'!\n");