Пример #1
0
    public async void Install()
    {
        var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());
        await chocolateyInstaller.InstallChocolatey(null, null);

        Assert.IsTrue(chocolateyInstaller.IsInstalled());
    }
Пример #2
0
    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);
 }
Пример #4
0
    public async void GetVersionFromRawFile()
    {
        var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());
        var installVersion      = await chocolateyInstaller.GetVersionFromRawFile();

        Debug.WriteLine(installVersion);
        Assert.IsNotNull(installVersion);
    }
Пример #5
0
 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;
 }
Пример #7
0
    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;
 }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
    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);
    }
Пример #12
0
 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);
        }
Пример #14
0
        public void InstallFromConfig()
        {
            var tool = new ChocolateyInstaller(FileSystem, Environment, ProcessRunner, Globber, ChocolateyToolResolver);

            tool.InstallFromConfig(PackageConfigPath, Settings);
        }
 public async void Install()
 {
     var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());
     await chocolateyInstaller.InstallChocolatey(null, null);
     Assert.IsTrue(chocolateyInstaller.IsInstalled());
 }
 public void IsInstalled()
 {
     var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());
     Assert.IsTrue(chocolateyInstaller.IsInstalled());
 }
Пример #17
0
    public void IsInstalled()
    {
        var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());

        Assert.IsTrue(chocolateyInstaller.IsInstalled());
    }
Пример #18
0
    public void GetInstallPath()
    {
        var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());

        Assert.AreEqual(@"C:\Chocolatey", chocolateyInstaller.GetInstallPath());
    }
 public void GetInstallPath()
 {
     var chocolateyInstaller = new ChocolateyInstaller(new ProcessRunner(), new PowerShellRunner());
     Assert.AreEqual(@"C:\Chocolatey", chocolateyInstaller.GetInstallPath());
 }
Пример #20
0
 public UpdateChocolateyViewModel(IEventAggregator eventAggregator, ChocolateyInstaller chocolateyInstaller)
 {
     this.eventAggregator     = eventAggregator;
     this.chocolateyInstaller = chocolateyInstaller;
 }
Пример #21
0
 public PackageManager(PowerShellRunner powerShellRunner, ChocolateyInstaller chocolateyInstaller)
 {
     this.powerShellRunner    = powerShellRunner;
     this.chocolateyInstaller = chocolateyInstaller;
 }
Пример #22
0
        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;
 }