#!/bin/sh

cd "${INSTALL_PATH}"

$SHELL servicestop.sh
$SHELL servicedelete.sh

# pkill has been implement in PowerShell script "beforepacks.ps1" to check the commandLine fullPath, to be sure it is the right AdxAdmin or Runtime
# pkill -f sadfsq
# pkill -f adxdsrv
# pkill -f adxd
pwsh -Executionpolicy remotesigned -File  "${BEFORE_UPDATE_SCRIPT_PS_PATH}" -InstallPath  "${INSTALL_PATH}"

if [ -f "SAGE ERP X3 EULA FR".txt ]; then rm -f "SAGE ERP"*.txt; fi
if [ -f "SAGE ERP X3 EULA FR".htm ]; then rm -f "SAGE ERP"*.htm; fi

exit 0
