Have you tried using this parameter:
.PARAMETER AllowDeferCloseApps
.PARAMETER AllowDeferCloseApps
Enables an optional defer button to allow the user to defer the installation only if there are
running applications that need to be closed.