diff --git a/GitVersion.yml b/GitVersion.yml
index b2e5e8357..ddba28c28 100644
--- a/GitVersion.yml
+++ b/GitVersion.yml
@@ -1 +1 @@
-next-version: 1.0.0
\ No newline at end of file
+next-version: 2.0.0
\ No newline at end of file
diff --git a/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj b/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj
index 016ce723e..dc0a89cef 100644
--- a/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj
+++ b/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj
@@ -67,10 +67,8 @@
..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.Core.dll
-
- ..\packages\chocolatey.lib.1.0.0\lib\chocolatey.dll
- False
- False
+
+ ..\packages\chocolatey.lib.2.0.0-alpha-20230124\lib\net48\chocolatey.dll
..\packages\ControlzEx.4.4.0\lib\net462\ControlzEx.dll
diff --git a/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs b/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs
index 39397d53c..8dde38b41 100644
--- a/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs
+++ b/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs
@@ -11,6 +11,7 @@
using System.Threading.Tasks;
using AutoMapper;
using chocolatey;
+using chocolatey.infrastructure.app;
using chocolatey.infrastructure.app.configuration;
using chocolatey.infrastructure.app.domain;
using chocolatey.infrastructure.app.nuget;
@@ -22,7 +23,8 @@
using ChocolateyGui.Common.Services;
using ChocolateyGui.Common.Utilities;
using Microsoft.VisualStudio.Threading;
-using NuGet;
+using NuGet.Protocol.Core.Types;
+using NuGet.Versioning;
using ChocolateySource = ChocolateyGui.Common.Models.ChocolateySource;
using IFileSystem = chocolatey.infrastructure.filesystem.IFileSystem;
@@ -30,6 +32,8 @@ namespace ChocolateyGui.Common.Windows.Services
{
using ChocolateySource = ChocolateySource;
using ILogger = Serilog.ILogger;
+ using LogLevel = Models.LogLevel;
+ using LogMessage = Models.LogMessage;
public class ChocolateyService : IChocolateyService
{
@@ -141,7 +145,7 @@ public async Task> GetOutdatedPackages(bool inclu
var results = packages
.Where(p => !p.Value.Inconclusive)
.Select(p => new OutdatedPackage
- { Id = p.Value.Package.Id, VersionString = p.Value.Package.Version.ToNormalizedString() })
+ { Id = p.Value.Name, VersionString = p.Value.Version })
.ToArray();
try
@@ -213,7 +217,9 @@ public async Task InstallPackage(
config.ApplyInstallArgumentsToDependencies = advancedInstallOptions.ApplyInstallArgumentsToDependencies;
config.ApplyPackageParametersToDependencies = advancedInstallOptions.ApplyPackageParametersToDependencies;
config.AllowDowngrade = advancedInstallOptions.AllowDowngrade;
+#pragma warning disable CS0618 // Type or member is obsolete
config.AllowMultipleVersions = advancedInstallOptions.AllowMultipleVersions;
+#pragma warning restore CS0618 // Type or member is obsolete
config.IgnoreDependencies = advancedInstallOptions.IgnoreDependencies;
config.ForceDependencies = advancedInstallOptions.ForceDependencies;
config.SkipPackageInstallProvider = advancedInstallOptions.SkipPowerShell;
@@ -312,9 +318,11 @@ public async Task GetByVersionAndIdAsync(string id, string version, boo
});
var chocoConfig = _choco.GetConfiguration();
- var nugetLogger = _choco.Container().GetInstance();
- var semvar = new SemanticVersion(version);
- var nugetPackage = await Task.Run(() => (NugetList.GetPackages(chocoConfig, nugetLogger) as IQueryable).FirstOrDefault(p => p.Version == semvar));
+ var nugetLogger = _choco.Container().GetInstance();
+ var origVer = chocoConfig.Version;
+ chocoConfig.Version = version;
+ var nugetPackage = await Task.Run(() => (NugetList.GetPackages(chocoConfig, nugetLogger, _fileSystem) as IQueryable).FirstOrDefault());
+ chocoConfig.Version = origVer;
if (nugetPackage == null)
{
throw new Exception("No Package Found");
@@ -323,7 +331,7 @@ public async Task GetByVersionAndIdAsync(string id, string version, boo
return GetMappedPackage(_choco, new PackageResult(nugetPackage, null, chocoConfig.Sources), _mapper);
}
- public async Task> GetAvailableVersionsForPackageIdAsync(string id, int page, int pageSize, bool includePreRelease)
+ public async Task> GetAvailableVersionsForPackageIdAsync(string id, int page, int pageSize, bool includePreRelease)
{
_choco.Set(
config =>
@@ -343,7 +351,7 @@ public async Task> GetAvailableVersionsForPackageIdAsync(s
});
var chocoConfig = _choco.GetConfiguration();
var packages = await _choco.ListAsync();
- return packages.Select(p => new SemanticVersion(p.Version)).OrderByDescending(p => p.Version).ToList();
+ return packages.Select(p => NuGetVersion.Parse(p.Version)).OrderByDescending(p => p.Version).ToList();
}
public async Task UninstallPackage(string id, string version, bool force = false)
@@ -398,6 +406,7 @@ public async Task PinPackage(string id, string version)
config.PinCommand.Command = PinCommandType.add;
config.PinCommand.Name = id;
config.Version = version;
+ config.Sources = ApplicationParameters.PackagesLocation;
});
try
@@ -424,6 +433,7 @@ public async Task UnpinPackage(string id, string version
config.PinCommand.Command = PinCommandType.remove;
config.PinCommand.Name = id;
config.Version = version;
+ config.Sources = ApplicationParameters.PackagesLocation;
});
try
{
@@ -619,26 +629,25 @@ public async Task ExportPackages(string exportFilePath, bool includeVersionNumbe
private static Package GetMappedPackage(GetChocolatey choco, PackageResult package, IMapper mapper, bool forceInstalled = false)
{
- var mappedPackage = package == null ? null : mapper.Map(package.Package);
+ var mappedPackage = package == null ? null : mapper.Map(package.SearchMetadata);
if (mappedPackage != null)
{
+ if (package.PackageMetadata != null)
+ {
+ mappedPackage.ReleaseNotes = package.PackageMetadata.ReleaseNotes;
+ mappedPackage.Language = package.PackageMetadata.Language;
+ mappedPackage.Copyright = package.PackageMetadata.Copyright;
+ }
+
var packageInfoService = choco.Container().GetInstance();
- var packageInfo = packageInfoService.get_package_information(package.Package);
+ var packageInfo = packageInfoService.get_package_information(package.PackageMetadata);
mappedPackage.IsPinned = packageInfo.IsPinned;
mappedPackage.IsInstalled = !string.IsNullOrWhiteSpace(package.InstallLocation) || forceInstalled;
+#pragma warning disable CS0618 // Type or member is obsolete
mappedPackage.IsSideBySide = packageInfo.IsSideBySide;
+#pragma warning restore CS0618 // Type or member is obsolete
- mappedPackage.IsPrerelease = !string.IsNullOrWhiteSpace(mappedPackage.Version.SpecialVersion);
-
- // Add a sanity check here for pre-release packages
- // By default, pre-release packages are marked as IsLatestVersion = false, however, IsLatestVersion is
- // what is used to show/hide the Out of Date message in the UI. In these cases, if it is a pre-release
- // mark IsLatestVersion as true, and then the outcome of the call to choco outdated will correct whether
- // it is actually Out of Date or not
- if (mappedPackage.IsPrerelease && mappedPackage.IsAbsoluteLatestVersion && !mappedPackage.IsLatestVersion)
- {
- mappedPackage.IsLatestVersion = true;
- }
+ mappedPackage.IsPrerelease = mappedPackage.Version.IsPrerelease;
}
return mappedPackage;
diff --git a/Source/ChocolateyGui.Common.Windows/Startup/ChocolateyGuiModule.cs b/Source/ChocolateyGui.Common.Windows/Startup/ChocolateyGuiModule.cs
index e19bcf522..ec8f01a30 100644
--- a/Source/ChocolateyGui.Common.Windows/Startup/ChocolateyGuiModule.cs
+++ b/Source/ChocolateyGui.Common.Windows/Startup/ChocolateyGuiModule.cs
@@ -29,7 +29,7 @@
using ChocolateyGui.Common.Windows.ViewModels;
using ChocolateyGui.Common.Windows.Views;
using LiteDB;
-using NuGet;
+using NuGet.Protocol.Core.Types;
using ChocolateySource = chocolatey.infrastructure.app.configuration.ChocolateySource;
using Environment = System.Environment;
using PackageViewModel = ChocolateyGui.Common.Windows.ViewModels.Items.PackageViewModel;
@@ -94,10 +94,11 @@ protected override void Load(ContainerBuilder builder)
config.CreateMap()
.ForMember(vm => vm.IsInstalled, options => options.Ignore());
- config.CreateMap()
+ config.CreateMap()
+ .ForMember(dest => dest.Version, opt => opt.MapFrom(src => src.Identity.Version))
+ .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Identity.Id))
.ForMember(dest => dest.Authors, opt => opt.MapFrom(src => src.Authors.Split(',')))
.ForMember(dest => dest.Owners, opt => opt.MapFrom(src => src.Owners.Split(',')));
- config.CreateMap();
config.CreateMap();
config.CreateMap();
diff --git a/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs b/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs
index 4901c4aca..fab198a99 100644
--- a/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs
+++ b/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs
@@ -18,7 +18,7 @@
using ChocolateyGui.Common.Windows.Commands;
using ChocolateyGui.Common.Windows.Controls.Dialogs;
using ChocolateyGui.Common.Windows.Utilities;
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Windows.ViewModels
{
@@ -60,7 +60,7 @@ public class AdvancedInstallViewModel : ObservableBase, IClosableChildWindow { "md5", "sha1", "sha256", "sha512" };
InstallCommand = new RelayCommand(
o => { Close?.Invoke(this); },
- o => string.IsNullOrEmpty(SelectedVersion) || SelectedVersion == Resources.AdvancedChocolateyDialog_LatestVersion || SemanticVersion.TryParse(SelectedVersion, out _));
+ o => string.IsNullOrEmpty(SelectedVersion) || SelectedVersion == Resources.AdvancedChocolateyDialog_LatestVersion || NuGetVersion.TryParse(SelectedVersion, out _));
CancelCommand = new RelayCommand(
o =>
{
@@ -437,11 +437,11 @@ private void SetDefaults()
private void OnSelectedVersionChanged(string stringVersion)
{
- SemanticVersion version;
+ NuGetVersion version;
- if (SemanticVersion.TryParse(stringVersion, out version))
+ if (NuGetVersion.TryParse(stringVersion, out version))
{
- PreRelease = !string.IsNullOrEmpty(version.SpecialVersion);
+ PreRelease = version.IsPrerelease;
}
}
diff --git a/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs b/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs
index 92a5ead76..648a8506e 100644
--- a/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs
+++ b/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs
@@ -20,7 +20,7 @@
using ChocolateyGui.Common.Windows.Services;
using ChocolateyGui.Common.Windows.Views;
using MahApps.Metro.Controls.Dialogs;
-using NuGet;
+using NuGet.Versioning;
using Action = System.Action;
using MemoryCache = System.Runtime.Caching.MemoryCache;
@@ -68,7 +68,7 @@ public class PackageViewModel :
private string _id;
- private bool _isAbsoluteLatestVersion;
+ private bool _isOutdated;
private bool _isInstalled;
@@ -76,15 +76,13 @@ public class PackageViewModel :
private bool _isSideBySide;
- private bool _isLatestVersion;
-
private bool _isPrerelease;
private string _language;
private DateTime _lastUpdated;
- private SemanticVersion _latestVersion;
+ private NuGetVersion _latestVersion;
private string _licenseUrl = string.Empty;
@@ -114,7 +112,7 @@ public class PackageViewModel :
private string _title;
- private SemanticVersion _version;
+ private NuGetVersion _version;
private int _versionDownloadCount;
@@ -173,7 +171,7 @@ public string[] Authors
public bool IsUninstallAllowed => _allowedCommandsService.IsUninstallCommandAllowed;
- public bool CanUpdate => IsInstalled && !IsPinned && !IsSideBySide && !IsLatestVersion;
+ public bool CanUpdate => IsInstalled && !IsPinned && !IsSideBySide && IsOutdated;
public bool IsUpgradeAllowed => _allowedCommandsService.IsUpgradeCommandAllowed;
@@ -232,12 +230,6 @@ public string LowerCaseId
get { return Id.ToLowerInvariant(); }
}
- public bool IsAbsoluteLatestVersion
- {
- get { return _isAbsoluteLatestVersion; }
- set { SetPropertyValue(ref _isAbsoluteLatestVersion, value); }
- }
-
public bool IsInstalled
{
get
@@ -286,16 +278,16 @@ public bool IsSideBySide
}
}
- public bool IsLatestVersion
+ public bool IsOutdated
{
get
{
- return _isLatestVersion;
+ return _isOutdated;
}
set
{
- if (SetPropertyValue(ref _isLatestVersion, value))
+ if (SetPropertyValue(ref _isOutdated, value))
{
NotifyPropertyChanged(nameof(CanUpdate));
}
@@ -314,7 +306,7 @@ public string Language
set { SetPropertyValue(ref _language, value); }
}
- public SemanticVersion LatestVersion
+ public NuGetVersion LatestVersion
{
get { return _latestVersion; }
set { SetPropertyValue(ref _latestVersion, value); }
@@ -404,7 +396,7 @@ public string Title
set { SetPropertyValue(ref _title, value); }
}
- public SemanticVersion Version
+ public NuGetVersion Version
{
get { return _version; }
set { SetPropertyValue(ref _version, value); }
@@ -713,7 +705,7 @@ public void Handle(PackageHasUpdateMessage message)
}
LatestVersion = message.Version;
- IsLatestVersion = false;
+ IsOutdated = true;
}
private async Task InstallPackage(string version, AdvancedInstall advancedOptions = null)
diff --git a/Source/ChocolateyGui.Common.Windows/ViewModels/RemoteSourceViewModel.cs b/Source/ChocolateyGui.Common.Windows/ViewModels/RemoteSourceViewModel.cs
index bff05e7b5..9dfe81cbe 100644
--- a/Source/ChocolateyGui.Common.Windows/ViewModels/RemoteSourceViewModel.cs
+++ b/Source/ChocolateyGui.Common.Windows/ViewModels/RemoteSourceViewModel.cs
@@ -27,6 +27,7 @@
using ChocolateyGui.Common.Windows.Utilities;
using ChocolateyGui.Common.Windows.Utilities.Extensions;
using NuGet;
+using NuGet.Packaging;
using Serilog;
using ILogger = Serilog.ILogger;
@@ -322,10 +323,6 @@ public async Task LoadPackages(bool forceCheckForOutdatedPackages)
{
p.IsInstalled = true;
}
- if (outdated.Any(package => string.Equals(package.Id, p.Id, StringComparison.OrdinalIgnoreCase)))
- {
- p.IsLatestVersion = false;
- }
Packages.Add(Mapper.Map(p));
});
diff --git a/Source/ChocolateyGui.Common.Windows/Views/LocalSourceView.xaml b/Source/ChocolateyGui.Common.Windows/Views/LocalSourceView.xaml
index e9043c42b..d3ed45cab 100644
--- a/Source/ChocolateyGui.Common.Windows/Views/LocalSourceView.xaml
+++ b/Source/ChocolateyGui.Common.Windows/Views/LocalSourceView.xaml
@@ -80,7 +80,7 @@
-
+
@@ -317,7 +317,7 @@
diff --git a/Source/ChocolateyGui.Common.Windows/Views/PackageView.xaml b/Source/ChocolateyGui.Common.Windows/Views/PackageView.xaml
index 1c44b4786..006057bf4 100644
--- a/Source/ChocolateyGui.Common.Windows/Views/PackageView.xaml
+++ b/Source/ChocolateyGui.Common.Windows/Views/PackageView.xaml
@@ -257,7 +257,7 @@
-
+
@@ -277,7 +277,7 @@
-
+
diff --git a/Source/ChocolateyGui.Common.Windows/Views/RemoteSourceView.xaml b/Source/ChocolateyGui.Common.Windows/Views/RemoteSourceView.xaml
index 9c05f9623..270ec5564 100644
--- a/Source/ChocolateyGui.Common.Windows/Views/RemoteSourceView.xaml
+++ b/Source/ChocolateyGui.Common.Windows/Views/RemoteSourceView.xaml
@@ -287,14 +287,14 @@
-
+
-
+
diff --git a/Source/ChocolateyGui.Common.Windows/packages.config b/Source/ChocolateyGui.Common.Windows/packages.config
index fe33eb7f3..dadc2cae6 100644
--- a/Source/ChocolateyGui.Common.Windows/packages.config
+++ b/Source/ChocolateyGui.Common.Windows/packages.config
@@ -5,7 +5,7 @@
-
+
diff --git a/Source/ChocolateyGui.Common/ChocolateyGui.Common.csproj b/Source/ChocolateyGui.Common/ChocolateyGui.Common.csproj
index 6630edf82..94da5718c 100644
--- a/Source/ChocolateyGui.Common/ChocolateyGui.Common.csproj
+++ b/Source/ChocolateyGui.Common/ChocolateyGui.Common.csproj
@@ -54,10 +54,8 @@
..\packages\AutoMapper.7.0.1\lib\net45\AutoMapper.dll
-
- ..\packages\chocolatey.lib.1.0.0\lib\chocolatey.dll
- False
- False
+
+ ..\packages\chocolatey.lib.2.0.0-alpha-20230124\lib\net48\chocolatey.dll
..\packages\LiteDB.5.0.5\lib\net45\LiteDB.dll
@@ -168,7 +166,7 @@
-
+
Resources.resx
diff --git a/Source/ChocolateyGui.Common/Models/Messages/PackageChangedMessage.cs b/Source/ChocolateyGui.Common/Models/Messages/PackageChangedMessage.cs
index 69912d548..005dfe0c4 100644
--- a/Source/ChocolateyGui.Common/Models/Messages/PackageChangedMessage.cs
+++ b/Source/ChocolateyGui.Common/Models/Messages/PackageChangedMessage.cs
@@ -5,7 +5,7 @@
//
// --------------------------------------------------------------------------------------------------------------------
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Models.Messages
{
@@ -20,7 +20,7 @@ public enum PackageChangeType
public class PackageChangedMessage
{
- public PackageChangedMessage(string id, PackageChangeType changeType, SemanticVersion version = null)
+ public PackageChangedMessage(string id, PackageChangeType changeType, NuGetVersion version = null)
{
Id = id;
ChangeType = changeType;
@@ -29,7 +29,7 @@ public PackageChangedMessage(string id, PackageChangeType changeType, SemanticVe
public string Id { get; }
- public SemanticVersion Version { get; }
+ public NuGetVersion Version { get; }
public PackageChangeType ChangeType { get; }
}
diff --git a/Source/ChocolateyGui.Common/Models/Messages/PackageHasUpdateMessage.cs b/Source/ChocolateyGui.Common/Models/Messages/PackageHasUpdateMessage.cs
index 3c05ef5b2..5ee382d62 100644
--- a/Source/ChocolateyGui.Common/Models/Messages/PackageHasUpdateMessage.cs
+++ b/Source/ChocolateyGui.Common/Models/Messages/PackageHasUpdateMessage.cs
@@ -5,13 +5,13 @@
//
// --------------------------------------------------------------------------------------------------------------------
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Models.Messages
{
public class PackageHasUpdateMessage
{
- public PackageHasUpdateMessage(string id, SemanticVersion version)
+ public PackageHasUpdateMessage(string id, NuGetVersion version)
{
Id = id;
Version = version;
@@ -19,6 +19,6 @@ public PackageHasUpdateMessage(string id, SemanticVersion version)
public string Id { get; }
- public SemanticVersion Version { get; set; }
+ public NuGetVersion Version { get; set; }
}
}
\ No newline at end of file
diff --git a/Source/ChocolateyGui.Common/Models/SemanticVersionTypeConverter.cs b/Source/ChocolateyGui.Common/Models/NuGetVersionTypeConverter.cs
similarity index 75%
rename from Source/ChocolateyGui.Common/Models/SemanticVersionTypeConverter.cs
rename to Source/ChocolateyGui.Common/Models/NuGetVersionTypeConverter.cs
index 071df0eb4..08967ed27 100644
--- a/Source/ChocolateyGui.Common/Models/SemanticVersionTypeConverter.cs
+++ b/Source/ChocolateyGui.Common/Models/NuGetVersionTypeConverter.cs
@@ -1,5 +1,5 @@
// --------------------------------------------------------------------------------------------------------------------
-//
+//
// Copyright 2017 - Present Chocolatey Software, LLC
// Copyright 2014 - 2017 Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC
//
@@ -8,11 +8,11 @@
using System;
using System.ComponentModel;
using System.Globalization;
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Models
{
- public class SemanticVersionTypeConverter : TypeConverter
+ public class NuGetVersionTypeConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
@@ -22,8 +22,8 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
var version = value as string;
- SemanticVersion semanticVersion;
- if (version != null && SemanticVersion.TryParse(version, out semanticVersion))
+ NuGetVersion semanticVersion;
+ if (version != null && NuGetVersion.TryParse(version, out semanticVersion))
{
return semanticVersion;
}
diff --git a/Source/ChocolateyGui.Common/Models/OutdatedPackage.cs b/Source/ChocolateyGui.Common/Models/OutdatedPackage.cs
index 25d7d5ff0..21f1dad28 100644
--- a/Source/ChocolateyGui.Common/Models/OutdatedPackage.cs
+++ b/Source/ChocolateyGui.Common/Models/OutdatedPackage.cs
@@ -6,7 +6,7 @@
// --------------------------------------------------------------------------------------------------------------------
using System.Xml.Serialization;
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Models
{
@@ -17,9 +17,9 @@ public class OutdatedPackage
public string VersionString { get; set; }
[XmlIgnore]
- public SemanticVersion Version
+ public NuGetVersion Version
{
- get { return new SemanticVersion(VersionString); }
+ get { return NuGetVersion.Parse(VersionString); }
}
}
}
\ No newline at end of file
diff --git a/Source/ChocolateyGui.Common/Models/Package.cs b/Source/ChocolateyGui.Common/Models/Package.cs
index 3e22f197d..fae42401a 100644
--- a/Source/ChocolateyGui.Common/Models/Package.cs
+++ b/Source/ChocolateyGui.Common/Models/Package.cs
@@ -6,7 +6,7 @@
// --------------------------------------------------------------------------------------------------------------------
using System;
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Models
{
@@ -28,16 +28,12 @@ public class Package
public string Id { get; set; }
- public bool IsAbsoluteLatestVersion { get; set; }
-
public bool IsInstalled { get; set; }
public bool IsPinned { get; set; }
public bool IsSideBySide { get; set; }
- public bool IsLatestVersion { get; set; }
-
public bool IsPrerelease { get; set; }
public string Language { get; set; }
@@ -72,7 +68,7 @@ public class Package
public string Title { get; set; }
- public SemanticVersion Version { get; set; }
+ public NuGetVersion Version { get; set; }
public int VersionDownloadCount { get; set; }
}
diff --git a/Source/ChocolateyGui.Common/Services/IChocolateyService.cs b/Source/ChocolateyGui.Common/Services/IChocolateyService.cs
index 1e68d1e61..13feee9f5 100644
--- a/Source/ChocolateyGui.Common/Services/IChocolateyService.cs
+++ b/Source/ChocolateyGui.Common/Services/IChocolateyService.cs
@@ -9,7 +9,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using ChocolateyGui.Common.Models;
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.Services
{
@@ -25,7 +25,7 @@ public interface IChocolateyService
Task GetByVersionAndIdAsync(string id, string version, bool isPrerelease);
- Task> GetAvailableVersionsForPackageIdAsync(string id, int page, int pageSize, bool includePreRelease);
+ Task> GetAvailableVersionsForPackageIdAsync(string id, int page, int pageSize, bool includePreRelease);
Task InstallPackage(
string id,
diff --git a/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs b/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs
index aefd1e9cd..f13b9277e 100644
--- a/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs
+++ b/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs
@@ -7,7 +7,7 @@
using System;
using System.Threading.Tasks;
-using NuGet;
+using NuGet.Versioning;
namespace ChocolateyGui.Common.ViewModels.Items
{
@@ -31,7 +31,7 @@ public interface IPackageViewModel
string Id { get; set; }
- bool IsAbsoluteLatestVersion { get; set; }
+ bool IsOutdated { get; set; }
bool IsInstalled { get; set; }
@@ -39,13 +39,11 @@ public interface IPackageViewModel
bool IsSideBySide { get; set; }
- bool IsLatestVersion { get; set; }
-
bool IsPrerelease { get; set; }
string Language { get; set; }
- SemanticVersion LatestVersion { get; }
+ NuGetVersion LatestVersion { get; }
string LicenseUrl { get; set; }
@@ -75,7 +73,7 @@ public interface IPackageViewModel
string Title { get; set; }
- SemanticVersion Version { get; set; }
+ NuGetVersion Version { get; set; }
int VersionDownloadCount { get; set; }
diff --git a/Source/ChocolateyGui.Common/packages.config b/Source/ChocolateyGui.Common/packages.config
index b7fb395e4..a0556fdeb 100644
--- a/Source/ChocolateyGui.Common/packages.config
+++ b/Source/ChocolateyGui.Common/packages.config
@@ -3,7 +3,7 @@
-
+
diff --git a/Source/ChocolateyGui/ChocolateyGui.csproj b/Source/ChocolateyGui/ChocolateyGui.csproj
index 8b9f4533e..68cf0399e 100644
--- a/Source/ChocolateyGui/ChocolateyGui.csproj
+++ b/Source/ChocolateyGui/ChocolateyGui.csproj
@@ -113,10 +113,8 @@
..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.Core.dll
-
- ..\packages\chocolatey.lib.1.0.0\lib\chocolatey.dll
- False
- False
+
+ ..\packages\chocolatey.lib.2.0.0-alpha-20230124\lib\net48\chocolatey.dll
..\packages\ControlzEx.4.4.0\lib\net462\ControlzEx.dll
diff --git a/Source/ChocolateyGui/packages.config b/Source/ChocolateyGui/packages.config
index f817579cd..88d61ff33 100644
--- a/Source/ChocolateyGui/packages.config
+++ b/Source/ChocolateyGui/packages.config
@@ -5,7 +5,7 @@
-
+
diff --git a/Source/ChocolateyGuiCli/ChocolateyGuiCli.csproj b/Source/ChocolateyGuiCli/ChocolateyGuiCli.csproj
index 74bbb5847..532673c7f 100644
--- a/Source/ChocolateyGuiCli/ChocolateyGuiCli.csproj
+++ b/Source/ChocolateyGuiCli/ChocolateyGuiCli.csproj
@@ -56,10 +56,8 @@
..\packages\Autofac.4.6.1\lib\net45\Autofac.dll
-
- ..\packages\chocolatey.lib.1.0.0\lib\chocolatey.dll
- False
- False
+
+ ..\packages\chocolatey.lib.2.0.0-alpha-20230124\lib\net48\chocolatey.dll
..\packages\LiteDB.5.0.5\lib\net45\LiteDB.dll
diff --git a/Source/ChocolateyGuiCli/packages.config b/Source/ChocolateyGuiCli/packages.config
index 53327c5ea..b35d66be0 100644
--- a/Source/ChocolateyGuiCli/packages.config
+++ b/Source/ChocolateyGuiCli/packages.config
@@ -2,7 +2,7 @@
-
+