Our application has an automatic update facility that triggers the Bitrock autoupdater silently in the background. If an update is available we show a dialog to the user asking whether they wish to update now; if they click yes, we spawn another instance of the autoupdater (in download mode) and exit the application.

This is all working, but sometimes our application exit takes longer than expected (e.g. when it prompts the user with a "do you want to save..." type dialog) and occasionally it sticks around in the background. This means it's not actually finished exiting by the time the autoupdater has finished downloading the update installer and triggered it (via postUpdateDownloadActionList).

So, we have implemented a processTest to detect whether the application is running, which works fine. But we would like to give the user the following choices:

  • Retry (I will close the application myself)
  • Kill (Attempt to force the application to close)
  • Cancel (Abandon the installation)

The most intuitive way to present these options would be a dialog with three buttons, but the showQuestion dialog only allows two buttons with "Yes" and "No".

We can use a showChoiceQuestion dialog for now, but we feel that the fact it's a drop-down box containing the options is not the ideal user experience.

Is there any way we can provide a dialog with three buttons?

asked 31 May '13, 06:30

Paul%20F's gravatar image

Paul F
21337
accept rate: 0%


We have a <validatedActionGroup> option that displays an abort-retry-ignore dialog in case of error but the buttons are not configurable. Maybe you could use it (in a variation that only shows two buttons) and show the kill option if in the retry the process is still running:

    <setInstallerVariable>
        <name>first_time</name>
        <value>1</value>
    </setInstallerVariable>
    <while>
      <actionList>
        <validatedActionGroup showMessageOnError="0" type="abortRetry">
          <severity>warning</severity>
          <text>The application is still running. Please close it and retry or abort to exit the update</text>
          <actionList>
            <actionGroup>
              <actionList>
                <showQuestion>
                  <default>yes</default>
                  <text>The application is still running. Would you like us to try to kill it?</text>
                  <variable>answer</variable>
                </showQuestion>
                <kill>
                  <name>appname</name>
                  <ruleList>
                    <isTrue value="${answer}"/>
                  </ruleList>
                </kill>
              </actionList>
              <ruleList>
                <isFalse value="${first_time}"/>
              </ruleList>
            </actionGroup>
            <setInstallerVariable>
              <name>first_time</name>
              <value>0</value>
            </setInstallerVariable>
            <throwError>
              <text>the application is still running</text>
              <ruleList>
                <processTest>
                  <logic>is_running</logic>
                  <name>appname</name>
                </processTest>
              </ruleList>
            </throwError>
          </actionList>
          <ruleList>
            <processTest>
              <logic>is_running</logic>
              <name>appname</name>
            </processTest>
          </ruleList>
          <onErrorActionList>
            <exit exitCode="1">
              <ruleList>
                <compareValues value1="${popup_exit_code}" logic="equals" value2="2"/>
              </ruleList>
            </exit>
          </onErrorActionList>
        </validatedActionGroup>
      </actionList>
      <conditionRuleList>
        <processTest>
          <logic>is_running</logic>
          <name>appname</name>
        </processTest>
      </conditionRuleList>
    </while>
link

answered 31 May '13, 08:06

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

I'm looking for a solution to a similar problem, and find this approach useful.

Is there any official documentation for the validatedActionGroupaction? I didn't find any at http://installbuilder.bitrock.com/docs/installbuilder-userguide/index.html

(23 Sep '14, 11:07) Dirk Stegemann
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×31
×22
×7
×4

Asked: 31 May '13, 06:30

Seen: 2,017 times

Last updated: 23 Sep '14, 11:07