Hi, I'm adding a question dialogue during ready to install Actions. The question dialogue is displayed but the answering yes/no is just going ahead with the installation. How can I make yes to continue with the installation and no exit the installation. <showquestion> <default>no</default> <text> Are you sure you want to continue?</text> <variable>continue_installation</variable> <rulelist> <stringtest> <text>${env(PROJECT_HOME)}</text> <type>ascii</type> </stringtest> </rulelist> </showquestion>

asked 17 Mar, 13:05

paddy's gravatar image

paddy
11
accept rate: 0%

edited 17 Mar, 13:19


Ok, I added the following code to exit the installation if the variable continue_installation that is defined by "showquestion" dialogue is false. But irrespective of I press "yes" or "no" from the showquestion dialogue, the installer just exits. So, there is not effect. I feel I'm not accessing the "continue_installation" variable defined in the "showquestion" dialogue. Would you please let me know how to access the variable correctly? - <exit> <customerrormessage>Installation aborted ${continue_installation}</customerrormessage> <rulelist> <isfalse> <value>continue_installation</value> </isfalse></rulelist> </exit>

link

answered 19 Mar, 13:46

paddy's gravatar image

paddy
11
accept rate: 0%

Try checking the value of the <showquestion> equals vs the values "yes" and "no".

Here's how I use it. I have an <exit> action where I check the variable for the value "no", and if it is not no then allow it to proceed, which allows simpler code in the case where the <showquestion> is not executed because its <rulelist> says it does not need to be displayed.

<actionGroup>
  <actionList>
    <registryGet>
      <key>HKEY_LOCAL_MACHINE\SOFTWARE\${project.vendor}\${project.fullName}</key>
      <name>Version</name>
      <variable>previousVersion</variable>
    </registryGet>

    <showQuestion>
      <abortOnError>1</abortOnError>
      <explanation>Warn the user they are about to downgrade and allow them to abort installation.</explanation>
      <text>A newer version ${previousVersion} is already installed on this computer. Are you sure you want to continue and downgrade to version ${project.version}?</text>
      <default>no</default>
      <variable>downgradeAnswer</variable>
      <ruleList>
        <compareValues>
          <logic>does_not_equal</logic>
          <value1>${previousVersion}</value1>
          <value2>Unknown variable</value2>
        </compareValues>

        <compareValues>
          <logic>greater</logic>
          <value1>${previousVersion}</value1>
          <value2>${project.version}</value2>
        </compareValues>
      </ruleList>
    </showQuestion>

    <exit>
      <exitCode>0</exitCode>
      <ruleList>
        <compareValues>
          <logic>equals</logic>
          <value1>${downgradeAnswer}</value1>
          <value2>no</value2>
        </compareValues>
      </ruleList>
    </exit>
  </actionList>
</actionGroup>
link

answered 23 Mar, 11:15

cjw's gravatar image

cjw
12
accept rate: 0%

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:

×5
×3
×2
×1
×1

Asked: 17 Mar, 13:05

Seen: 44 times

Last updated: 23 Mar, 11:15