chocolatey/choco · error · ApplicationException
It appears you are attempting to use options that may be onl
Error message
It appears you are attempting to use options that may be only available in licensed versions of Chocolatey ('{0}'). There may be ways in the open source edition to achieve what you are looking to do. Please remove the argument and consult the documentation. What it means
On non-licensed (open source) Chocolatey, Validate() scans unparsed input for tokens starting with -dir/--dir/-install/--install, which are licensed-edition options (custom install directory / install arguments). If found and Information.IsLicensedVersion is false, it throws, telling the user those options are licensed-only.
Source
Thrown at src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs:256
// throw new ApplicationException("Package name cannot contain invalid characters.");
//}
if (configuration.ForceDependencies && !configuration.Force)
{
throw new ApplicationException("Force dependencies can only be used with force also turned on.");
}
if (!string.IsNullOrWhiteSpace(configuration.Input))
{
var unparsedOptionsAndPackages = configuration.Input.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (!configuration.Information.IsLicensedVersion)
{
foreach (var argument in unparsedOptionsAndPackages.OrEmpty())
{
var arg = argument.ToLowerSafe();
if (arg.StartsWith("-dir") || arg.StartsWith("--dir") || arg.StartsWith("-install") || arg.StartsWith("--install"))
{
throw new ApplicationException("It appears you are attempting to use options that may be only available in licensed versions of Chocolatey ('{0}'). There may be ways in the open source edition to achieve what you are looking to do. Please remove the argument and consult the documentation.".FormatWith(arg));
}
}
}
}
if (!string.IsNullOrWhiteSpace(configuration.SourceCommand.Username) && string.IsNullOrWhiteSpace(configuration.SourceCommand.Password))
{
this.Log().Debug(ChocolateyLoggers.LogFileOnly, "Username '{0}' provided. Asking for password.".FormatWith(configuration.SourceCommand.Username));
System.Console.Write("User name '{0}' provided. Password: ".FormatWith(configuration.SourceCommand.Username));
configuration.SourceCommand.Password = InteractivePrompt.GetPassword(configuration.PromptForConfirmation);
}
}
public override void HelpMessage(ChocolateyConfiguration configuration)
{
this.Log().Info(ChocolateyLoggers.Important, "Install Command");
this.Log().Info(@"
Installs a package or a list of packages (sometimes specified as a
View on GitHub (pinned to 0d5abdd10c)
Solutions
- Remove the licensed-only option and use OSS-supported alternatives (e.g. package parameters the package itself understands).
- Install Chocolatey Licensed (Business) edition if you need these features.
- Pass install arguments via the package's own parameter convention rather than --install-arguments on OSS.
Example fix
# before (OSS) choco install pkg --install-arguments='/quiet' # after choco install pkg --package-parameters='/quiet'
Defensive patterns
Strategy: validation
Validate before calling
// On OSS edition, reject licensed-only install tokens before calling choco.
if (!isLicensed)
{
var licensedOnly = input.Where(t =>
t.StartsWith("-dir", StringComparison.OrdinalIgnoreCase) ||
t.StartsWith("--dir", StringComparison.OrdinalIgnoreCase) ||
t.StartsWith("-install", StringComparison.OrdinalIgnoreCase) ||
t.StartsWith("--install", StringComparison.OrdinalIgnoreCase));
if (licensedOnly.Any()) throw new InvalidOperationException("licensed-only option on OSS");
} Type guard
static bool IsLicensedOnlyInstallOption(string arg) =>
arg.StartsWith("-dir", StringComparison.OrdinalIgnoreCase) ||
arg.StartsWith("--dir", StringComparison.OrdinalIgnoreCase) ||
arg.StartsWith("-install", StringComparison.OrdinalIgnoreCase) ||
arg.StartsWith("--install", StringComparison.OrdinalIgnoreCase); Prevention
- Check Information.IsLicensedVersion before relying on --install-arguments/--dir.
- Prefer package parameters the package itself supports on OSS.
- Upgrade to Chocolatey Business if you need custom install directories.
When it happens
Trigger: Running open-source 'choco install <pkg> --install-arguments=...' or 'choco install <pkg> --dir=C:\x' where the token begins with -dir/--dir/-install/--install and IsLicensedVersion is false.
Common situations: Copy-pasting Business/Pro examples on OSS Chocolatey; assuming --install-arguments works without a license; using --dir without a Business license.
Related errors
- Package name is required. Please pass at least one package n
- Force dependencies can only be used with force also turned o
- Reboot required before continuing. Reboot and run the same c
- Stopping further execution as {0} has failed {1}.
- The '{0}' source does not support installing packages
AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13).
Data as JSON: /api/errors/8571caaedc51c301.
Report an issue: GitHub.