From 1cf2e19d1df1a022c420e31ef8044b99d5c23bdb Mon Sep 17 00:00:00 2001 From: Wilson McCoubrey Date: Thu, 1 Dec 2016 00:13:35 +0000 Subject: [PATCH] (GH-1069) Fix - Disable failOnInvalidOrMissingLicense Feature Once enabled, if one does not have a license, they cannot run choco feature to disable the feature and cannot use Chocolatey until one manually changes the feature in the configuration file. This change disables the check for a license when `failOnInvalidOrMissingLicense` is enabled and the 'features' command is being used. --- src/chocolatey/infrastructure.app/runners/GenericRunner.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs index 2126b236bb..d14e042b98 100644 --- a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs +++ b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs @@ -121,7 +121,10 @@ private void set_source_type(ChocolateyConfiguration config) public void fail_when_license_is_missing_or_invalid_if_requested(ChocolateyConfiguration config) { - if (!config.Features.FailOnInvalidOrMissingLicense) return; + if (!config.Features.FailOnInvalidOrMissingLicense || + config.CommandName.trim_safe().is_equal_to("feature") || + config.CommandName.trim_safe().is_equal_to("features") + ) return; if (!config.Information.IsLicensedVersion) throw new ApplicationException("License is missing or invalid."); }