{"record":{"id":"8571caaedc51c301","repo":"chocolatey/choco","slug":"it-appears-you-are-attempting-to-use-options-that","errorCode":null,"errorMessage":"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.","messagePattern":"It appears you are attempting to use options that may be only available in licensed versions of Chocolatey \\('(.+?)'\\)\\. 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\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs","lineNumber":256,"sourceCode":"            //    throw new ApplicationException(\"Package name cannot contain invalid characters.\");\r\n            //}\r\n\r\n            if (configuration.ForceDependencies && !configuration.Force)\r\n            {\r\n                throw new ApplicationException(\"Force dependencies can only be used with force also turned on.\");\r\n            }\r\n\r\n            if (!string.IsNullOrWhiteSpace(configuration.Input))\r\n            {\r\n                var unparsedOptionsAndPackages = configuration.Input.Split(new[] { \" \" }, StringSplitOptions.RemoveEmptyEntries);\r\n                if (!configuration.Information.IsLicensedVersion)\r\n                {\r\n                    foreach (var argument in unparsedOptionsAndPackages.OrEmpty())\r\n                    {\r\n                        var arg = argument.ToLowerSafe();\r\n                        if (arg.StartsWith(\"-dir\") || arg.StartsWith(\"--dir\") || arg.StartsWith(\"-install\") || arg.StartsWith(\"--install\"))\r\n                        {\r\n                            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));\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            if (!string.IsNullOrWhiteSpace(configuration.SourceCommand.Username) && string.IsNullOrWhiteSpace(configuration.SourceCommand.Password))\r\n            {\r\n                this.Log().Debug(ChocolateyLoggers.LogFileOnly, \"Username '{0}' provided. Asking for password.\".FormatWith(configuration.SourceCommand.Username));\r\n                System.Console.Write(\"User name '{0}' provided. Password: \".FormatWith(configuration.SourceCommand.Username));\r\n                configuration.SourceCommand.Password = InteractivePrompt.GetPassword(configuration.PromptForConfirmation);\r\n            }\r\n        }\r\n\r\n        public override void HelpMessage(ChocolateyConfiguration configuration)\r\n        {\r\n            this.Log().Info(ChocolateyLoggers.Important, \"Install Command\");\r\n            this.Log().Info(@\"\r\nInstalls a package or a list of packages (sometimes specified as a\r","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs#L238-L274","documentation":"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.","triggerScenarios":"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.","commonSituations":"Copy-pasting Business/Pro examples on OSS Chocolatey; assuming --install-arguments works without a license; using --dir without a Business license.","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."],"exampleFix":"# before (OSS)\nchoco install pkg --install-arguments='/quiet'\n\n# after\nchoco install pkg --package-parameters='/quiet'","handlingStrategy":"validation","validationCode":"// On OSS edition, reject licensed-only install tokens before calling choco.\nif (!isLicensed)\n{\n    var licensedOnly = input.Where(t =>\n        t.StartsWith(\"-dir\", StringComparison.OrdinalIgnoreCase) ||\n        t.StartsWith(\"--dir\", StringComparison.OrdinalIgnoreCase) ||\n        t.StartsWith(\"-install\", StringComparison.OrdinalIgnoreCase) ||\n        t.StartsWith(\"--install\", StringComparison.OrdinalIgnoreCase));\n    if (licensedOnly.Any()) throw new InvalidOperationException(\"licensed-only option on OSS\");\n}","typeGuard":"static bool IsLicensedOnlyInstallOption(string arg) =>\n    arg.StartsWith(\"-dir\", StringComparison.OrdinalIgnoreCase) ||\n    arg.StartsWith(\"--dir\", StringComparison.OrdinalIgnoreCase) ||\n    arg.StartsWith(\"-install\", StringComparison.OrdinalIgnoreCase) ||\n    arg.StartsWith(\"--install\", StringComparison.OrdinalIgnoreCase);","tryCatchPattern":null,"preventionTips":["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."],"tags":["install","licensed","options","open-source"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}