pre_upgrade() {
  if [ ! -L /opt/sdrsharp/SDRSharp.exe.config ]; then
    echo -e "\033[1;33mOld SDRSharp configuration detected!"
    echo -e "\033[1;34mBacking up old config files..."

    for config in /opt/sdrsharp/*.exe.config; do
      cp -a "$config" "$config.old"
    done

    echo -e "Backup complete (the wrapper will use it to restore the config)"
    echo -e "\033[1;33mWarning: It isn't advised to overwrite the new symlinks in /opt/sdrsharp"
    echo -e "(because the old config method deletes configuration after a package upgrade/removal)\033[0m"
  fi
}
