Showing the change log in the autoupdate window

Answered

Comments

1 comment

  • Avatar
    juanjo

    It is not possible to do that at that point. What you could do is use another binary (that may be an InstallBuilder installer) to do the logic. It would call the autoupdate in unattended mode, and if an update is available, contact your server using an <httpGet> action to retrieve a changelog and display it in a <showText> dialog. For example, assuming you have the current version in the variable ${current_version_id}:

     <project>
        ...
        <initializationActionList>
           <showQuestion default="yes" text="Would you like to check for updates?" variable="shouldCheckForUpdates" />
           <actionGroup>
              <actionList>
                 <!-- Once you have unpacked the bundled autoupdate and update.ini to some folder, like /tmp/autoupdate -->
                 <runProgram>
                    <program>/tmp/autoupdate/autoupdate-linux.run</program>
                    <programArguments>--mode unattended</programArguments>
                 </runProgram>
                 <actionGroup>
                     <actionList>
                           <httpGet url="http://example.com/changelog.php?current_version=${current_version_id}" filename="${system_temp_directory}/changelog.txt"/>
                           <readFile path="${system_temp_directory}/changelog.txt" name="changelog"/>
                           <showText title="An update is available!" text="${changelog}"/>
                           <showQuestion default="yes" text="Do you want to launch the upgrade process?" variable="shouldUpdate" />
                           <runProgram>
                              <program>/tmp/autoupdate/autoupdate-linux.run</program>
                              <programArguments>&amp;</programArguments>
                              <ruleList>
                                  <isTrue value="${shouldUpdate}" />
                              </ruleList>
                           </runProgram>
                           <exit/>
                      </actionList>
                       <ruleList>
                           <isFalse value="${program_exit_code}" />
                       </ruleList>
                 </actionGroup>
                 <showInfo text="Sorry, no update is available...">
                   <ruleList>
                       <compareText text="${program_exit_code}" value="0" logic="does_not_equal" />
                   </ruleList>
                 </showInfo>
              </actionList>
              <ruleList>
                 <compareText text="${shouldCheckForUpdates}" value="yes" logic="equals" />
              </ruleList>
           </actionGroup>
        </initializationActionList>
        ...
    </project>
    

Please sign in to leave a comment.