Uninstall and Install in same script?

I have an installer that requires uninstalling of its older version before installing the newer version (there’s no in-place upgrade option for it apparently).
Is the recommended approach to have two toolkits, one that uninstalls and requires apps be closed, and then a second one that runs the installer?
Just curious since I know the ‘proper’ way is to run this with either -action Install or -action Uninstall? Correct me if I’m wrong.

I prefer to handle previous versions uninstalls in the [Pre-Installation] phase of the Installer script, if no in-between reboot is required. If a reboot is required, then the dual script/deployment approach would make more sense.

To me, calling a script.ps1 -uninstall refers to the specific version this script installs, not its previous versions.

I do not claim this to be the ‘correct’ way as it depends on the use case and preferences, but this worked well for me. :slight_smile:

1 Like

Thanks and what about showing the install and closeapps window? This doesn’t appear to work and instead runs silent if I deploy from PDQ Deploy as a admin user to a computer where a standard user is logged onto.