+ if (!SetupFindFirstLine(hSysSetupInf,
+ _T("Infs.Always"),
+ NULL,
+ &InfContext))
+ {
+ DPRINT("No Inf.Always section found\n");
+ }
+ else
+ {
+ do
+ {
+ if (!SetupGetStringField(&InfContext,
+ 1, // Get the component name
+ NameBuffer,
+ sizeof(NameBuffer)/sizeof(NameBuffer[0]),
+ NULL))
+ {
+ DebugPrint("Error while trying to get component name \n");
+ return FALSE;
+ }
+
+ if (!SetupGetStringField(&InfContext,
+ 2, // Get the component install section
+ SectionBuffer,
+ sizeof(SectionBuffer)/sizeof(SectionBuffer[0]),
+ NULL))
+ {
+ DebugPrint("Error while trying to get component install section \n");
+ return FALSE;
+ }
+
+ DPRINT("Trying to execute install section '%S' from '%S' \n", SectionBuffer , NameBuffer);
+
+ if (!SetupInstallFromInfSection(NULL,
+ hSysSetupInf,
+ SectionBuffer,
+ SPINST_ALL,
+ NULL,
+ NULL,
+ SP_COPY_NEWER,
+ NULL,
+ NULL,
+ NULL,
+ NULL))
+ {
+ DebugPrint("Error while trying to install : %S (Error: %lu) \n", NameBuffer, GetLastError());
+ return FALSE;
+ }
+ }
+ while (SetupFindNextLine(&InfContext, &InfContext));
+ }
+
+ return TRUE;
+}