|
Adding the files: In the previous part we copied the entire Windows Server 2003, Standard Edition For 64-Bit Extended Systems to a temporary folder on the hard disk. The folder structure is similar to the one below:
In the previous part we determined in what folder we need to place our fasttx2k.sys and fasttx2k.inf files. That would be \AMD64. Just copy the files to that folder and we have our modified installation source. Also mentioned in the previous part, is the simple and the more elegant method for integrating drivers to a Windows installation. Well if you don't care about elegance, skip the rest of this part and go directly to the next part Compiling the ISO file. The elegant solution: A drawback of the simple solution is that when the Windows Setup parses the fasttx2k.inf, it tries to load the file fasttx2k.sys, which it can't locate and asks the user for the proper location using a dialog box. After you enter the correct path (CD-ROM_DRIVE \ AMD64), Windows Setup loads the driver and continues. It's not elegant, but it works. However it would be nice if this dialog box doesn't appear at all, but before we can accomplish that, we need to figure out what went wrong first. I'll talk a bit about the Microsoft inf file layout conventions first before I present a solution. Microsof inf file layout: According to the MSDN documentation the [SourceDisksFiles] section has the following format:
subdir: This optional value specifies the subdirectory (relative to the [SourceDisksNames] path specification, if any) on the source disk where the named file resides. If this value is omitted from an entry, the named source file is assumed to be in the path directory that was specified in the [SourceDisksNames] section for the given disk or, if no path directory was specified, in the installation root. And the [SourceDisksNames] has the following layout, according to MSDN:
path: This optional value specifies the path to the directory on the distribution disk containing source files. The path is relative to the installation root and is expressed as \dirname1\dirname2... and so forth. If this value is omitted from an entry, files are assumed to be in the installation root of the distribution disk. You can use an INF [SourceDisksFiles] section to specify subdirectories, relative to a given path directory, that contain source files. However, tag files and cabinet files must reside either in the given path directory or in the installation root. Another interesting line from MSDN is this one: To support distribution of driver files for multiple system architectures, construct architecture-specific SourceDisksFiles sections. During installation, Setup API functions use both architecture-specific and generic SourceDisksFiles sections, but they look in the architecture-specific section before using the generic section. For example, if, during installation on an x86-based platform, Setup is copying a file named driver.sys, it will look for the file's description in SourceDisksNames.x86 before looking in SourceDisksNames. Although we don't use this now, it is always handy to know... installationroot: But the most interesting part can be read here, it's about the installationroot: During an installation, the directory (on the distribution medium) that contains the INF file currently in use. After an INF file is copied to the system's INF directory, the INF file's installation root continues to reference the distribution medium, unless an installation application copies the INF file by calling SetupCopyOEMInf (described in the Platform SDK). All directory paths specified within an INF file are specified relative to the installation root. Our distribution medium was CD-ROM_DRIVE\AMD64 or to be more precise '1 = %cdname%,%cdtagfilea%,,\amd64', our fasttx2k.sys file happens to reside in that location. Now let's take a look at our fasttx2k.inf again:
If the subdir field is not used under the [SourceDisksFiles] section, the [SourceDisksNames] fields are used. However, these are also empty and thus reverts the inf parser back to the current directory when files under the [SourceDisksFiles] section are processed. During the GUI phase this current directoy is: %SystemRoot%\Inf! No wonder the Windows Setup can't find our fasttx2k.sys driver file. The solution: But the solution is very simple, remove the [SourceDisksNames] section entirely (or better comment it out using ';').
Replace the corresponding lines in the fasttx2k.inf file with the ones above, save it and you're in business. This is all there is. Our ISO file can now be created. |