Do the normal install before custom install actions.
authorHervé Poussineau <hpoussin@reactos.org>
Mon, 29 May 2006 11:09:54 +0000 (11:09 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Mon, 29 May 2006 11:09:54 +0000 (11:09 +0000)
So, we should get the right .inf filename in SP_DRVINFO_DETAIL_DATA.InfFileName, as it is modified if the file is copied to %SYSTEMROOT%/Inf

svn path=/trunk/; revision=22104

reactos/dll/cpl/desk/classinst.c

index aec6608..eb82f8b 100644 (file)
@@ -36,7 +36,7 @@ DisplayClassInstaller(
        if (InstallFunction != DIF_INSTALLDEVICE)
                return ERROR_DI_DO_DEFAULT;
 
-       /* Set DI_NEEDRESTART flag */
+       /* Set DI_DONOTCALLCONFIGMG flag */
        InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
        result = SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams);
        if (!result)
@@ -46,7 +46,7 @@ DisplayClassInstaller(
                goto cleanup;
        }
 
-       InstallParams.Flags |= DI_NEEDRESTART;
+       InstallParams.Flags |= DI_DONOTCALLCONFIGMG;
 
        result = SetupDiSetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams);
        if (!result)
@@ -56,6 +56,15 @@ DisplayClassInstaller(
                goto cleanup;
        }
 
+       /* Do normal install */
+       result = SetupDiInstallDevice(DeviceInfoSet, DeviceInfoData);
+       if (!result)
+       {
+               rc = GetLastError();
+               DPRINT("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx\n", rc);
+               goto cleanup;
+       }
+
        /* Get .inf file name and section name */
        DriverInfoData.cbSize = sizeof(SP_DRVINFO_DATA);
        result = SetupDiGetSelectedDriver(DeviceInfoSet, DeviceInfoData, &DriverInfoData);
@@ -97,15 +106,6 @@ DisplayClassInstaller(
        }
        _tcscat(SectionName, _T(".SoftwareSettings"));
 
-       /* Do normal install */
-       result = SetupDiInstallDevice(DeviceInfoSet, DeviceInfoData);
-       if (!result)
-       {
-               rc = GetLastError();
-               DPRINT("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx\n", rc);
-               goto cleanup;
-       }
-
        /* Open driver registry key and create Settings subkey */
        hDriverKey = SetupDiOpenDevRegKey(
                DeviceInfoSet, DeviceInfoData,