Skip to content

Commit

Permalink
(chocolatey#989) Remove usage of side by side
Browse files Browse the repository at this point in the history
With the upstream change in Chocolatey CLI to remove the usage of side
by side installations, we need to do the same thing within Chocolatey
GUI to prevent errors from happening.

This commit removes the usage of the properties that have been removed
from Chocolatey CLI, as well as changes the GUI to not include the
setting of these properties.
  • Loading branch information
gep13 committed Mar 20, 2023
1 parent e45f44e commit f7b7ecf
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ public async Task<PackageOperationResult> 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;
Expand Down Expand Up @@ -652,9 +649,6 @@ private static Package GetMappedPackage(GetChocolatey choco, PackageResult packa
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 = mappedPackage.Version.IsPrerelease;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class AdvancedInstallViewModel : ObservableBase, IClosableChildWindow<Adv
private bool _applyInstallArgumentsToDependencies;
private bool _applyPackageParametersToDependencies;
private bool _allowDowngrade;
private bool _allowMultipleVersions;
private bool _ignoreDependencies;
private bool _forceDependencies;
private bool _skipPowerShell;
Expand Down Expand Up @@ -226,12 +225,6 @@ public bool AllowDowngrade
set { SetPropertyValue(ref _allowDowngrade, value); }
}

public bool AllowMultipleVersions
{
get { return _allowMultipleVersions; }
set { SetPropertyValue(ref _allowMultipleVersions, value); }
}

public bool IgnoreDependencies
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public class PackageViewModel :

private bool _isPinned;

private bool _isSideBySide;

private bool _isPrerelease;

private string _language;
Expand Down Expand Up @@ -171,7 +169,7 @@ public string[] Authors

public bool IsUninstallAllowed => _allowedCommandsService.IsUninstallCommandAllowed;

public bool CanUpdate => IsInstalled && !IsPinned && !IsSideBySide && IsOutdated;
public bool CanUpdate => IsInstalled && !IsPinned && IsOutdated;

public bool IsUpgradeAllowed => _allowedCommandsService.IsUpgradeCommandAllowed;

Expand Down Expand Up @@ -262,22 +260,6 @@ public bool IsPinned
}
}

public bool IsSideBySide
{
get
{
return _isSideBySide;
}

set
{
if (SetPropertyValue(ref _isSideBySide, value))
{
NotifyPropertyChanged(nameof(CanUpdate));
}
}
}

public bool IsOutdated
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@
<mah:MetroHeader Header="{lang:Localize AdvancedChocolateyDialog_AllowDowngrade_Header}" Tag="{lang:Localize AdvancedChocolateyDialog_AllowDowngrade_ToolTip}">
<mah:ToggleSwitch VerticalAlignment="Center" IsOn="{Binding AllowDowngrade}" />
</mah:MetroHeader>
<mah:MetroHeader Background="{DynamicResource MahApps.Brushes.Gray10}" Header="{lang:Localize AdvancedChocolateyDialog_AllowMultipleVersions_Header}" Tag="{lang:Localize AdvancedChocolateyDialog_AllowMultipleVersions_ToolTip}">
<mah:ToggleSwitch VerticalAlignment="Center" IsOn="{Binding AllowMultipleVersions}" />
</mah:MetroHeader>
<mah:MetroHeader Header="{lang:Localize AdvancedChocolateyDialog_SkipPowerShell_Header}" Tag="{lang:Localize AdvancedChocolateyDialog_SkipPowerShell_ToolTip}">
<mah:ToggleSwitch VerticalAlignment="Center" IsOn="{Binding SkipPowerShell}" />
</mah:MetroHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
ToolTip="{lang:Localize LocalSourceView_ToolTip_Pinned}"
Kind="Pin" Margin="0 2"
Visibility="{Binding IsPinned, Mode=OneWay, Converter={StaticResource BooleanToVisibility}}" />
<iconPacks:PackIconEntypo Width="24" Height="24"
ToolTip="{lang:Localize LocalSourceView_ToolTip_InstalledSideBySide}"
Kind="Bookmarks" Margin="0 2"
Visibility="{Binding IsSideBySide, Mode=OneWay, Converter={StaticResource BooleanToVisibility}}" />
</StackPanel>

<TextBlock Grid.Row="2"
Expand Down Expand Up @@ -281,7 +277,6 @@
<DataTemplate DataType="{x:Type items:IPackageViewModel}">
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconEntypo ToolTip="{lang:Localize LocalSourceView_ToolTip_Pinned}" Kind="Pin" Visibility="{Binding IsPinned, Converter={StaticResource BooleanToVisibilityHidden}}" />
<iconPacks:PackIconEntypo ToolTip="{lang:Localize LocalSourceView_ToolTip_InstalledSideBySide}" Kind="Bookmarks" Visibility="{Binding IsSideBySide, Converter={StaticResource BooleanToVisibilityHidden}}" />
<TextBlock Text="{Binding Title}"/>
</StackPanel>
</DataTemplate>
Expand Down
2 changes: 0 additions & 2 deletions Source/ChocolateyGui.Common/Models/AdvancedInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public class AdvancedInstall

public bool AllowDowngrade { get; set; }

public bool AllowMultipleVersions { get; set; }

public bool IgnoreDependencies { get; set; }

public bool ForceDependencies { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions Source/ChocolateyGui.Common/Models/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class Package

public bool IsPinned { get; set; }

public bool IsSideBySide { get; set; }

public bool IsPrerelease { get; set; }

public string Language { get; set; }
Expand Down
27 changes: 0 additions & 27 deletions Source/ChocolateyGui.Common/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions Source/ChocolateyGui.Common/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,6 @@ Or if there is a traditional way to show sorting by the Title in your language,
<data name="RemoteSourceViewModel_FetchingPackages" xml:space="preserve">
<value>Fetching packages...</value>
</data>
<data name="LocalSourceView_ToolTip_InstalledSideBySide" xml:space="preserve">
<value>Installed Side by Side with another version of the same package.</value>
</data>
<data name="LocalSourceView_ToolTip_Pinned" xml:space="preserve">
<value>Pinned</value>
</data>
Expand Down Expand Up @@ -1064,12 +1061,6 @@ Please contact your System Administrator to enable this operation.</value>
<data name="AdvancedChocolateyDialog_AllowEmptyChecksums_ToolTip" xml:space="preserve">
<value>Allow packages to have empty/missing checksums for downloaded resources from non-secure locations (HTTP, FTP). Using this switch is not recommended if using sources that download resources from the internet. Only overrides the value in the configuration when 'On' is specified.</value>
</data>
<data name="AdvancedChocolateyDialog_AllowMultipleVersions_Header" xml:space="preserve">
<value>Allow Multiple Versions</value>
</data>
<data name="AdvancedChocolateyDialog_AllowMultipleVersions_ToolTip" xml:space="preserve">
<value>Should multiple versions of a package be installed?</value>
</data>
<data name="AdvancedChocolateyDialog_ApplyInstallArgumentsToDependencies_Header" xml:space="preserve">
<value>Apply Install Arguments to Dependencies</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public interface IPackageViewModel

bool IsPinned { get; set; }

bool IsSideBySide { get; set; }

bool IsPrerelease { get; set; }

string Language { get; set; }
Expand Down

0 comments on commit f7b7ecf

Please sign in to comment.