How do I make the installer ask the user a yes/no question?

Author: BitRock Support       Date: October 30, 2007 09:33       Tags: User input and custom installer pages

You can make the installer ask the user a yes/no question using a boolean parameter. You will have to include a section like the one below inside the parameterList section of your XML installer project file.


   <booleanParameter>
     <name>createdb</name>
     <ask>yes</ask>
     <default>1</default>
     <title>Database Install</title>
     <explanation>Should initial database structure \r and data be created?</explanation>
     <value>1</value>
   </booleanParameter>
This will create an installer environment variable called
createdb
that will contain the value "1" if the user answered "yes" or the value "0" if the user answered "no" to the question. You can later refer to the content of the variable using ${createdb}, for example in a <isTrue> or <isFalse> rule:
    <showInfo text="The user selected Yes">
       <ruleList>
         <isTrue>
            <value>${createdb}</value>
         </isTrue>
        </ruleList>
    </showInfo>
Click here to download a sample project.xml file that integrates this functionality.

 

 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up