예제 #1
0
        public void AddFile(string fileName, string subDir, string destinationFileName)
        {
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);

            if (!fileInfo.Exists)
            {
                throw new System.IO.FileNotFoundException("The specified file was not found", fileName);
            }

            var copyFilesSectionName = string.Format("Files.Common{0}", this.CopyFileSections.Count + 1);

            int sourceDisk = this.SourceDiskNames.Add(fileInfo.DirectoryName);

            this.SourceDiskFiles.Add(fileInfo.Name, sourceDisk);

            this.DestinationDir.Add(copyFilesSectionName, subDir);

            var copyFiles = new CopyFileListSection(copyFilesSectionName, destinationFileName, fileInfo.Name);

            this.CopyFileSections.Add(copyFiles);
            this.DefaultInstallation.CopyFiles.Add(copyFilesSectionName);
        }
예제 #2
0
        public void AddFile(string fileName, string subDir, string destinationFileName)
        {
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);

            if (!fileInfo.Exists)
            {
                throw new System.IO.FileNotFoundException("The specified file was not found", fileName);
            }

            var copyFilesSectionName = string.Format("Files.Common{0}", this.CopyFileSections.Count + 1);

            int sourceDisk = this.SourceDiskNames.Add(fileInfo.DirectoryName);

            this.SourceDiskFiles.Add(fileInfo.Name, sourceDisk);

            this.DestinationDir.Add(copyFilesSectionName, subDir);

            var copyFiles = new CopyFileListSection(copyFilesSectionName, destinationFileName, fileInfo.Name);

            this.CopyFileSections.Add(copyFiles);
            this.DefaultInstallation.CopyFiles.Add(copyFilesSectionName);
        }