This project is read-only.

Get the Close Button to quit the session?

Topics: Archive - General
Nov 21, 2013 at 7:07 PM
I want to give my users the option of quitting the install at the welcome page by clicking the red X. Right now, when it is clicked the welcome form closes but the installation proceeds as normal.

I've also tried adding a button with Exit-Script as the button action, but this causes system errors to occur. Having exit as the action also causes the errors and having Exit-PSSession as the action behaves the same way as the X button does currently.

Has anyone done this before that could share their script?
Nov 21, 2013 at 8:57 PM
What you could do is change the text in the XML config for the defer button to "cancel", change the defer label text and then provide a large number of deferrals. That would effectively turn the deferral button in to a cancel button.

We have purposely disabled the X because the user should always choose a button response, otherwise they'll always X out of it. Re-enabling it with a parameter is going to be too complicated and there is little use case for it.

It's also worth considering using the AllowDeferCloseApps parameter, which only shows the welcome prompt/deferral option if an application is running that needs to be closed.