views:

67

answers:

2

I am wondering if it is possible to have the "Cancel" button on my welcome screen completely quit the installer without showing the final "Installation interrupted" dialog. I consider this redundant when the user hasn't even begun the installation yet.

I still want the dialog to be shown if the user cancels an installation that has already been started, but not if the installation hasn't been started (which is the case if the Cancel button is hit on the welcome screen).

I have tried various things but I lack a proper understanding of how Windows Installer works to fathom a solution.

Update: Got it to work! I ended up using a combination of the two suggestions--I wish I could give you both the answer, but I'll give it to ray as he has the lowest rep. But I'll upvote them both. Here's how I did it (I'm still surprised it works):

I used the Publish element as ray suggested, but instead of invoking an event (there's no event called "Finish"), I set a property, "AbortInstall" to 1:

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

I did this in my custom set file WixUI_Simple.wxs under Wix/Fragment/UI

Then, inside UserExit.wxs I modified the InstallUISequence as follows:

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

...which is the idea suggested by Christopher.

Thanks to you both!

+3  A: 

Take a look at your InstallUISequence table:

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

Notice the special dialogs with a sequence of -1, -2 and -3. Notice that you can also put a condition on the dialogs. With a little creatavity you can use a property as a flag to determine whether your install ever really began and prevent or show the dialog in question.

Christopher Painter
+1  A: 

I haven't tested this so it might not work in the slightest, but what the hell.

You probably can create a Publish element for the WelcomeDlg on the Cancel button control like so:

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

Let me know how it goes :)

ray dey

related questions