Scripting installation

Hi, for years we have been using the Enduser Protection. Since a week we've changed to Intercept X via Sophos Central. I checked the page they are suggesting about installations: https://support.sophos.com/support/s/article/KB-000034831?language=en_US

I'm trying to set up a GPO like in this page, but it seems that it doesn't install because the old one is still present. Can I add the uninstallation part in the script, and won't this pose any problem as I thought you need to restart before you can install the new one. Or am I  missing something?

Jo