/// <param name="filesSectionName">Note that files listed in this section will only be copied if the device is present</param> private void InstructToLoadGroupDriver(string groupName, string filename, string deviceName, GroupDriverFormat format, string filesSectionName, int scsiDriverDestinationWinntDirectoryID, string scsiDriverDestinationFileName) { string serviceName = GetServiceName(filename); // the connection between what I call entryKey and serviceName is a little vague to me, // the HardwareIDDatabase entry specify the name of the service subkey under CurrentControlSet\Services (a.k.a. serviceName), // which *must* match the file name of the service without the .sys extension. // (text-mode setup will always initialize services using the values stored under Services\serviceName (where serviceName is the service file name without the .sys extension) // however, the entryKey which specify the initalization order of the service under [xxxx] and [xxxx.Load] and its display name // can apparently use whatever value it likes, as long as it match in both sections. // we just use the serviceName, this is how it's almost always done in txtsetup.sif (two exceptions are in the [Keyboard] section and the [Hal] sections) string entryKey = serviceName; int loadLineIndex = GetLineIndexByKey(groupName + ".Load", entryKey); string loadLine = String.Format("{0} = {1}", entryKey, filename); if (format == GroupDriverFormat.SCSI) { // [SCSI.Load] section: // Setup will not start copying files during the copy phase unless the second argument (WinntDirectoryID) is present and is a valid Winnt Directory ID. // note that setup will demand [SourceDisksFiles] entry to be present for the file, but this is a separate copy directive, and we have to make sure // that only one copy operation (followed by deletion of the source file) will be taking place loadLine += "," + scsiDriverDestinationWinntDirectoryID; if (scsiDriverDestinationFileName != String.Empty) // discovered this by trial and error { loadLine += "," + scsiDriverDestinationFileName; } } if (loadLineIndex == -1) { AppendLineToSection(groupName + ".Load", loadLine); } else { UpdateLine(loadLineIndex, loadLine); } // Add title int titleLineIndex = GetLineIndexByKey(groupName, entryKey); string titleLine = String.Format("{0} = {1}", entryKey, Quote(deviceName)); if (format == GroupDriverFormat.TitleAndFilesSectionName || format == GroupDriverFormat.TitleAndFilesSectionNameAndServiceName) { if (String.IsNullOrEmpty(filesSectionName)) { filesSectionName = "files.none"; } titleLine += "," + filesSectionName; } if (format == GroupDriverFormat.TitleAndFilesSectionNameAndServiceName) { titleLine += "," + serviceName; } if (titleLineIndex == -1) { AppendLineToSection(groupName, titleLine); } else { UpdateLine(titleLineIndex, titleLine); } }
private void InstructToLoadGroupDriver(string groupName, string filename, string deviceName, GroupDriverFormat format, string filesSectionName) { InstructToLoadGroupDriver(groupName, filename, deviceName, format, filesSectionName, 0, String.Empty); }