diff --git a/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs index df766cabfe..aa10ff6e76 100644 --- a/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs +++ b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs @@ -138,5 +138,25 @@ public sealed class PackagesConfigFilePackageSetting [XmlAttribute(AttributeName = "disableRepositoryOptimizations")] public bool DisableRepositoryOptimizations { get; set; } + [XmlAttribute(AttributeName = "acceptLicense")] + public bool AcceptLicense { get; set; } + + [XmlAttribute(AttributeName = "confirm")] + public bool Confirm { get; set; } + + [XmlAttribute(AttributeName = "limitOutput")] + public bool LimitOutput { get; set; } + + [XmlAttribute(AttributeName = "cacheLocation")] + public string CacheLocation { get; set; } + + [XmlAttribute(AttributeName = "failOnStderr")] + public bool FailOnStderr { get; set; } + + [XmlAttribute(AttributeName = "useSystemPowershell")] + public bool UseSystemPowershell { get; set; } + + [XmlAttribute(AttributeName = "noProgress")] + public bool NoProgress { get; set; } } } diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index 7d250536b4..133e755176 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -767,6 +767,17 @@ private IEnumerable get_packages_from_config(string pac if (pkgSettings.ExitWhenRebootDetected) packageConfig.Features.ExitOnRebootDetected = true; if (pkgSettings.IgnoreDetectedReboot) packageConfig.Features.ExitOnRebootDetected = false; if (pkgSettings.DisableRepositoryOptimizations) packageConfig.Features.UsePackageRepositoryOptimizations = false; + if (pkgSettings.AcceptLicense) packageConfig.AcceptLicense = true; + if (pkgSettings.Confirm) + { + packageConfig.PromptForConfirmation = false; + packageConfig.AcceptLicense = true; + } + if (pkgSettings.LimitOutput) packageConfig.RegularOutput = false; + packageConfig.CacheLocation = string.IsNullOrWhiteSpace(pkgSettings.CacheLocation) ? packageConfig.CacheLocation : pkgSettings.CacheLocation; + if (pkgSettings.FailOnStderr) packageConfig.Features.FailOnStandardError = true; + if (pkgSettings.UseSystemPowershell) packageConfig.Features.UsePowerShellHost = false; + if (pkgSettings.NoProgress) packageConfig.Features.ShowDownloadProgress = false; this.Log().Info(ChocolateyLoggers.Important, @"{0}".format_with(packageConfig.PackageNames)); packageConfigs.Add(packageConfig);