コード例 #1
0
        // not sure about most of the values here
        // http://www.msfn.org/board/topic/26742-nlite-not-processing-layoutinf/page__st__13
        // http://www.msfn.org/board/topic/125480-txtsetupsif-syntax/
        /// <param name="destinationFileName">leave Empty to keep the original name</param>
        private static string GetSourceDisksFileEntry(int sourceDiskID, int destinationWinntDirectoryID, string fileName, bool isDriver, FileCopyDisposition upgradeDisposition, FileCopyDisposition textModeDisposition, string destinationFileName, int minorOSVersion)
        {
            // here is sourceDiskID - 1st value
            string subdir = String.Empty;   // values encountered: String.Empty

            string size     = String.Empty; // values encountered: String.Empty
            string checksum = String.Empty; // values encountered: String.Empty, v
            string unused1  = String.Empty; // values encountered: String.Empty
            string unused2  = String.Empty; // values encountered: String.Empty

            // I believe trailing underscore means compressed (because compressed files have trailing underscore in their extension)
            // leading underscore apparently means the file is subject to a file-size check when copied - http://www.msfn.org/board/topic/127677-txtsetupsif-layoutinf-reference/
            // values encountered: String.Empty, _1, _3, _5, _6, _7, _x, 2_, 3_, 4_, 5_, 6_
            // after looking at [SourceDisksNames] in txtsetup.sif it seems that bootMediaOrder is referring to the floppy disk number from which to copy the file
            string bootMediaOrder; // 7th value

            if (isDriver)
            {
                bootMediaOrder = "4_"; //seems as good number as any, I believe that when installing from a CD, each of them refers to the $WINNT$.~BT folder
            }
            else
            {
                bootMediaOrder = String.Empty;
            }

            // here is winntDirectoryID - 8th value

            // here is upgradeDisposition - 9th value, values encountered: 0,1,2,3

            // here is textModeDisposition - 10th value, values encountered: String.Empty,0,1,2,3

            string line = String.Format("{0} = {1},{2},{3},{4},{5},{6},{7},{8},{9},{10}", fileName, sourceDiskID, subdir, size, checksum,
                                        unused1, unused2, bootMediaOrder, destinationWinntDirectoryID, (int)upgradeDisposition, (int)textModeDisposition);

            // here is destinationFileName - 11th value, actual filenames appear here (including long filenames)

            bool appendXP2003DriverEntries = isDriver && (minorOSVersion != 0);

            if (destinationFileName != String.Empty || appendXP2003DriverEntries)
            {
                line += "," + destinationFileName;
            }

            // the next 2 entries are only present in Windows XP / 2003, and usually used with .sys / .dll
            // I could not figure out what they do, the presence / omittance of these entries do not seem to have any effect during text-mode phase
            // note that GUI mode may use txtsetup.sif as well (copied to %windir%\$winnt$.sif if installing from /makelocalsource)
            if (appendXP2003DriverEntries)
            {
                int unknownFlag            = 1; // 12th value, values encountered: String.Empty,0,1
                int destinationDirectoryID = destinationWinntDirectoryID;
                line += String.Format(",{0},{1}", unknownFlag, destinationDirectoryID);
            }
            return(line);
        }
コード例 #2
0
 private static string GetSourceDisksFileDriverEntry(int sourceDiskID, string fileName, FileCopyDisposition fileCopyDisposition, string destinationFileName, int minorOSVersion)
 {
     return(GetSourceDisksFileEntry(sourceDiskID, (int)WinntDirectoryName.System32_Drivers, fileName, true, fileCopyDisposition, fileCopyDisposition, destinationFileName, minorOSVersion));
 }
コード例 #3
0
        public void SetSourceDisksFileEntry(string architectureIdentifier, int sourceDiskID, int destinationWinntDirectoryID, string fileName, FileCopyDisposition fileCopyDisposition)
        {
            string sectionName = String.Format("SourceDisksFiles.{0}", architectureIdentifier);
            // first value is the sourceDiskID
            int    lineIndex = GetLineIndexByFileNameAndWinnntDirectoryID(sectionName, fileName, destinationWinntDirectoryID);
            string line      = GetSourceDisksFileEntry(sourceDiskID, destinationWinntDirectoryID, fileName, false, fileCopyDisposition, fileCopyDisposition, String.Empty, this.MinorOSVersion);

            if (lineIndex == -1)
            {
                AppendLineToSection(sectionName, line);
            }
            else
            {
                UpdateLine(lineIndex, line);
            }
        }
コード例 #4
0
        public void SetSourceDisksFileDriverEntry(int sourceDiskID, string architectureIdentifier, string fileName, FileCopyDisposition fileCopyDisposition, string destinationFileName)
        {
            string sectionName = String.Format("SourceDisksFiles.{0}", architectureIdentifier);
            // first value is the sourceDiskID
            int    lineIndex = GetLineIndexByFileNameAndWinnntDirectoryID(sectionName, fileName, (int)WinntDirectoryName.System32_Drivers);
            string newLine   = GetSourceDisksFileDriverEntry(sourceDiskID, fileName, fileCopyDisposition, destinationFileName, this.MinorOSVersion);

            if (lineIndex == -1)
            {
                AppendLineToSection(sectionName, newLine);
            }
            else
            {
                UpdateLine(lineIndex, newLine);
            }
        }
コード例 #5
0
 public void SetSourceDisksFileDriverEntry(string architectureIdentifier, string fileName, FileCopyDisposition fileCopyDisposition, string destinationFileName)
 {
     // SourceDisksNames 1 = Setup Directory (e.g. \I386)
     SetSourceDisksFileDriverEntry(1, architectureIdentifier, fileName, fileCopyDisposition, destinationFileName);
 }
コード例 #6
0
 public void SetSourceDisksFileDriverEntry(string architectureIdentifier, string fileName, FileCopyDisposition fileCopyDisposition)
 {
     SetSourceDisksFileDriverEntry(architectureIdentifier, fileName, fileCopyDisposition, String.Empty);
 }