# Version
* v14

# Changelog
* 2022-08-04 v14
    - If component is already patched, another fix is not applied
    - It is mentioned in logs when component is already patched
* 2022-08-04 v13
    - fixed not detecting Management folder correctly
* 2022-08-04 v12
    - added support for running in Site Server
    - synced versions of readme file and project
    - improved backup description in readme file
    - corrected information about vulnerabilities in readme file
	- improved logging

# About
The SpringPatcher tool fully mitigates the
following security vulnerabilities:

* CVE-2022-22965
* CVE-2022-22963 (not affecting the product, mentioning for completeness)

Only affected version is Build 30 or higher. Patcher will not work with previous versions.

# Backup
To backup your installation use "--dry-run" switch to list all components to be patched. 
Then manually back up folders accordingly:
- Management: <Management Service installation root>\tomcat\webapps\
- Payment System: <Payment System installation root>\webapps
- End User Interface: <Spooler Controller installation root>\EUI\webapps\
- PayPal plugin: <Payment System installation root>\webapps
- Ogone plugin: <Payment System installation root>\webapps
- Dibs plugin: <Payment System installation root>\webapps


# How to use
To patch your installation simply download the tool and run it
as is, without any arguments. You need to do this on all servers.

More examples:
(Without any arguments, it defaults to installation root stored in Windows
Registry)
.\springPatcher

To provide alternate installation root path, use the -p argument:
.\springPatcher -p C:\my_istallation_directory

To test the patching process without actually patching any libraries, you can
invoke the tool with the --dry-run argument:
.\springPatcher --dry-run

This command is similar to the one above but it additionally prints which services will be restarted:
.\springPatcher --dry-run --manage-services

The springPatcher tool supports restarting all impacted services
automatically with the --manage-services argument:
.\springPatcher -p C:\my_istallation_directory --manage-services

To get list of all supported command line options, simply run:
.\springPatcher --help

# How does the tool work?
The springPatcher tool is a command line utility and can be run from CMD.EXE, Windows
Terminal or PowerShell. The tool takes installation home directory as an
argument, scans all components and inject repair file into archives. It it safe to run 
the tool multiple times against one installation.

# Known Issues or Limitations
When using the --manage-services some services might take more time when
shutting down. If any service gets stuck in the "Service Stopping" state, you
can use Windows Task Manager to kill the relevant service process. The tool will
then proceed automatically.
However, it is recommended to manually stop all services and after patcher is finished start them again

# Roll back
Stop the services, restore the files from backup, start the services
