From c390f8c3e1bea6f510d7548b6fb866562a7105dd Mon Sep 17 00:00:00 2001 From: sahebjade Date: Tue, 22 Dec 2015 16:34:31 +0530 Subject: [PATCH] (GH-510) Fix: args for new fail with param=value Some installers, MSIs in particular, specify silent arguments as PROPERTY=value. Attempting to pass that in with `choco new silentargs="/qn /norestart PROPERTY=value` will cause choco to pass an empty string value in place of the passed arguments. Fix the behavior to do the right thing when splitting the property settings so that `=` can be passed as part of the arguments. --- .../infrastructure.app/commands/ChocolateyNewCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs index 71b697ed01..ab2b6006e7 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs @@ -79,7 +79,7 @@ public void handle_additional_argument_parsing(IList unparsedArguments, foreach (var unparsedArgument in unparsedArguments.or_empty_list_if_null()) { - var property = unparsedArgument.Split(new[] {'='}, StringSplitOptions.RemoveEmptyEntries); + var property = unparsedArgument.Split(new[] { '=' }, 2, StringSplitOptions.RemoveEmptyEntries); if (property.Count() == 2) { var propName = property[0].trim_safe();