private static string GetTargetDirectory(string rootDirectory, MsiDirectory relativePath) { LessIO.Path fullPath = LessIO.Path.Combine(rootDirectory, relativePath.GetPath()); if (!FileSystem.Exists(fullPath)) { FileSystem.CreateDirectory(fullPath); } return(fullPath.PathString); }
private static DirectoryInfo GetTargetDirectory(DirectoryInfo rootDirectory, MsiDirectory relativePath) { string fullPath = Path.Combine(rootDirectory.FullName, relativePath.GetPath()); if (!Directory.Exists(fullPath)) { Directory.CreateDirectory(fullPath); } return(new DirectoryInfo(fullPath)); }
private static DirectoryInfo GetTargetDirectory(DirectoryInfo rootDirectory, MsiDirectory relativePath) { if (rootDirectory == null) { throw new ArgumentNullException("rootDirectory"); } if (relativePath == null) { throw new ArgumentNullException("relativePath"); } var fullPath = Path.Combine(rootDirectory.FullName, relativePath.GetPath()); if (!Directory.Exists(fullPath)) { Directory.CreateDirectory(fullPath); } return(new DirectoryInfo(fullPath)); }
/// <summary> /// Returns the full path considering it's parent directories. /// </summary> /// <returns></returns> public string GetPath() { string path = this.TargetName; MsiDirectory parent = this.Parent; if (path == ".") { //happens in python msi Debug.Assert(parent != null, "Can't have null parent and '.' target directory."); path = parent.GetPath(); parent = null; } while (parent != null) { //Sometimes parent is a '.' In this case, the files should be directly put into the parent of the parent. See http://msdn.microsoft.com/en-us/library/aa368295%28VS.85%29.aspx if (parent.TargetName != ".") { path = Path.Combine(parent.TargetName, path); } parent = parent.Parent; } return(path); }
private static DirectoryInfo GetTargetDirectory(DirectoryInfo rootDirectory, MsiDirectory relativePath) { string fullPath = Path.Combine(rootDirectory.FullName, relativePath.GetPath()); if (!Directory.Exists(fullPath)) { Directory.CreateDirectory(fullPath); } return new DirectoryInfo(fullPath); }
private static string GetTargetDirectory(string rootDirectory, MsiDirectory relativePath) { LessIO.Path fullPath = LessIO.Path.Combine(rootDirectory, relativePath.GetPath()); if (!FileSystem.Exists(fullPath)) { FileSystem.CreateDirectory(fullPath); } return fullPath.PathString; }