call uninstaller from installer

Comments

1 comment

  • Avatar
    juanjo

    You can add the option using a <choiceparameter>:

      <choiceParameter>
         <name>installMode</name>
         <description>Select the installation mode</description>
         <explanation></explanation>
         <displayType>combobox</displayType>
         <width>30</width>
         <optionList>
           <option>
             <description>Upgrade</description>
             <text>Upgrade</text>
             <value>upgrade</value>
           </option>
           <option>
             <description>Uninstall</description>
             <text>Uninstall</text>
             <value>uninstall</value>
           </option>
         </optionList>
         <postShowPageActionList>
            <!-- Set upgrade mode in the project -->
            <setInstallerVariable>
              <name>project.installationType</name>
              <value>upgrade</value>
              <ruleList>
                 <compareText text="${installMode}" logic="equals" value="upgrade"/>
              </ruleList>
            </setInstallerVariable>
         </postShowPageActionList>
      </choiceParameter>
    

    And the call the uninstaller if the option is "uninstall":

         <runProgram>
            <program>${installdir}/uninstall</program>
            <programArguments>--mode uanttended</programArguments>
            <ruleList>
                 <compareText text="${installMode}" logic="equals" value="uninstall"/>
            </ruleList>
          </runProgram>
    

Please sign in to leave a comment.