Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#1479) Add ability to use remembered arguments during uninstall #2648

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Commits on Apr 28, 2024

  1. (chocolatey#508) Make package id comparisons case insensitive

    This helps ensure that package IDs are handled in a case
    insensitive manner.
    TheCakeIsNaOH committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    edd1f23 View commit details
    Browse the repository at this point in the history
  2. (chocolatey#2761) Allow overriding remembered arguments

    This allows overriding of remembered package parameters, install
    arguments, cache location and execution timeout during upgrade.
    So a user can pass in different package parameters or arguments
    without having to completely reinstall the package or turn off
    remembered arguments.
    
    Switch arguments cannot be checked, because the lack of a switch
    normally would mean that they are just relying on the remembered args
    to remember it, so there is no way to determine if an override of the
    remembered args is appropriate.
    TheCakeIsNaOH committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    2c37c9a View commit details
    Browse the repository at this point in the history
  3. (chocolatey#2886) Switch remembered args to only change local configu…

    …ration
    
    This adds a new method, GetPackageConfigFromRememberedArguments which
    is similar to SetConfigFromRememberedArguments, but operates using a
    different method. First, a OptionSet is set up, so only the config
    that is passed in is modified, instead of the config that the global
    options parser was set with with. Second, it returns the modified
    configuration instead of the original configuration, because it is the
    local configuration being modified. Third, it has a more general name
    and changes log messages to be more general, so it later can more
    easily be reused for uninstall and export.
    
    This change fixes remembered arguments when Chocolatey is used as a
    library, like in ChocolateyGUI, where the config that is passed to
    the install_run method is not necessarily the same config object that
    was used to set up the global argument parser.
    
    The downside of using a new commandline parser is that it opens up the
    possibility of drift between the upgrade/global arguments and this
    added parser. However, this is not an issue because the format of the
    saved arguments is known, and any added arguments there would not work
    without being added here as well, which would be picked up during
    development.
    TheCakeIsNaOH committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    85ab916 View commit details
    Browse the repository at this point in the history
  4. (chocolatey#1479) Rework set package config method

    This brings out the functionality from the
    set_package_config_for_upgrade method to a more generic name, and adds
    in another parameter to prepare for setting remembered args for
    uninstall as well as upgrade. It also updates the logging and comments
    to make them generic for both upgrades and uninstalls.
    
    An alias/forwarding method is added for backwards compatibility.
    TheCakeIsNaOH committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    1f484ed View commit details
    Browse the repository at this point in the history
  5. (chocolatey#1479) Add UseRememberedArgumentsForUninstalls feature

    Similar to the UseRememberedArgumentsForUpgrade feature, this will be
    used to toggle if the remembered arguments are used during uninstall.
    TheCakeIsNaOH committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    f65c262 View commit details
    Browse the repository at this point in the history
  6. (chocolatey#1479) Implement using remembed arguments for uninstalls

    This adds the ability for the remembered argument to be reused for
    uninstalls. It can be controlled via the userememberedargs and
    ignorerememberedargs arguments, or via the previously added feature.
    TheCakeIsNaOH committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    f6227e7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    75298e2 View commit details
    Browse the repository at this point in the history