How to execute custom actions after the update installer is downloaded

Author: BitRock Support       Date: January 06, 2010 15:13       Tags: Upgrade Installers

The default behavior of the autoupdate is to launch the downloaded installer but sometimes it is needed to perform some validation over the downloaded files, for example to check the integrity of the downloaded data.

The above can be achieved using the <postUpdateDownloadActionList>:

  <postUpdateDownloadActionList>
     <!-- Execute some validations here -->
     ...
     <!-- The path to the downloaded update will be stored in the ${downloadedFilePath} built-in variable -->
     <runProgram programArguments="${downloadedFilePath}" program="md5sum" />
     <!-- You can use any action like using httpGet to retrieve a valid value for the md5sum or directly send the md5 to the server to check it -->
     <compareText text="${program_stdout}" value="${someExpectedValue}" logic="equals" />
     ...
     <!-- Launch the installer -->
     <runProgram>
         <program>${downloadedFilePath}</program>
         <programArguments>--prefix /tmp/someDir --enable_component_a 1 --is_update 1 &amp;</programArguments>
     </runProgram>
 </postUpdateDownloadActionList>

Please note the usage of the built-in "downloadedFilePath" variable to get the path of the update installer. This is necessary because although we define the update_download_location key in the update.ini file, if an older file with the same name is found there, a suffix if appended to the file name: sample-1.0-windows-installer.exe.1, sample-1.0-windows-installer.exe.2 ...

In addition, we have to manually launch the downloaded file because we have override the default behavior. This is specially useful to launch it in unattended mode or to pass some command line argument as in the example.

 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up