Combine Silent Uninstallation with Prompted Reboot?

I am using PSADT v3.9.2 to manage deployment of Fortinet FortiClient 7.2.1 using MSI files.

The install process works fine. However, when attempting to uninstall, the FortiClient uninstallation process seems to be restarting the system automatically, which is not the desired behavior. I would like to perform a silent uninstallation but prompt the user to restart after the uninstallation has finished.

I originally tried the following command for the uninstall:

Execute-MSI -Action Uninstall -Path '{CA453742-0693-47F1-88AE-AE30C2A4B31F}' -Parameters '/qn REBOOT=PromptRestart'

This results in the computer automatically restarting without a prompt. Additionally, I have two additional lines (to set a couple of firewall rules) in the PSADT script immediately following the uninstall line that are not executed, which makes me think that the FortiClient uninstallation routine is causing the restart.

If I remove the -Parameters modifier from the uninstallation line, the product uninstalls successfully, with no prompt to restart, and the log indicates "Execution completed successfully with exit code [3010]. A reboot is required."

How do I need to configure the -Parameters setting to combine a silent uninstallation with a prompted reboot?

That’s because the reboot is caused by MSIEXEC, not PSADT.

So those 2 additional line don’t get a chance to run.
PSADT doesn’t get a chance to exit gracefully either.

Try using Show-InstallationRestartPrompt

This sounds like a similar challenge we had with the Cisco Secure Client upgrade, as this contains multiple MSI installers (3 in our case), we supress the restart during each MSI install and then (as @That-Annoying-Guy suggested) we use the Show-InstallationRestartPrompt, and give the user a deadline.
N.B. We are using Intune to deploy, we deploy the app as System and use ServiceUI.exe (from MDT) to bring any prompts through to the users context.

Thank you all very much. I will try using Show-InstallationRestartPrompt as suggested.

I’m also using Intune with ServiceUI for the installations. Our organization is relatively new to having Intune (or any sort of device management system beyond what comes with Windows itself) and having to do app packaging and customization.

It’d be difficult to overstate how helpful the PSADT has been in making the overall process much easier and more consistent, so our gratitude goes out to everyone who has committed their time and effort to this project!

1 Like

Just a tip (I learned from another post by @That-Annoying-Guy ), remember to exit the script after the Show-InstallationRestartPrompt - I also find putting a short sleep in the code assists too.
His original advice:

1 Like