Have vmwinst add back the registry entries which were so brutally
removed.
This doesn't fix the problem completely though, blocked by the problem
described here:
http://reactos.com:8080/archives/public/ros-dev/2005-August/004558.html
Modified: trunk/reactos/subsys/system/vmwinst/En.rc
Added: trunk/reactos/subsys/system/vmwinst/vmware.inf
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.c
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.h
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.rc
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.xml
_____
Modified: trunk/reactos/subsys/system/vmwinst/En.rc
--- trunk/reactos/subsys/system/vmwinst/En.rc 2005-08-14 20:22:37 UTC
(rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/En.rc 2005-08-14 21:44:58 UTC
(rev 17389)
@@ -95,6 +95,7 @@
IDS_FAILEDTOSELVGADRIVER "Failed to activate the ReactOS VGA driver!"
IDS_FAILEDTOSELVBEDRIVER "Failed to activate the ReactOS VBE driver!"
IDS_UNINSTNOTICE "The VMware(r) SVGA driver files have not yet been
deleted.\nPlease delete them manually after a system reboot."
+ IDS_FAILEDTOADDREGENTRIES "Failed to create registry entries for the
VMware(r) SVGA driver!"
END
STRINGTABLE
_____
Added: trunk/reactos/subsys/system/vmwinst/vmware.inf
--- trunk/reactos/subsys/system/vmwinst/vmware.inf 2005-08-14
20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmware.inf 2005-08-14
21:44:58 UTC (rev 17389)
@@ -0,0 +1,32 @@
+[version]
+signature="$CHICAGO$"
+
+[DefaultInstall]
+AddReg=VMXReg
+
+[VMXReg]
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","ErrorControl",0x0001
0001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Group",0x00000000,"V
ideo"
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","ImagePath",0x0002000
0,"system32\drivers\vmx_svga.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Start",0x00010001,0x
00000004
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Type",0x00010001,0x0
0000001
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","InstalledDis
playDrivers",0x00010000,"vmx_fb"
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.0
",0x00000001,36,34,30,78,34,38,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.1
",0x00000001,38,30,30,78,36,30,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.2
",0x00000001,31,30,32,34,78,37,36,38,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.3
",0x00000001,31,31,35,32,78,38,36,34,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.4
",0x00000001,31,32,38,30,78,39,36,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.5
",0x00000001,31,32,38,30,78,31,30,32,34,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.6
",0x00000001,31,34,30,30,78,31,30,35,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.7
",0x00000001,31,36,30,30,78,31,32,30,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.8
",0x00000001,31,37,39,32,78,31,33,34,34,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.9
",0x00000001,31,38,35,36,78,31,33,39,32,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.1
0",0x00000001,31,39,32,30,78,31,34,34,30,00
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.Flags",0x00010001,0
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.VRefresh",0x00010001,85
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.XPanning",0x00010001,0
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.YPanning",0x00010001,0
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.BitsPerPel",0x00010001,16
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.XResolution",0x00010001,800
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","De
faultSettings.YResolution",0x00010001,600
+HKLM,"SYSTEM\CurrentControlSet\Enum\PCI\VEN_15AD&DEV_0405&SUBSYS_040515
AD&REV_00\0000","Service",0x00000000,"vmx_svga"
Property changes on: trunk/reactos/subsys/system/vmwinst/vmware.inf
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ CRLF
_____
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.c
--- trunk/reactos/subsys/system/vmwinst/vmwinst.c 2005-08-14
20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmwinst.c 2005-08-14
21:44:58 UTC (rev 17389)
@@ -32,6 +32,10 @@
#include <string.h>
#include "vmwinst.h"
+extern VOID CALLBACK InstallHinfSectionW(HWND hwnd, HINSTANCE
ModuleHandle,
+ PCWSTR CmdLineBuffer, INT
nCmdShow);
+
+
HINSTANCE hAppInstance;
BOOL StartVMwConfigWizard, DriverFilesFound, ActivateVBE = FALSE,
UninstallDriver = FALSE;
@@ -382,6 +386,79 @@
return TRUE;
}
+/* Make sure the required registry entries are present */
+BOOL
+AddVmwareRegistryEntries()
+{
+ HRSRC VmwareInfResource;
+ HGLOBAL VmwareInfMem;
+ PVOID VmwareInfLocked;
+ DWORD Size;
+ WCHAR TempPath[MAX_PATH];
+ WCHAR BufferSize;
+ WCHAR TempFileName[MAX_PATH];
+ HANDLE TempFile;
+ DWORD Written;
+ WCHAR CmdLine[19 + MAX_PATH];
+
+ VmwareInfResource = FindResourceW(hAppInstance,
+ MAKEINTRESOURCE(IDR_VMWARE_INF),
+ L"RT_INF");
+ if (NULL == VmwareInfResource)
+ {
+ return FALSE;
+ }
+ Size = SizeofResource(hAppInstance, VmwareInfResource);
+ if (0 == Size)
+ {
+ return FALSE;
+ }
+ VmwareInfMem = LoadResource(hAppInstance, VmwareInfResource);
+ if (NULL == VmwareInfMem)
+ {
+ return FALSE;
+ }
+ VmwareInfLocked = LockResource(VmwareInfMem);
+ if (NULL == VmwareInfLocked)
+ {
+ return FALSE;
+ }
+
+ BufferSize = GetTempPathW(sizeof(TempPath) / sizeof(TempPath[0]),
TempPath);
+ if (0 == BufferSize || sizeof(TempPath) / sizeof(TempPath[0]) <
BufferSize)
+ {
+ return FALSE;
+ }
+ if (0 == GetTempFileNameW(TempPath, L"vmx", 0, TempFileName))
+ {
+ return FALSE;
+ }
+
+ TempFile = CreateFileW(TempFileName, GENERIC_WRITE, 0, NULL,
OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == TempFile)
+ {
+ DeleteFile(TempFileName);
+ return FALSE;
+ }
+ if (! WriteFile(TempFile, VmwareInfLocked, Size, &Written, NULL) ||
+ Written != Size)
+ {
+ CloseHandle(TempFile);
+ DeleteFile(TempFileName);
+ return FALSE;
+ }
+ CloseHandle(TempFile);
+
+ wcscpy(CmdLine, L"DefaultInstall 128 ");
+ wcscat(CmdLine, TempFileName);
+ InstallHinfSectionW(NULL, NULL, CmdLine, 0);
+
+ DeleteFile(TempFileName);
+
+ return TRUE;
+}
+
/* GUI */
void
@@ -426,8 +503,16 @@
{
if(DriverFilesFound)
{
- if(!EnableVmwareDriver(FALSE, FALSE, TRUE))
+ if(!AddVmwareRegistryEntries())
{
+ WCHAR Msg[1024];
+ LoadString(hAppInstance, IDS_FAILEDTOADDREGENTRIES, Msg,
sizeof(Msg) / sizeof(WCHAR));
+ MessageBox(GetParent(hwndDlg), Msg, NULL,
MB_ICONWARNING);
+ SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE);
+ return TRUE;
+ }
+ if(!EnableVmwareDriver(TRUE, TRUE, TRUE))
+ {
WCHAR Msg[1024];
LoadString(hAppInstance, IDS_FAILEDTOACTIVATEDRIVER, Msg,
sizeof(Msg) / sizeof(WCHAR));
@@ -548,7 +633,7 @@
if(AbortInstall != 0) goto done;
PostMessage(hInstallationNotifyWnd, WM_INSTSTATUSUPDATE,
IDS_ENABLINGDRIVER, 0);
- if(!EnableVmwareDriver(FALSE, FALSE, TRUE))
+ if(!EnableVmwareDriver(TRUE, TRUE, TRUE))
{
PostMessage(hInstallationNotifyWnd, WM_INSTABORT,
IDS_FAILEDTOACTIVATEDRIVER, 0);
goto cleanup;
@@ -935,7 +1020,7 @@
}
ActivateVBE = (SendDlgItemMessage(hwndDlg, IDC_VBE,
BM_GETCHECK, 0, 0) == BST_CHECKED);
if(!EnableVmwareDriver(ActivateVBE,
- !ActivateVBE,
+ TRUE,
FALSE))
{
WCHAR Msg[1024];
@@ -984,7 +1069,7 @@
if(UninstallDriver)
{
if(!EnableVmwareDriver(ActivateVBE,
- !ActivateVBE,
+ TRUE,
FALSE))
{
WCHAR Msg[1024];
_____
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.h
--- trunk/reactos/subsys/system/vmwinst/vmwinst.h 2005-08-14
20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmwinst.h 2005-08-14
21:44:58 UTC (rev 17389)
@@ -26,6 +26,7 @@
#define IDS_FAILEDTOSELVGADRIVER 104
#define IDS_FAILEDTOSELVBEDRIVER 105
#define IDS_UNINSTNOTICE 106
+#define IDS_FAILEDTOADDREGENTRIES 107
#define IDS_SEARCHINGFORCDROM 201
#define IDS_COPYINGFILES 202
@@ -67,4 +68,6 @@
#define IDD_DOUNINSTALLTITLE 361
#define IDD_DOUNINSTALLSUBTITLE 362
+#define IDR_VMWARE_INF 400
+
#endif /* __VMWINST_H */
_____
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.rc
--- trunk/reactos/subsys/system/vmwinst/vmwinst.rc 2005-08-14
20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmwinst.rc 2005-08-14
21:44:58 UTC (rev 17389)
@@ -16,7 +16,10 @@
IDB_WATERMARK BITMAP "resources/watermark.bmp"
IDB_HEADER BITMAP "resources/header.bmp"
+/* The vmware.inf file */
+IDR_VMWARE_INF RT_INF "vmware.inf"
+
/*
* Everything specific to any language goes in one of the specific
* files. Note that you can and may override resources which also have
_____
Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.xml
--- trunk/reactos/subsys/system/vmwinst/vmwinst.xml 2005-08-14
20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmwinst.xml 2005-08-14
21:44:58 UTC (rev 17389)
@@ -8,6 +8,7 @@
<library>advapi32</library>
<library>comctl32</library>
<library>comdlg32</library>
+ <library>setupapi</library>
<library>shell32</library>
<file>vmwinst.c</file>
<file>vmwinst.rc</file>