Home > Software Deployment > I said cancel! – UI Sequence tip

I said cancel! – UI Sequence tip

The default UI sequence that you’re given when creating a new project with Installshield has a few unessasary and redundant screens, in my opinion.

Take the CancelSetup dialog for instance.  If at any time in the UI Sequence I hit the cancel button the following dialog is displayed:

I said I wanted to cancel, and then answered a confirmation prompt – at that point, the installer should just exit.  It doesn’t and displays the SetupInterupted dialog instead:

Now, I understand why it’s displaying this dialog.  When you click yes on the cancel dialog it fires and EndDialog Exit event and the return code is 2 if the user cancels.  The SetupInterupted dialog’s sequence is -2 and so this dialog is displayed. From a user’s experience it’s needless.  If I cancel, I don’t need the option to see an msi log either.

Here’s a simple change I made to not show the SetupInterupted dialog if the user clicks cancel:

  1. Create a ‘Set Property’ custom action: CancelButtonPressed. (doesn’t need to be public).  Property Name: USER_CANCELLED – Property Value: 1
  2. On the behavior view for the CancelSetup dialog’s YES button I added a DoAction event that calls the custom action: CancelButtonPressed with a condition of 1 (always run).
  3. On the Custom Action view, find the SetupInterrupted dialog in the UI Sequence.  Add the following condition: (USER_CANCELLED <> “1”)

UPDATE: Stefan Krueger @installsite was kind enough to point out that you can set properties from the UI dialog without the step of creating a custom action.  Funny, because I realized this later that night and didn’t have the energy to update the post at the time.

you don’t need a custom action to set a property from a dialog button. Use [PROPERTYNAME] in the first field & value in second

And he’s right,.. take a look at the ReadyToInstall dialog’s InstallNow button to see that [ProgressType#] properties are set in this manner. Thanks Stefan!

Here are those steps updated:

  1. On the behavior view for the CancelSetup dialog’s YES button I added an event to set a property as follows: [USER_CANCELLED], 1, 1
  2. On the Custom Action view, find the SetupInterrupted dialog in the UI Sequence.  Add the following condition: (USER_CANCELLED <> “1”)

Now when I click cancel and confirm with the YES button, the installer actually exits.. imagine that!

Advertisements
  1. Rob
    June 30, 2011 at 8:21 pm

    Hi,

    What specifically do you mean by “On the behavior view” in step 1?

    Please keep in mind – I’m building an InstallScript MSI Project in InstallShield 2011 Pro so maybe I have a different project view than you do.

    Actually I don’t see a ReadyToInstall dialog either…I’m confused.

    Any hints to help with my confusion would be greatly appreciated!

    • Rob
      June 30, 2011 at 8:37 pm

      Hi Again,

      Yes, you seem to be using a Basic MSI Project. It all makes sense now!

      Awesome blog, btw!

      • Nick Skitch
        July 3, 2011 at 4:06 am

        thanks for the positive feedback. Great to hear.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: