public async void Install() { var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner()); await chocolateyInstaller.InstallChocolatey(null, null); Assert.IsTrue(chocolateyInstaller.IsInstalled()); }
public void PatchRunNuget() { var sourcefile = Path.Combine(AssemblyLocation.CurrentDirectory, @"Chocolatey\Run-NuGet.ps1"); ChocolateyInstaller.PatchRunNuget(sourcefile); Approvals.Verify(File.ReadAllText(sourcefile), s => s.Replace("\r\n", "\n")); }
public async void GetVersionFromRawFile() { var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner()); var installVersion = await chocolateyInstaller.GetVersionFromRawFile(); Debug.WriteLine(installVersion); Assert.IsNotNull(installVersion); }
public ShellViewModel(IEventAggregator eventAggregator, ChocolateyInstaller chocolateyInstaller, LicenseAgreement licenseAgreement, ILifetimeScope lifetimeScope, PowerShellRunner powerShellRunner) { this.chocolateyInstaller = chocolateyInstaller; this.licenseAgreement = licenseAgreement; this.lifetimeScope = lifetimeScope; this.powerShellRunner = powerShellRunner; this.eventAggregator = eventAggregator; RunStartupSequence(); }
public InstallingViewModel(PackageDefinitionService packageDefinitionDiscovery, ChocolateyInstaller chocolateyInstaller, IEventAggregator eventAggregator, PackageManager packageManager, IWindowManager windowManager, PowerShellRunner powerShellRunner, List<string> itemsToInstall) { PackageDefinitionService = packageDefinitionDiscovery; this.chocolateyInstaller = chocolateyInstaller; this.eventAggregator = eventAggregator; this.packageManager = packageManager; this.windowManager = windowManager; this.powerShellRunner = powerShellRunner; this.itemsToInstall = itemsToInstall; }
public void ParseVersionFromRawFile() { var sourceDirectory = Path.Combine(AssemblyLocation.CurrentDirectory, @"Chocolatey\ChocolateyPs1"); foreach (var chocolateyFile in Directory.EnumerateFiles(sourceDirectory)) { var version = ChocolateyInstaller.ParseVersionFromRawFile(chocolateyFile); Debug.WriteLine(Path.GetFileNameWithoutExtension(chocolateyFile) + "=" + version); Assert.IsNotNull(version); } }
public InstallingViewModel(PackageDefinitionService packageDefinitionDiscovery, ChocolateyInstaller chocolateyInstaller, IEventAggregator eventAggregator, PackageManager packageManager, IWindowManager windowManager, PowerShellRunner powerShellRunner, List <string> itemsToInstall, ILifetimeScope lifetimeScope) { PackageDefinitionService = packageDefinitionDiscovery; this.chocolateyInstaller = chocolateyInstaller; this.eventAggregator = eventAggregator; this.packageManager = packageManager; this.windowManager = windowManager; this.powerShellRunner = powerShellRunner; this.itemsToInstall = itemsToInstall; this.lifetimeScope = lifetimeScope; }
public static void ChocolateyInstallFromConfig(this ICakeContext context, FilePath packageConfigPath, ChocolateyInstallSettings settings) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var resolver = new ChocolateyToolResolver(context.FileSystem, context.Environment); var runner = new ChocolateyInstaller(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, resolver); runner.InstallFromConfig(packageConfigPath, settings); }
public static void ChocolateyInstall(this ICakeContext context, string packageId, ChocolateyInstallSettings settings) { if (context == null) { throw new ArgumentNullException("context"); } var resolver = new ChocolateyToolResolver(context.FileSystem, context.Environment); var runner = new ChocolateyInstaller(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, resolver); runner.Install(packageId, settings); }
public void ParseVersionFromHelpOutput() { var version = ChocolateyInstaller.ParseVersionFromHelpOutput(new List <string> { "Please run chocolatey /? or chocolatey help - chocolatey v0.9.8.23", "Reading environment variables from registry. Please wait... Done." }); Assert.AreEqual(new Version(0, 9, 8, 23), version); var missingVersion = ChocolateyInstaller.ParseVersionFromHelpOutput(new List <string> { "Please run chocolatey /? or chocolatey help", "Reading environment variables from registry. Please wait... Done." }); Assert.IsNull(missingVersion); }
public PackageManager(PowerShellRunner powerShellRunner, ChocolateyInstaller chocolateyInstaller) { this.powerShellRunner = powerShellRunner; this.chocolateyInstaller = chocolateyInstaller; }
protected override void RunTool() { var tool = new ChocolateyInstaller(FileSystem, Environment, ProcessRunner, Globber, Resolver); tool.InstallFromConfig(PackageConfigPath, Settings); }
public void InstallFromConfig() { var tool = new ChocolateyInstaller(FileSystem, Environment, ProcessRunner, Globber, ChocolateyToolResolver); tool.InstallFromConfig(PackageConfigPath, Settings); }
public void IsInstalled() { var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner()); Assert.IsTrue(chocolateyInstaller.IsInstalled()); }
public void GetInstallPath() { var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner()); Assert.AreEqual(@"C:\Chocolatey", chocolateyInstaller.GetInstallPath()); }
public UpdateChocolateyViewModel(IEventAggregator eventAggregator, ChocolateyInstaller chocolateyInstaller) { this.eventAggregator = eventAggregator; this.chocolateyInstaller = chocolateyInstaller; }
protected override void RunTool() { var tool = new ChocolateyInstaller(FileSystem, Environment, ProcessRunner, Tools, Resolver); tool.Install(PackageId, Settings); }
public InstallChocolateyViewModel(IEventAggregator eventAggregator, ChocolateyInstaller chocolateyInstaller) { this.eventAggregator = eventAggregator; this.chocolateyInstaller = chocolateyInstaller; }