Cancel MSI without showing the Abort Installation dialog box.

I am wondering if the Cancel button on my welcome screen can exit the installer completely without showing the final “Abort Installation” dialog. I find this superfluous when the user has not yet started the installation.

I still want the dialog to appear if the user cancels the installation that is already running, but not if the installation has not been started (this happens if the Cancel button is pressed on the welcome screen).

I tried different things, but I lack an understanding of how the Windows Installer works in order to understand the solution.

Update: Got a job! I ended up using a combination of two sentences - I would like to give you both answers, but I will give it to the beam, since he has the lowest representative. But I will adore them. Here's how I did it (I'm still wondering if this works):

I used the Publish element as the suggested ray, but instead of triggering an event (there is no event called “Finish”), I set the “AbortInstall” property to 1 :

 <Publish Dialog="SimpleDlg" Control="Cancel" Property="AbortInstall" Value="1">1</Publish> 

I did this in my WixUI_Simple.wxs user settings file under Wix / Fragment / UI

Then, inside UserExit.wxs, I changed the value of InstallUISequence as follows:

 <InstallUISequence> <Show Dialog="Simple_UserExit" OnExit="cancel">NOT AbortInstall = 1</Show> </InstallUISequence> 

... is an idea suggested by Christopher.

Thanks to both of you!

+3
source share
3 answers

I did not test this so that it does not work in the slightest way, but what the hell.

You can probably create a publishing element for WelcomeDlg on the Cancel button, for example:

 <Publish Dialog="WelcomeDlg" Control="Cancel" Event="Finish" Value="Exit">1</Publish> 

Let me know how this happens :)

+1
source

Take a look at your InstallUISequence table:

http://msdn.microsoft.com/en-us/library/aa369543(VS.85).aspx

Pay attention to special dialogs with the sequence -1, -2 and -3. Note that you can also put a condition in dialogs. With a little creatavity, you can use the property as a flag to determine if your installation was actually installed, and to prevent or show the appropriate dialog box.

+3
source

Just FYI and fun.
How to hide exit dialog in
In custom WixUI_xxxxx.wxs in the <UI>

 <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return">1</Publish> <Publish Dialog="MyNewDlg" Control="Ok" Event="EndDialog" Value="Return" Order="1">1</Publish> 

In the <Product> :

 <Property Id="ExitSuccess" Value="1" /> 

A

 <InstallUISequence> <Show Dialog="MyNewDlg" After="SomeAction">Installed</Show> <Show Dialog="ExitDialog" OnExit="success">NOT ExitSuccess = 1</Show> </InstallUISequence> 

What all.

+1
source

Source: https://habr.com/ru/post/948354/


All Articles