├── ChocolateyExplorer.Website ├── robots.txt ├── googled89da873de4b424d.html ├── Content │ ├── chocolatey.ico │ ├── ChocolateyExplorerSearch.PNG │ ├── ChocolateyExplorerSourcesView.PNG │ ├── ChocolateyExplorerUpdateUninstall.PNG │ ├── ChocolateyExplorerInstalledPackagesView.PNG │ └── Style │ │ ├── theme.css.map │ │ ├── theme.min.css │ │ ├── theme.css │ │ └── theme.less ├── packages.config ├── sitemap.xml ├── Web.config ├── Web.Debug.config ├── Web.Release.config ├── Properties │ └── AssemblyInfo.cs ├── Index.cshtml └── ChocolateyExplorer.Website.csproj ├── .nuget ├── NuGet.exe ├── NuGet.Config └── NuGet.targets ├── ChocolateyExplorer.WPF ├── chocolatey.ico ├── GlobalSuppressions.cs ├── Asset │ └── Icons │ │ └── appbar.magnify.png ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── ChocolateyExplorer.WPF.Installer.ps1 ├── packages.config ├── Views │ ├── ErrorDialog.xaml │ ├── RemotePackages.xaml │ ├── RemotePackages.xaml.cs │ ├── ErrorDialog.xaml.cs │ ├── Console.xaml.cs │ ├── About.xaml.cs │ ├── Console.xaml │ ├── Packages.xaml.cs │ ├── Sources.xaml.cs │ ├── InstalledPackages.xaml.cs │ ├── InstallList.xaml.cs │ ├── About.xaml │ ├── Sources.xaml │ ├── InstalledPackages.xaml │ ├── InstallList.xaml │ └── Packages.xaml ├── ViewModel │ ├── AboutViewModel.cs │ ├── MainViewModel.cs │ ├── ConsoleViewModel.cs │ ├── ViewModelLocator.cs │ ├── ChocolateySourcesViewModel.cs │ ├── InstalledPackagesViewModel.cs │ └── InstallListViewModel.cs ├── MainWindow.xaml.cs ├── VisibilityHiddenConverter.cs ├── MainWindow.xaml ├── App.xaml.cs ├── ChocolateyExplorer.WPF.nuspec ├── App.xaml └── ChocolateyExplorer.WPF.csproj ├── Chocolatey.OData ├── GlobalSuppressions.cs ├── IChocolateyFeedFactory.cs ├── packages.config ├── IChocolateyFeed.cs ├── Service References │ └── Service │ │ ├── Reference.datasvcmap │ │ └── service.edmx ├── ChocolateyFeedFactory.cs ├── Properties │ └── AssemblyInfo.cs ├── Chocolatey.OData.csproj └── ChocolateyFeed.cs ├── Chocolatey.DomainModel ├── packages.config ├── ChocolateySource.cs ├── ChocolateyPackageVersion.cs ├── ChocolateyPackage.cs ├── Properties │ └── AssemblyInfo.cs └── Chocolatey.DomainModel.csproj ├── Chocolatey.Manager ├── ISetupScriptCreator.cs ├── ISourcesManager.cs ├── IInstalledPackagesManager.cs ├── IChocolateyInstaller.cs ├── Properties │ └── AssemblyInfo.cs ├── InstalledPackages.cs ├── SetupScriptCreator.cs ├── Sources.cs ├── Chocolatey.Manager.csproj └── Installer.cs ├── LICENSE.md ├── README.md ├── .gitignore └── ChocolateyExplorer.sln /ChocolateyExplorer.Website/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/.nuget/NuGet.exe -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/googled89da873de4b424d.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googled89da873de4b424d.html -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/chocolatey.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.WPF/chocolatey.ico -------------------------------------------------------------------------------- /Chocolatey.OData/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/Chocolatey.OData/GlobalSuppressions.cs -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.WPF/GlobalSuppressions.cs -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/chocolatey.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.Website/Content/chocolatey.ico -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Asset/Icons/appbar.magnify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.WPF/Asset/Icons/appbar.magnify.png -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/ChocolateyExplorerSearch.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.Website/Content/ChocolateyExplorerSearch.PNG -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chocolatey.DomainModel/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/ChocolateyExplorerSourcesView.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.Website/Content/ChocolateyExplorerSourcesView.PNG -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/ChocolateyExplorerUpdateUninstall.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.Website/Content/ChocolateyExplorerUpdateUninstall.PNG -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/ChocolateyExplorerInstalledPackagesView.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dibble-james/ChocolateyExplorer/master/ChocolateyExplorer.Website/Content/ChocolateyExplorerInstalledPackagesView.PNG -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Chocolatey.DomainModel/ChocolateySource.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.DomainModel 2 | { 3 | using System; 4 | 5 | public class ChocolateySource 6 | { 7 | public string Name { get; set; } 8 | 9 | public Uri Location { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chocolatey.OData/IChocolateyFeedFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.OData 2 | { 3 | using System; 4 | using System.Threading.Tasks; 5 | using Chocolatey.DomainModel; 6 | 7 | public interface IChocolateyFeedFactory 8 | { 9 | IChocolateyFeed Create(ChocolateySource source); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chocolatey.Manager/ISetupScriptCreator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Chocolatey.DomainModel; 3 | namespace Chocolatey.Manager 4 | { 5 | public interface ISetupScriptCreator 6 | { 7 | void CreateSeuptScript(IEnumerable packages, string saveLocation); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/ChocolateyExplorer.WPF.Installer.ps1: -------------------------------------------------------------------------------- 1 | $packageName = 'Chocolatey Explorer' 2 | $installerType = 'exe' 3 | $url = 'http://chocolatey-explorer.jdibble.co.uk/ChocolateyExplorer.exe' 4 | $silentArgs = '/i /s' 5 | $validExitCodes = @(0) 6 | 7 | Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chocolatey.Manager/ISourcesManager.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.Manager 2 | { 3 | using System.Collections.Generic; 4 | using Chocolatey.DomainModel; 5 | 6 | public interface ISourcesManager 7 | { 8 | IEnumerable GetSources(); 9 | 10 | void AddSource(ChocolateySource source); 11 | 12 | void RemoveSource(ChocolateySource source); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chocolatey.Manager/IInstalledPackagesManager.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.Manager 2 | { 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Chocolatey.DomainModel; 6 | 7 | public interface IInstalledPackagesManager 8 | { 9 | Task> RetrieveInstalledPackages(); 10 | 11 | Task> RetrieveInstalledPackages(bool forceRefresh); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chocolatey.OData/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | http://chocolatey-explorer.jdibble.co.uk/ 11 | 12 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/ErrorDialog.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/RemotePackages.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chocolatey.DomainModel/ChocolateyPackageVersion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Chocolatey.DomainModel 3 | { 4 | public class ChocolateyPackageVersion 5 | { 6 | public string Id { get; set; } 7 | 8 | public string Title { get; set; } 9 | 10 | public string Description { get; set; } 11 | 12 | public string Version { get; set; } 13 | 14 | public string ReleaseNotes { get; set; } 15 | 16 | public string Author { get; set; } 17 | 18 | public Uri ChocolateyLink { get; set; } 19 | 20 | public int DownloadCount { get; set; } 21 | 22 | public Uri ProjectLink { get; set; } 23 | 24 | public Uri IconLink { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/ViewModel/AboutViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace ChocolateyExplorer.WPF.ViewModel 2 | { 3 | using System; 4 | using System.Deployment.Application; 5 | using System.Reflection; 6 | using System.Windows; 7 | using GalaSoft.MvvmLight; 8 | 9 | public class AboutViewModel : ViewModelBase 10 | { 11 | public Version ApplicationVersion 12 | { 13 | get 14 | { 15 | if(ApplicationDeployment.IsNetworkDeployed) 16 | { 17 | return ApplicationDeployment.CurrentDeployment.CurrentVersion; 18 | } 19 | 20 | return Assembly.GetExecutingAssembly().GetName().Version; 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/RemotePackages.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace ChocolateyExplorer.WPF.Views 17 | { 18 | /// 19 | /// Interaction logic for RemotePackages.xaml 20 | /// 21 | public partial class RemotePackages : Page 22 | { 23 | public RemotePackages() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Chocolatey.Manager/IChocolateyInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.Manager 2 | { 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using Chocolatey.DomainModel; 9 | 10 | public interface IChocolateyInstaller 11 | { 12 | event Action OutputReceived; 13 | 14 | Task Install(ChocolateyPackageVersion package); 15 | 16 | Task Install(ChocolateyPackageVersion package, string arguments, CancellationToken cancellationToken); 17 | 18 | Task Install(ChocolateyPackageVersion package, string arguments); 19 | 20 | Task Uninstall(ChocolateyPackageVersion package); 21 | 22 | Task Update(ChocolateyPackageVersion package); 23 | 24 | Task UpdateAll(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using FirstFloor.ModernUI.Windows.Controls; 16 | 17 | namespace ChocolateyExplorer.WPF 18 | { 19 | /// 20 | /// Interaction logic for MainWindow.xaml 21 | /// 22 | public partial class MainWindow : ModernWindow 23 | { 24 | public MainWindow() 25 | { 26 | InitializeComponent(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Chocolatey.OData/IChocolateyFeed.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.OData 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using Chocolatey.DomainModel; 8 | 9 | public interface IChocolateyFeed 10 | { 11 | event Action> PageOfPackagesLoaded; 12 | 13 | ChocolateySource Source { get; } 14 | 15 | bool IsAnotherPageAvailable { get; } 16 | 17 | Task> LoadFirstPage(); 18 | 19 | Task> GetNextPage(); 20 | 21 | Task> SearchPackages(string criteria, CancellationToken cancellationToken); 22 | 23 | Task> GetPackageVersions(ChocolateyPackage package); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/ErrorDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace ChocolateyExplorer.WPF.Views 17 | { 18 | /// 19 | /// Interaction logic for ErrorDialog.xaml 20 | /// 21 | public partial class ErrorDialog : UserControl 22 | { 23 | public ErrorDialog(Exception exception) 24 | { 25 | this.DataContext = exception; 26 | 27 | InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Chocolatey.DomainModel/ChocolateyPackage.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.DomainModel 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Collections.ObjectModel; 6 | using System.Linq; 7 | 8 | public class ChocolateyPackage 9 | { 10 | public ChocolateyPackage() 11 | { 12 | this.Versions = new ObservableCollection(); 13 | } 14 | 15 | public string Id { get; set; } 16 | 17 | public string Title { get; set; } 18 | 19 | public Uri IconLink { get; set; } 20 | 21 | public bool IsInstalled { get; set; } 22 | 23 | public ObservableCollection Versions { get; set; } 24 | 25 | public ChocolateyPackageVersion LatestVersion 26 | { 27 | get 28 | { 29 | return this.Versions.OrderByDescending(pv => pv.Version).First(); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/Console.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace ChocolateyExplorer.WPF.ViewModel 17 | { 18 | /// 19 | /// Interaction logic for Console.xaml 20 | /// 21 | public partial class Console : UserControl 22 | { 23 | public Console() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | private void TextBox_TextChanged(object sender, TextChangedEventArgs e) 29 | { 30 | var textbox = sender as TextBox; 31 | 32 | textbox.ScrollToEnd(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/Style/theme.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["theme.less"],"names":[],"mappings":";;;;AAKA;AACA,CAAC;AACD,CAAC;EACC,WAAA;;;AAIF;AACA,YAAY;AACZ,YAAY;EACV,WAAA;EACA,iBAAA;;EACA,sBAAA;EACA,sBAAA;;;;;AAQF;AACA;EACE,YAAA;EACA,sBAAA;;AAEF;EACE,WAAA;EACA,kBAAA;EACA,yCAAA;;;AAIF;EACE,cAAA;EACA,WAAA;EAGA,sDAAA;EACQ,8CAAA;;AAEV;EACE,mBAAA;EACA,mBAAA;;AAEF;EACE,kBAAA;EACA,iBAAA;;;AAIF;EACE,aAAA;;AAGF;AAAI;AAAI;EACJ,WAAA;;AAGJ;EACI,WAAA;EACA,iBAAA;;;;;AAOJ;EACE,gBAAA;EACA,mBAAA;;AAGF,aAAc;EACZ,qBAAA;;AAEF,aAAc,KAAK;EACjB,iBAAA;;AAEF,aAAc,KAAK;EACjB,gBAAA;EACA,eAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;;EACA,gCAAA;EACA,oCAAA;;AAEF,aAAc,KAAK,IAAG;AACtB,aAAc,KAAK,IAAG;EACpB,6BAAA;EACA,4BAAA;EACA,8CAAA;;AAEF,aAAc,UAAU;AACxB,aAAc,UAAU,IAAG;AAC3B,aAAc,UAAU,IAAG;EACzB,WAAA;EACA,yBAAA;;AAaF,QAV0B;EACxB;IACE,WAAA;;EAEF;IACE,YAAA;;;;;;AASJ;EACE,eAAA;;AAEF,MAAO;EACL,kBAAA;EACA,iBAAA;;;;;AAQF;EACE,WAAA;;EACA,+BAAA;;;;;AAqBF,QAb0B;;EAExB;IACE,sBAAA;;;EAGF;EACA;EACA;IACE,WAAA;;;;AAUH,QANyB;EACxB;EACA;EACA;IACE,YAAA","file":"theme.css"} -------------------------------------------------------------------------------- /Chocolatey.OData/Service References/Service/Reference.datasvcmap: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/VisibilityHiddenConverter.cs: -------------------------------------------------------------------------------- 1 | namespace ChocolateyExplorer.WPF 2 | { 3 | using System; 4 | using System.Globalization; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | 8 | [ValueConversion(typeof(bool), typeof(Visibility))] 9 | public class VisibilityHiddenConverter : IValueConverter 10 | { 11 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | bool flag = false; 14 | if (value is bool) 15 | { 16 | flag = (bool)value; 17 | } 18 | else if (value is bool?) 19 | { 20 | bool? nullable = (bool?)value; 21 | flag = nullable.HasValue ? nullable.Value : false; 22 | } 23 | return (flag ? Visibility.Visible : Visibility.Hidden); 24 | } 25 | 26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 27 | { 28 | throw new System.NotImplementedException(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/About.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace ChocolateyExplorer.WPF.Views 18 | { 19 | /// 20 | /// Interaction logic for About.xaml 21 | /// 22 | public partial class About : Page 23 | { 24 | public About() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 30 | { 31 | var hyperlink = sender as Hyperlink; 32 | 33 | Process.Start(new ProcessStartInfo(hyperlink.NavigateUri.ToString())); 34 | e.Handled = true; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/ViewModel/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using GalaSoft.MvvmLight; 2 | 3 | namespace ChocolateyExplorer.WPF.ViewModel 4 | { 5 | /// 6 | /// This class contains properties that the main View can data bind to. 7 | /// 8 | /// Use the mvvminpc snippet to add bindable properties to this ViewModel. 9 | /// 10 | /// 11 | /// You can also use Blend to data bind with the tool's support. 12 | /// 13 | /// 14 | /// See http://www.galasoft.ch/mvvm 15 | /// 16 | /// 17 | public class MainViewModel : ViewModelBase 18 | { 19 | /// 20 | /// Initializes a new instance of the MainViewModel class. 21 | /// 22 | public MainViewModel() 23 | { 24 | ////if (IsInDesignMode) 25 | ////{ 26 | //// // Code runs in Blend --> create design time data. 27 | ////} 28 | ////else 29 | ////{ 30 | //// // Code runs "for real" 31 | ////} 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 James Dibble 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ChocolateyExplorer.WPF.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/Console.xaml: -------------------------------------------------------------------------------- 1 | 9 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/Packages.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace ChocolateyExplorer.WPF.Views 18 | { 19 | /// 20 | /// Interaction logic for Packages.xaml 21 | /// 22 | public partial class Packages : UserControl 23 | { 24 | public Packages() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 30 | { 31 | var hyperlink = sender as Hyperlink; 32 | 33 | Process.Start(new ProcessStartInfo(hyperlink.NavigateUri.ToString())); 34 | e.Handled = true; 35 | } 36 | 37 | private void TreeViewItem_OnItemSelected(object sender, RoutedEventArgs e) 38 | { 39 | var treeViewItem = e.OriginalSource as TreeViewItem; 40 | 41 | treeViewItem.IsExpanded = true; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/Sources.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using ChocolateyExplorer.WPF.ViewModel; 16 | 17 | namespace ChocolateyExplorer.WPF.Views 18 | { 19 | /// 20 | /// Interaction logic for Sources.xaml 21 | /// 22 | public partial class Sources : UserControl 23 | { 24 | private bool _sourcesLoaded; 25 | 26 | public Sources() 27 | { 28 | this.InitializeComponent(); 29 | 30 | this._sourcesLoaded = false; 31 | 32 | this.Loaded += Sources_Loaded; 33 | } 34 | 35 | void Sources_Loaded(object sender, RoutedEventArgs e) 36 | { 37 | if(this._sourcesLoaded) 38 | { 39 | return; 40 | } 41 | 42 | var context = this.DataContext as ChocolateySourcesViewModel; 43 | 44 | context.PopulateSources(); 45 | 46 | this._sourcesLoaded = true; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/InstalledPackages.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using ChocolateyExplorer.WPF.ViewModel; 16 | 17 | namespace ChocolateyExplorer.WPF.Views 18 | { 19 | /// 20 | /// Interaction logic for InstalledPackages.xaml 21 | /// 22 | public partial class InstalledPackages : UserControl 23 | { 24 | private bool _havePackagesBeenLoaded; 25 | 26 | public InstalledPackages() 27 | { 28 | this._havePackagesBeenLoaded = false; 29 | 30 | InitializeComponent(); 31 | 32 | this.Loaded += async (a, b) => await this.LoadPackages(); 33 | } 34 | 35 | private async Task LoadPackages() 36 | { 37 | if(this._havePackagesBeenLoaded) 38 | { 39 | return; 40 | } 41 | 42 | await (this.DataContext as InstalledPackagesViewModel).RefreshPackages(); 43 | 44 | this._havePackagesBeenLoaded = true; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Chocolatey.OData/ChocolateyFeedFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.OData 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Data.Services.Client; 6 | using System.Threading.Tasks; 7 | using Chocolatey.DomainModel; 8 | using Chocolatey.Manager; 9 | using Chocolatey.OData.Service; 10 | 11 | public class ChocolateyFeedFactory : IChocolateyFeedFactory 12 | { 13 | private readonly IDictionary _feedCache; 14 | private readonly IInstalledPackagesManager _installedPackages; 15 | 16 | 17 | public ChocolateyFeedFactory(IInstalledPackagesManager installedPackages) 18 | { 19 | this._feedCache = new Dictionary(); 20 | this._installedPackages = installedPackages; 21 | } 22 | 23 | public IChocolateyFeed Create(ChocolateySource source) 24 | { 25 | if(this._feedCache.ContainsKey(source)) 26 | { 27 | return this._feedCache[source]; 28 | } 29 | 30 | var client = new ChocolateyFeedClient(source.Location) 31 | { 32 | IgnoreMissingProperties = true, 33 | MergeOption = MergeOption.NoTracking 34 | }; 35 | 36 | var feed = new ChocolateyFeed(client, source, this._installedPackages); 37 | 38 | this._feedCache.Add(source, feed); 39 | 40 | return feed; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Content/Style/theme.min.css: -------------------------------------------------------------------------------- 1 | a,a:focus,a:hover{color:#fff}.btn-default,.btn-default:hover,.btn-default:focus{color:#333;text-shadow:none;background-color:#fff;border:1px solid #fff}html,body{height:100%;background-color:#333}body{color:#fff;text-align:center;text-shadow:0 1px 3px rgba(0,0,0,.5)}.site-wrapper{display:table;width:100%;-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.5);box-shadow:inset 0 0 100px rgba(0,0,0,.5)}.site-wrapper-inner{display:table-cell;vertical-align:top}.cover-container{margin-right:auto;margin-left:auto}.inner{padding:30px}h1,h2,h3{color:#ddd}.panel-body{color:#444;text-shadow:none}.masthead-brand{margin-top:10px;margin-bottom:10px}.masthead-nav>li{display:inline-block}.masthead-nav>li+li{margin-left:20px}.masthead-nav>li>a{padding-right:0;padding-left:0;font-size:16px;font-weight:bold;color:#fff;color:rgba(255,255,255,.75);border-bottom:2px solid transparent}.masthead-nav>li>a:hover,.masthead-nav>li>a:focus{background-color:transparent;border-bottom-color:#a9a9a9;border-bottom-color:rgba(255,255,255,.25)}.masthead-nav>.active>a,.masthead-nav>.active>a:hover,.masthead-nav>.active>a:focus{color:#fff;border-bottom-color:#fff}@media(min-width:768px){.masthead-brand{float:left}.masthead-nav{float:right}}.cover{padding:0 20px}.cover .btn-lg{padding:10px 20px;font-weight:bold}.mastfoot{color:#999;color:rgba(255,255,255,.5)}@media(min-width:768px){.site-wrapper-inner{vertical-align:middle}.masthead,.mastfoot,.cover-container{width:100%}}@media(min-width:992px){.masthead,.mastfoot,.cover-container{width:700px}} -------------------------------------------------------------------------------- /ChocolateyExplorer.Website/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ChocolateyExplorer.Website")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ChocolateyExplorer.Website")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("65ae4e62-da9d-49ef-9ab6-536f2f1b2d1d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Chocolatey.OData/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Chocolatey.OData")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Chocolatey.OData")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("99fd888c-0cde-4993-b407-ab250556cd20")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Chocolatey.Manager/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Chocolatey.Manager")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Chocolatey.Manager")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fe7cd848-1da6-4df7-bed0-f84f4ed02eb2")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Chocolatey.DomainModel/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Chocolatey.DomainModel")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Chocolatey.DomainModel")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1ef5e26d-edee-440d-9895-7fa8429a4829")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/InstallList.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using ChocolateyExplorer.WPF.ViewModel; 16 | using Microsoft.Win32; 17 | 18 | namespace ChocolateyExplorer.WPF.Views 19 | { 20 | /// 21 | /// Interaction logic for InstallList.xaml 22 | /// 23 | public partial class InstallList : Page 24 | { 25 | public InstallList() 26 | { 27 | InitializeComponent(); 28 | } 29 | 30 | private void SaveSetupScriptClick(object sender, RoutedEventArgs e) 31 | { 32 | var viewModel = this.DataContext as InstallListViewModel; 33 | 34 | var saveFileDialog = new SaveFileDialog 35 | { 36 | DefaultExt = "ps1", 37 | Filter = "PowerShell Script|*.ps1", 38 | Title = "Save Setup Script" 39 | }; 40 | 41 | if (saveFileDialog.ShowDialog().Value) 42 | { 43 | viewModel.SetupScriptSaveLocation = saveFileDialog.FileName; 44 | } 45 | else 46 | { 47 | viewModel.SetupScriptSaveLocation = null; 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/ViewModel/ConsoleViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace ChocolateyExplorer.WPF.ViewModel 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Windows.Input; 7 | using GalaSoft.MvvmLight; 8 | using GalaSoft.MvvmLight.Command; 9 | 10 | public class ConsoleViewModel : ViewModelBase 11 | { 12 | private readonly IList _consoleLines; 13 | private string _consoleOutput; 14 | 15 | public ConsoleViewModel() 16 | { 17 | this._consoleLines = new List(); 18 | 19 | this._consoleOutput = string.Empty; 20 | 21 | this.ClearConsoleCommand = new RelayCommand(this.ClearConsole); 22 | } 23 | 24 | public ICommand ClearConsoleCommand { get; private set; } 25 | 26 | public string ConsoleOutput 27 | { 28 | get 29 | { 30 | if (!this._consoleLines.Any()) 31 | { 32 | return string.Empty; 33 | } 34 | 35 | return this._consoleLines.Aggregate((current, next) => current += Environment.NewLine + next); 36 | } 37 | } 38 | 39 | public void AddConsoleLine(string newLine, params object[] arguments) 40 | { 41 | this._consoleLines.Add(string.Format(newLine, arguments)); 42 | 43 | this.RaisePropertyChanged(() => this.ConsoleOutput); 44 | } 45 | 46 | private void ClearConsole() 47 | { 48 | this._consoleLines.Clear(); 49 | 50 | this.RaisePropertyChanged(() => this.ConsoleOutput); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Chocolatey.Manager/InstalledPackages.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.Manager 2 | { 3 | using System.Collections.Generic; 4 | using System.Management.Automation; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using Chocolatey.DomainModel; 8 | 9 | public class InstalledPackages : IInstalledPackagesManager 10 | { 11 | private const string listLocalCommand = @"clist -lo"; 12 | 13 | private IEnumerable _packageCache; 14 | 15 | public async Task> RetrieveInstalledPackages() 16 | { 17 | return await this.RetrieveInstalledPackages(false); 18 | } 19 | 20 | public async Task> RetrieveInstalledPackages(bool forceRefresh) 21 | { 22 | if(this._packageCache != null && !forceRefresh) 23 | { 24 | return this._packageCache; 25 | } 26 | 27 | using (var powershell = PowerShell.Create()) 28 | { 29 | powershell.AddScript(listLocalCommand); 30 | 31 | var result = await Task.Factory.StartNew(() => powershell.Invoke()); 32 | 33 | var installedPackages = result.Select(r => r.ToString()).Select(ParseFromOutput); 34 | 35 | this._packageCache = installedPackages; 36 | 37 | return installedPackages; 38 | } 39 | } 40 | 41 | private static ChocolateyPackageVersion ParseFromOutput(string output) 42 | { 43 | var split = output.Split(' '); 44 | 45 | var packageName = split.ElementAt(0); 46 | var packageVersion = split.ElementAt(1); 47 | 48 | return new ChocolateyPackageVersion { Id = packageName, Version = packageVersion }; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Chocolatey.Manager/SetupScriptCreator.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.Manager 2 | { 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using Chocolatey.DomainModel; 7 | 8 | public class SetupScriptCreator : ISetupScriptCreator 9 | { 10 | private const string InstallChocolateyCommand = @"iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"; 11 | 12 | private readonly ISourcesManager _sources; 13 | 14 | public SetupScriptCreator(ISourcesManager sources) 15 | { 16 | this._sources = sources; 17 | } 18 | 19 | public void CreateSeuptScript(IEnumerable packages, string saveLocation) 20 | { 21 | var fileContents = new List 22 | { 23 | InstallChocolateyCommand 24 | }; 25 | 26 | fileContents.AddRange(this._sources.GetSources().Select(this.CreateAddSourceCommand)); 27 | 28 | fileContents.AddRange(packages.Select(this.CreateInstallCommand)); 29 | 30 | File.WriteAllLines(saveLocation, fileContents); 31 | } 32 | 33 | private string CreateInstallCommand(ChocolateyPackageVersion package) 34 | { 35 | const string installCommandTemplate = @"cinst '{0}' -version '{1}'"; 36 | 37 | var installCommand = string.Format(installCommandTemplate, package.Id, package.Version); 38 | 39 | return installCommand; 40 | } 41 | 42 | private string CreateAddSourceCommand(ChocolateySource source) 43 | { 44 | const string addSourceCommandTemplate = @"choco sources add -name '{0}' -source '{1}'"; 45 | 46 | var addSourceCommand = string.Format(addSourceCommandTemplate, source.Name, source.Location); 47 | 48 | return addSourceCommand; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Chocolatey.Manager/Sources.cs: -------------------------------------------------------------------------------- 1 | namespace Chocolatey.Manager 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Xml.Linq; 8 | using Chocolatey.DomainModel; 9 | 10 | public class Sources : ISourcesManager 11 | { 12 | private static string ConfigurationLocation 13 | { 14 | get 15 | { 16 | return Environment.ExpandEnvironmentVariables(@"%SystemDrive%\ProgramData\chocolatey\chocolateyinstall\chocolatey.config"); 17 | } 18 | } 19 | 20 | public IEnumerable GetSources() 21 | { 22 | if (!File.Exists(ConfigurationLocation)) 23 | { 24 | throw new InvalidOperationException("No Chocolatey sources directory exists in the default location"); 25 | } 26 | 27 | var config = XDocument.Load(ConfigurationLocation); 28 | 29 | var sources = config.Descendants("source").Select(s => new ChocolateySource 30 | { 31 | Name = s.Attribute("id").Value, 32 | Location = new Uri(s.Attribute("value").Value) 33 | }); 34 | 35 | return sources; 36 | } 37 | 38 | 39 | public void AddSource(ChocolateySource source) 40 | { 41 | this.RemoveSource(source); 42 | 43 | var config = XDocument.Load(ConfigurationLocation); 44 | 45 | var newElement = new XElement("source", new XAttribute("id", source.Name), new XAttribute("value", source.Location.AbsoluteUri)); 46 | 47 | config.Descendants("sources").FirstOrDefault().Add(newElement); 48 | 49 | config.Save(ConfigurationLocation); 50 | } 51 | 52 | 53 | public void RemoveSource(ChocolateySource source) 54 | { 55 | var config = XDocument.Load(ConfigurationLocation); 56 | 57 | config.Descendants("source").Where(e => e.Attribute("id").Value == source.Name).Remove(); 58 | 59 | config.Save(ConfigurationLocation); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/About.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 14 | 15 | 22 | 23 | 30 | 31 | 38 | 40 | 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Chocolatey Explorer 2 | ================== 3 | [![Build status](https://ci.appveyor.com/api/projects/status/r3h6ou8b8doydef2)](https://ci.appveyor.com/project/james-dibble/chocolateyexplorer) 4 | 5 | A little GUI for reading Chocolatey feeds and installing packages 6 | 7 | How to Install 8 | ------------------ 9 | Chocolatey Explorer is distributed via ClickOnce. Get your copy [here](http://chocolatey-explorer.jdibble.co.uk/ChocolateyExplorer.exe). Please raise any bugs [here](https://github.com/james-dibble/ChocolateyExplorer/issues). The application is currently not signed so Windows will tell you not to trust it. 10 | 11 | Changelog 12 | --------- 13 | ### 0.2.2.110 14 | [Realease Notes](https://github.com/james-dibble/ChocolateyExplorer/milestones/0.2.2.0) 15 | 16 | + Improved paging - Loads more packages at once 17 | + Support for a greater number of HTTP based Chocolatey feeds 18 | + Only load versions of packages that are of interest 19 | + Create an install list and export it as a setup script 20 | 21 | ### 0.2.1.106 22 | + Display the packages icon if one exists in the package menu 23 | + Indicate a package that is already installed 24 | 25 | ### 0.2.1.100 26 | + First complete release 27 | + Default to latest package when selecting one from the tree view 28 | + Ability to clear the console output 29 | 30 | ### 0.1.0.99 31 | + Install package with arguments 32 | 33 | ### 0.1.0.98 34 | + Make searching a cancellable operation 35 | 36 | ### 0.1.0.97 37 | + Improving searching functionality 38 | + Bug fixes 39 | 40 | ### 0.1.0.93 41 | + Minor performance improvements when loading packages from OData feeds 42 | + When exploring a feed, packages are loaded in pages. No more load all as there 43 | are too many on Chocolatey. 44 | + Search results can be cleared when completed. 45 | + Bug fixes 46 | 47 | ### 0.1.0.61 48 | + Themed with Modern UI 49 | + Pacakges can be updated and uninstalled 50 | 51 | ### 0.1.0.4 52 | + Add custom source (must be the OData address but can be based upon a Nuget feed) 53 | + Search a source 54 | + Load all of the packages from a source 55 | + View package information 56 | 57 | Future Releases 58 | --------------- 59 | + Detect whether Chocolatey is installed. If not, give user option install it. 60 | + Better paging functionality; background loading of packages? 61 | + Parse and display release notes and descriptions as Markdown 62 | + Sign the manifests so installer and applicaiton are trusted 63 | + Authenticated feeds -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("ChocolateyExplorer.WPF")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("ChocolateyExplorer.WPF")] 15 | [assembly: AssemblyCopyright("Copyright © 2014")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace ChocolateyExplorer.WPF 2 | { 3 | using System; 4 | using System.Deployment.Application; 5 | using System.Diagnostics; 6 | using System.Reflection; 7 | using System.Security.Principal; 8 | using System.Windows; 9 | 10 | using ChocolateyExplorer.WPF.Views; 11 | 12 | using FirstFloor.ModernUI.Windows.Controls; 13 | 14 | /// 15 | /// Interaction logic for App.xaml 16 | /// 17 | public partial class App : Application 18 | { 19 | public App() 20 | { 21 | this.DispatcherUnhandledException += this.App_DispatcherUnhandledException; 22 | this.Startup += this.Application_Startup; 23 | } 24 | 25 | void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) 26 | { 27 | var messageBox = new ModernDialog 28 | { 29 | Title = "Woops", 30 | Content = new ErrorDialog(e.Exception) 31 | }; 32 | 33 | messageBox.ShowDialog(); 34 | 35 | e.Handled = true; 36 | } 37 | 38 | private bool IsRunAsAdministrator() 39 | { 40 | var wi = WindowsIdentity.GetCurrent(); 41 | var wp = new WindowsPrincipal(wi); 42 | 43 | return wp.IsInRole(WindowsBuiltInRole.Administrator); 44 | } 45 | 46 | private void Application_Startup(object sender, StartupEventArgs e) 47 | { 48 | if (!IsRunAsAdministrator()) 49 | { 50 | var processInfo = new ProcessStartInfo(Assembly.GetExecutingAssembly().CodeBase) 51 | { 52 | UseShellExecute = true, 53 | Verb = "runas" 54 | }; 55 | 56 | try 57 | { 58 | Process.Start(processInfo); 59 | } 60 | catch 61 | { 62 | var messageBox = new ModernDialog 63 | { 64 | Title = "Woops", 65 | Content = new ErrorDialog(new InvalidOperationException("Chocolatey Explorer must be run as an administrator.")) 66 | }; 67 | 68 | messageBox.ShowDialog(); 69 | } 70 | 71 | this.Shutdown(); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ChocolateyExplorer.WPF.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ChocolateyExplorer.WPF.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/ChocolateyExplorer.WPF.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ChocolateyExplorer 5 | $version$ 6 | Chocolatey Explorer 7 | James Dibble 8 | James Dibble 9 | https://github.com/james-dibble/ChocolateyExplorer/blob/master/LICENSE.md 10 | http://chocolatey-explorer.jdibble.co.uk/ 11 | http://chocolatey-explorer.jdibble.co.uk/content/chocolatey.ico 12 | false 13 | Chocolatey Explorer is an application to make Chocolatey that little bit more awesome by giving you control over it's basic functions without having to break out PowerShell. 14 | 15 | ### 0.2.2.110 16 | [Realease Notes](https://github.com/james-dibble/ChocolateyExplorer/milestones/0.2.2.0) 17 | 18 | + Improved paging - Loads more packages at once 19 | + Support for a greater number of HTTP based Chocolatey feeds 20 | + Only load versions of packages that are of interest 21 | + Create an install list and export it as a setup script 22 | 23 | ### 0.2.1.106 24 | + Display the packages icon if one exists in the package menu 25 | + Indicate a package that is already installed 26 | 27 | ### 0.2.1.100 28 | + First complete release 29 | + Default to latest package when selecting one from the tree view 30 | + Ability to clear the console output 31 | 32 | ### 0.1.0.99 33 | + Install package with arguments 34 | 35 | ### 0.1.0.98 36 | + Make searching a cancellable operation 37 | 38 | ### 0.1.0.97 39 | + Improving searching functionality 40 | + Bug fixes 41 | 42 | ### 0.1.0.93 43 | + Minor performance improvements when loading packages from OData feeds 44 | + When exploring a feed, packages are loaded in pages. No more load all as there 45 | are too many on Chocolatey. 46 | + Search results can be cleared when completed. 47 | + Bug fixes 48 | 49 | ### 0.1.0.61 50 | + Themed with Modern UI 51 | + Pacakges can be updated and uninstalled 52 | 53 | ### 0.1.0.4 54 | + Add custom source (must be the OData address but can be based upon a Nuget feed) 55 | + Search a source 56 | + Load all of the packages from a source 57 | + View package information 58 | 59 | Future Releases 60 | --------------- 61 | + Detect whether Chocolatey is installed. If not, give user option install it. 62 | + Better paging functionality; background loading of packages? 63 | + Parse and display release notes and descriptions as Markdown 64 | + Sign the manifests so installer and applicaiton are trusted 65 | + Authenticated feeds 66 | 67 | Copyright (c) 2014 James Dibble. All rights reserved. 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ChocolateyExplorer.WPF/Views/Sources.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 27 |