Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (doc) update Changelog/nuspec
  (GH-258) File detector use exe
  (GH-658) Allow custom key/value args in choco new
  (GH-641) log file is optional
  (maint) ANYCPU all the things
  (GH647)(GH-374) Update shimgem
  • Loading branch information
ferventcoder committed Mar 11, 2016
2 parents 9663ac1 + 8289f01 commit 7ff95f7
Show file tree
Hide file tree
Showing 22 changed files with 156 additions and 49 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ For 590 - if you set a custom cache directory for downloads, it will no longer u
* Support for custom headers - see [#332](https://github.com/chocolatey/choco/issues/332)
* [Security] Show moderation-related information in search results - see [#493](https://github.com/chocolatey/choco/issues/493)
* New Helper - Get-ToolsLocation helper (replacement for Get-BinRoot) - see [#631](https://github.com/chocolatey/choco/issues/631)

* Choco list/search should have exact filter search - see [#453](https://github.com/chocolatey/choco/issues/453)

### BUG FIXES

* [Security] Fix - Only load the Chocolatey PowerShell module from a known location - see [#560](https://github.com/chocolatey/choco/issues/560)
Expand All @@ -59,6 +60,7 @@ For 590 - if you set a custom cache directory for downloads, it will no longer u
* Fix - Verbose shows in output on debug switch - see [#611](https://github.com/chocolatey/choco/issues/611)
* Fix: Get-ChocolateyUnzip captures files that don't belong to the package - see [#616](https://github.com/chocolatey/choco/issues/616)
* Fix: Package succeeds but software install silently fails when Install-ChocolateyInstallPackage has the wrong arguments - see [#629](https://github.com/chocolatey/choco/issues/629)
* Fix - ShimGen handling of spaces and arguments that have shimgen in them - see [#647](https://github.com/chocolatey/choco/issues/647)

### IMPROVEMENTS

Expand All @@ -73,6 +75,9 @@ For 590 - if you set a custom cache directory for downloads, it will no longer u
* Suppress verbose output to verbose - like with 7-zip - see [#476](https://github.com/chocolatey/choco/issues/476)
* Choco push moderation message only on push to dot org - see [#601](https://github.com/chocolatey/choco/issues/601)
* Allow tools/bin root to be root of the drive again - see [#628](https://github.com/chocolatey/choco/issues/628)
* File description of ShimGen shims should match original as closely as possible - see [#374](https://github.com/chocolatey/choco/issues/374)
* Shim Generation should automatically detect GUI - see [#634](https://github.com/chocolatey/choco/issues/634)
* Don't show 32 bit wording unless there is explicitly both versions available - see [#642](https://github.com/chocolatey/choco/issues/642)
* Pro - Also check for license in User Profile location - see [#606](https://github.com/chocolatey/choco/issues/606)
* Pro - Set download cache information if available - see [#562](https://github.com/chocolatey/choco/issues/562)
* Pro - Allow commands to be added - see [#583](https://github.com/chocolatey/choco/issues/583)
Expand Down
10 changes: 8 additions & 2 deletions nuget/chocolatey/chocolatey.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ There are quite a few commands you can call - you should check out the [command
* Upgrade - choco upgrade baretail
* Uninstall - choco uninstall baretail

Alternative installation sources:
#### Alternative installation sources:
* Install ruby gem - choco install compass -source ruby
* Install python egg - choco install sphynx -source python
* Install windows feature - choco install IIS -source windowsfeatures
* Install webpi feature - choco install IIS7.5Express -source webpi

#### More
For more advanced commands and switches, use `choco -?` or `choco command -h`. You can also look at the [command reference](https://github.com/chocolatey/choco/wiki/CommandsReference), including how you can force a package to install the x86 version of a package.

### Create Packages?
Expand Down Expand Up @@ -88,7 +89,8 @@ For 590 - if you set a custom cache directory for downloads, it will no longer u
* Support for custom headers - see [#332](https://github.com/chocolatey/choco/issues/332)
* [Security] Show moderation-related information in search results - see [#493](https://github.com/chocolatey/choco/issues/493)
* New Helper - Get-ToolsLocation helper (replacement for Get-BinRoot) - see [#631](https://github.com/chocolatey/choco/issues/631)

* Choco list/search should have exact filter search - see [#453](https://github.com/chocolatey/choco/issues/453)

### BUG FIXES

* [Security] Fix - Only load the Chocolatey PowerShell module from a known location - see [#560](https://github.com/chocolatey/choco/issues/560)
Expand All @@ -115,6 +117,7 @@ For 590 - if you set a custom cache directory for downloads, it will no longer u
* Fix - Verbose shows in output on debug switch - see [#611](https://github.com/chocolatey/choco/issues/611)
* Fix: Get-ChocolateyUnzip captures files that don't belong to the package - see [#616](https://github.com/chocolatey/choco/issues/616)
* Fix: Package succeeds but software install silently fails when Install-ChocolateyInstallPackage has the wrong arguments - see [#629](https://github.com/chocolatey/choco/issues/629)
* Fix - ShimGen handling of spaces and arguments that have shimgen in them - see [#647](https://github.com/chocolatey/choco/issues/647)

### IMPROVEMENTS

Expand All @@ -129,6 +132,9 @@ For 590 - if you set a custom cache directory for downloads, it will no longer u
* Suppress verbose output to verbose - like with 7-zip - see [#476](https://github.com/chocolatey/choco/issues/476)
* Choco push moderation message only on push to dot org - see [#601](https://github.com/chocolatey/choco/issues/601)
* Allow tools/bin root to be root of the drive again - see [#628](https://github.com/chocolatey/choco/issues/628)
* File description of ShimGen shims should match original as closely as possible - see [#374](https://github.com/chocolatey/choco/issues/374)
* Shim Generation should automatically detect GUI - see [#634](https://github.com/chocolatey/choco/issues/634)
* Don't show 32 bit wording unless there is explicitly both versions available - see [#642](https://github.com/chocolatey/choco/issues/642)
* Pro - Also check for license in User Profile location - see [#606](https://github.com/chocolatey/choco/issues/606)
* Pro - Set download cache information if available - see [#562](https://github.com/chocolatey/choco/issues/562)
* Pro - Allow commands to be added - see [#583](https://github.com/chocolatey/choco/issues/583)
Expand Down
Binary file modified src/chocolatey.resources/redirects/choco.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/chocolatey.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cinst.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/clist.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cpack.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cpush.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cuninst.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cup.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cver.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/tools/die.zip
Binary file not shown.
Binary file modified src/chocolatey.resources/tools/shimgen.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions src/chocolatey.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chocolatey.console", "chocolatey.console\chocolatey.console.csproj", "{E24E3386-244F-4404-9E6E-5B53818EA903}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chocolatey.tests", "chocolatey.tests\chocolatey.tests.csproj", "{5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}"
Expand Down Expand Up @@ -30,14 +30,14 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Mixed Platforms.Build.0 = Debug|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|x86.ActiveCfg = Debug|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|x86.Build.0 = Debug|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Any CPU.Build.0 = Release|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Mixed Platforms.ActiveCfg = Release|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Mixed Platforms.Build.0 = Release|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|x86.ActiveCfg = Release|x86
{E24E3386-244F-4404-9E6E-5B53818EA903}.Release|x86.Build.0 = Release|x86
{5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
28 changes: 27 additions & 1 deletion src/chocolatey.tests/infrastructure/tokens/TokenReplacerSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace chocolatey.tests.infrastructure.tokens
{
using System.Collections.Generic;
using Should;
using chocolatey.infrastructure.app.configuration;
using chocolatey.infrastructure.tokens;
Expand Down Expand Up @@ -66,10 +67,16 @@ public void when_given_brace_brace_commandname_brace_brace_should_replace_with_t
public void when_given_brace_brace_COMMANDNAME_brace_brace_should_replace_with_the_Name_from_the_configuration()
{
TokenReplacer.replace_tokens(configuration, "Hi! My name is [[COMMANDNAME]]").ShouldEqual("Hi! My name is " + name);
}

[Fact]
public void when_given_brace_brace_cOMmAnDnAMe_brace_brace_should_replace_with_the_Name_from_the_configuration()
{
TokenReplacer.replace_tokens(configuration, "Hi! My name is [[cOMmAnDnAMe]]").ShouldEqual("Hi! My name is " + name);
}

[Fact]
public void if_given_brace_brace_ServerName_brace_brace_should_NOT_replace_with_the_Name_from_the_configuration()
public void if_given_brace_brace_Version_brace_brace_should_NOT_replace_with_the_Name_from_the_configuration()
{
TokenReplacer.replace_tokens(configuration, "Go to [[Version]]").ShouldNotContain(name);
}
Expand Down Expand Up @@ -98,5 +105,24 @@ public void if_given_an_null_value_should_return_the_ll_value()
TokenReplacer.replace_tokens(configuration, null).ShouldEqual("");
}
}

public class when_using_TokenReplacer_with_a_Dictionary : TokenReplacerSpecsBase
{
public Dictionary<string, string> tokens = new Dictionary<string, string>();
private string value = "sweet";


public override void Because()
{
tokens.Add("dude", value);
}

[Fact]
public void when_given_a_proper_token_it_should_replace_with_the_dictionary_value()
{
TokenReplacer.replace_tokens(tokens, "Hi! My name is [[dude]]").ShouldEqual("Hi! My name is " + value);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override InstallerType InstallerType
get { return InstallerType.Custom; }
}

public override string build_install_command_arguments(bool customInstallLocation, bool languageRequested)
public override string build_install_command_arguments(bool logFile, bool customInstallLocation, bool languageRequested)
{
if (customInstallLocation) this.Log().Warn("CustomInstaller doesn't support custom install locations.");
if (languageRequested) this.Log().Warn("CustomInstaller doesn't support custom language options.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface IInstaller
IEnumerable<int> ValidInstallExitCodes { get; }
IEnumerable<int> ValidUninstallExitCodes { get; }

string build_install_command_arguments(bool customInstallLocation, bool languageRequested);
string build_install_command_arguments(bool logFile, bool customInstallLocation, bool languageRequested);
string build_uninstall_command_arguments();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ public abstract class InstallerBase : IInstaller
public IEnumerable<int> ValidInstallExitCodes { get; protected set; }
public IEnumerable<int> ValidUninstallExitCodes { get; protected set; }

public virtual string build_install_command_arguments(bool customInstallLocation, bool languageRequested)
public virtual string build_install_command_arguments(bool logFile, bool customInstallLocation, bool languageRequested)
{
var args = new StringBuilder();
args.AppendFormat("{0} {1}", SilentInstall, NoReboot);
//MSI may have issues with 1622 - opening a log file location
args.AppendFormat(" {0}", LogFile);
args.Append("{0} {1} {2}".format_with(SilentInstall, NoReboot, OtherInstallOptions).trim_safe());
if (languageRequested) args.AppendFormat(" {0}", Language);
args.AppendFormat(" {0}", OtherInstallOptions);

//MSI may have issues with 1622 - opening a log file location
if (logFile) args.AppendFormat(" {0}", LogFile);
// custom install location must be last for NSIS
if (customInstallLocation) args.AppendFormat(" {0}", CustomInstallLocation);

Expand All @@ -53,7 +51,7 @@ public virtual string build_install_command_arguments(bool customInstallLocation
public virtual string build_uninstall_command_arguments()
{
//MSI has issues with 1622 - opening a log file location
return "{0} {1} {2}".format_with(SilentUninstall, NoReboot, OtherUninstallOptions);
return "{0} {1} {2}".format_with(SilentUninstall, NoReboot, OtherUninstallOptions).trim_safe();
}
}
}
Loading

0 comments on commit 7ff95f7

Please sign in to comment.