From 2175f0b8688903f7e41f711fd85663e6bc32ecda Mon Sep 17 00:00:00 2001 From: hamid_shahid_cp Date: Mon, 28 Apr 2014 13:42:51 +0100 Subject: [PATCH] Fixed issue 12962: Cab file could not be created for folders with spaces in them. #12962 The Cab task does not creating cabs for folder paths with spaces in them --- Solutions/Main/Framework/Compression/Cab.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Solutions/Main/Framework/Compression/Cab.cs b/Solutions/Main/Framework/Compression/Cab.cs index 887369ff..8b2695a7 100644 --- a/Solutions/Main/Framework/Compression/Cab.cs +++ b/Solutions/Main/Framework/Compression/Cab.cs @@ -207,7 +207,7 @@ private void AddFile() StringBuilder options = new StringBuilder(); options.Append("-r -p"); options.AppendFormat(" -P \"{0}\"\\", dirInfo.FullName.Remove(dirInfo.FullName.Length - 1).Replace(@"C:\", string.Empty)); - cabProcess.StartInfo.Arguments = string.Format(CultureInfo.CurrentCulture, @"{0} N ""{1}"" {2}", options, this.CabFile.GetMetadata("FullPath"), "\"" + dirInfo.FullName + "*.*\"" + " "); + cabProcess.StartInfo.Arguments = string.Format(CultureInfo.CurrentCulture, @"{0} N ""{1}"" ""{2}""", options, this.CabFile.GetMetadata("FullPath"), "\"" + dirInfo.FullName + "*.*\"" + " "); this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Calling {0} with {1}", this.CabExePath.GetMetadata("FullPath"), cabProcess.StartInfo.Arguments)); // start the process @@ -377,7 +377,7 @@ private void Create() files = this.FilesToCab.Aggregate(files, (current, file) => current + ("\"" + file.ItemSpec + "\"" + " ")); } - cabProcess.StartInfo.Arguments = string.Format(CultureInfo.CurrentCulture, @"{0} N ""{1}"" {2}", options, this.CabFile.GetMetadata("FullPath"), files); + cabProcess.StartInfo.Arguments = string.Format(CultureInfo.CurrentCulture, @"{0} N ""{1}"" ""{2}""", options, this.CabFile.GetMetadata("FullPath"), files); this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Calling {0} with {1}", this.CabExePath.GetMetadata("FullPath"), cabProcess.StartInfo.Arguments)); // start the process