string GenerateIdFromParentDirectory(string fileName)
        {
            string fullParentDirectory = Path.GetDirectoryName(fileName);
            string lastFolder          = WixDirectoryElement.GetLastFolderInDirectoryName(fullParentDirectory);
            string id = UpperCaseFirstCharacter(lastFolder);

            id = WixFileElement.GenerateId(id);
            id = RemoveDotCharacters(id);
            return(id);
        }
Пример #2
0
        string GenerateIdFromParentDirectory(string parentDirectory)
        {
            string parentDirectoryName = WixDirectoryElement.GetLastFolderInDirectoryName(parentDirectory);

            if (parentDirectoryName.Length > 0)
            {
                return(WixFileElement.GenerateId(parentDirectoryName));
            }
            return(String.Empty);
        }
        /// <summary>
        /// Adds any subdirectories and files to the directory element.
        /// </summary>
        /// <param name="directoryElement">The directory element to add
        /// the components and subdirectories to.</param>
        /// <param name="directory">The full path of the directory.</param>
        void AddDirectoryContents(WixDirectoryElement directoryElement, string directory)
        {
            foreach (string subDirectory in DirectoryReader.GetDirectories(directory))
            {
                string subDirectoryName = WixDirectoryElement.GetLastFolderInDirectoryName(subDirectory);
                if (!excludedNames.IsExcluded(subDirectoryName))
                {
                    WixDirectoryElement subDirectoryElement = AddDirectory(directoryElement, subDirectoryName);
                    AddFiles(subDirectoryElement, subDirectory);

                    // Add the subdirectory contents.
                    AddDirectoryContents(subDirectoryElement, subDirectory);
                }
            }
        }
        /// <summary>
        /// Adds the specified directory to the selected element. This
        /// adds all the contained files and subdirectories recursively to the
        /// setup package.
        /// </summary>
        public void AddDirectory(string directory)
        {
            WixDirectoryElement parentElement = (WixDirectoryElement)view.SelectedElement;

            // Add directory.
            string directoryName = WixDirectoryElement.GetLastFolderInDirectoryName(directory);
            WixDirectoryElement directoryElement = AddDirectory(parentElement, directoryName);

            AddFiles(directoryElement, directory);

            // Adds directory contents recursively.
            AddDirectoryContents(directoryElement, directory);

            AddElementToView(directoryElement);
        }