Commit in reactos/subsys/system/vmwinst on MAIN
vmwinst.c+35-61.1 -> 1.2
don't copy files if already present

reactos/subsys/system/vmwinst
vmwinst.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- vmwinst.c	9 Apr 2004 18:27:11 -0000	1.1
+++ vmwinst.c	12 Apr 2004 16:09:45 -0000	1.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: vmwinst.c,v 1.1 2004/04/09 18:27:11 weiden Exp $
+/* $Id: vmwinst.c,v 1.2 2004/04/12 16:09:45 weiden Exp $
  *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS VMware(r) driver installation utility
@@ -30,7 +30,7 @@
 #include "vmwinst.h"
 
 HINSTANCE hAppInstance;
-BOOL StartVMwConfigWizard, ActivateVBE = FALSE, UninstallDriver = FALSE;
+BOOL StartVMwConfigWizard, DriverFilesFound, ActivateVBE = FALSE, UninstallDriver = FALSE;
 
 static WCHAR DestinationDriversPath[MAX_PATH+1];
 static WCHAR CDDrive = L'\0';
@@ -376,8 +376,27 @@
       switch(pnmh->code)
       {
         case PSN_SETACTIVE:
+        {
           PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT);
           break;
+        }
+        case PSN_WIZNEXT:
+        {
+          if(DriverFilesFound)
+          {
+            if(!EnableVmwareDriver(FALSE, FALSE, TRUE))
+            {
+              WCHAR Msg[1024];
+              LoadString(hAppInstance, IDS_FAILEDTOACTIVATEDRIVER, Msg, sizeof(Msg) / sizeof(WCHAR));
+              MessageBox(GetParent(hwndDlg), Msg, NULL, MB_ICONWARNING);
+              SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE);
+              return TRUE;
+            }
+            SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CONFIG);
+            return TRUE;
+          }
+          break;
+        }
       }
       break;
     }
@@ -417,9 +436,6 @@
             return TRUE;
           }
           
-          DestinationDriversPath[0] = L'\0';
-          wcscat(DestinationDriversPath, DestinationPath);
-          wcscat(DestinationDriversPath, L"drivers\\");
           if(!InstallFile(DestinationPath, vmx_fb) ||
              !InstallFile(DestinationPath, vmx_mode) ||
              !InstallFile(DestinationDriversPath, vmx_svga))
@@ -554,6 +570,11 @@
             SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
             return TRUE;
           }
+          if(DriverFilesFound)
+          {
+            SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE);
+            return TRUE;
+          }
           break;
         }
         case PSN_WIZFINISH:
@@ -833,9 +854,17 @@
   {
     wcscat(DestinationPath, L"\\");
   }
+  DestinationDriversPath[0] = L'\0';
+  wcscat(DestinationDriversPath, DestinationPath);
+  wcscat(DestinationDriversPath, L"drivers\\");
+  
   SetCurrentDirectory(DestinationPath);
   
-  StartVMwConfigWizard = IsVmwSVGAEnabled();
+  DriverFilesFound = FileExists(DestinationPath, vmx_fb) &&
+                     FileExists(DestinationPath, vmx_mode) &&
+                     FileExists(DestinationDriversPath, vmx_svga);
+  
+  StartVMwConfigWizard = DriverFilesFound && IsVmwSVGAEnabled();
   
   /* Show the wizard */
   CreateWizard();
CVSspam 0.2.8