mkevenaar / chocolatey-packages

My chocolatey packages
https://mkevenaar.github.io/chocolatey-packages/
Apache License 2.0
42 stars 66 forks source link

(samsung-magician) Add package support for software downgrades #181

Closed brogers5 closed 1 year ago

brogers5 commented 1 year ago

Description

This changeset enhances the install script to detect the current installed version of Samsung Magician, and if necessary, uninstalls the current version of Samsung Magician to enable a downgrade operation to succeed.

Motivation and Context

If the installer detects the current installed version of Samsung Magician is newer than the installer's version, the following dialog will be shown after the Language Selection dialog:

Samsung Magician Downgrade

When dismissed, the installer will return exit code 1, causing the install script to fail. The user must uninstall Samsung Magician before reattempting to install that specific version.

To implement proper support for the install command's --allow-downgrade switch, the script needs awareness of this requirement and to act accordingly for downgrade scenarios.

How Has this Been Tested?

Dev

Chocolatey Test Environment

Steps

Test Package Creation

  1. Created a test package of the current version that consumes the modified scripts (i.e. choco pack).
  2. Create a test package version for a past version with a similar patch applied (reference commit reverting to v7.2.0.930 available at https://github.com/brogers5/chocolatey-packages-mkevenaar/commit/942e992f4c55bdff91ea17cfe2045da58a807112).
  3. Repeat step 1 with the forked past package version.

Downgrade Test

  1. Install the latest version of Samsung Magician (i.e. choco install samsung-magician).
  2. Install the past test package version (i.e. choco install samsung-magician --source="'.;https://community.chocolatey.org/api/v2/'" --version=7.2.0.930 --allow-downgrade).
  3. Confirm the current version of Samsung Magician is uninstalled without issues.
  4. Confirm the package installation completes without errors.

Uninstall Regression Test

  1. Uninstall the past test package (i.e. choco uninstall samsung-magician).
  2. Confirm the uninstallation completes without errors.

Clean Install Regression Test

  1. Install the past test package version (i.e. choco install samsung-magician --source="'.'" --version=7.2.0.930).
  2. Confirm the package installation completes without errors.

Reinstall Regression Test

  1. Forcibly reinstall the past test package version (i.e. choco install samsung-magician --source="'.'" --version=7.2.0.930 --force).
  2. Monitor the installation process, and confirm the current installation is not uninstalled first.
  3. Confirm the package installation completes without errors.

Upgrade Regression Test

  1. Upgrade to the current test package version (i.e. choco upgrade samsung-magician --source="'.'").
  2. Monitor the installation process, and confirm the current installation is not uninstalled first.
  3. Confirm the package upgrade completes without errors.

Screenshot (if appropriate, usually isn't needed):

N/A

Types of changes

Checklist:

AppVeyorBot commented 1 year ago

:white_check_mark: Package verification completed without issues. PR is now pending human review

mkevenaar commented 1 year ago

@brogers5 could you please rebase this and solve the merge conflict? Thanks in advance

AppVeyorBot commented 1 year ago

:white_check_mark: Package verification completed without issues. PR is now pending human review

brogers5 commented 1 year ago

@mkevenaar Rebased and modified to reflect changes for v7.3.0.1100.

mkevenaar commented 1 year ago

@brogers5 Your changes have been merged, thank you for your contribution!