VMware Cloud Community
AnonymousDefaul
Enthusiast
Enthusiast

Can I customise / add buttons to the showQuestion dialog?

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 fow, 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?

Labels (1)
1 Reply
AnonymousDefaul
Enthusiast
Enthusiast

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= or ' 0 or '  type= or ' abortRetry or ' >           <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= or ' ${answer} or ' />                   </ruleList>                 </kill>               </actionList>               <ruleList>                 <isFalse value= or ' ${first_time} or ' />               </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= or ' 1 or ' >               <ruleList>                 <compareValues value1= or ' ${popup_exit_code} or '  logic= or ' equals or '  value2= or ' 2 or ' />               </ruleList>             </exit>           </onErrorActionList>         </validatedActionGroup>       </actionList>       <conditionRuleList>         <processTest>           <logic>is_running</logic>           <name>appname</name>         </processTest>       </conditionRuleList>     </while> 
0 Kudos