If I run the installation the second time to update an existing installation, it writes to the same log file, but wipes out the log from last run. Can I make it log in append mode, so I can keep all the logs?

asked 08 Dec '12, 04:25

gt8967884's gravatar image

accept rate: 12%

You can use scripts and <runProgram> to automate combining the log files.

For example the below will create a .bat / .sh script that appends the log file to installation.log in ${installdir} - for both Unix and Windows:

<if> <actionList> <writeFile> <path>${system_temp_directory}/combine_log_file.bat</path> <text>type "${installer_installation_log}" &gt;&gt;"${installdir}\installation.log" echo --- &gt;&gt;"${installdir}\installation.log" </text> </writeFile> <runProgram> <program>${system_temp_directory}/combine_log_file.bat</program> <programArguments></programArguments> </runProgram> <deleteFile> <path>${system_temp_directory}/combine_log_file.bat</path> </deleteFile> </actionList> <conditionRuleList> <platformTest> <type>windows</type> </platformTest> </conditionRuleList> <elseActionList> <writeFile> <path>${system_temp_directory}/combine_log_file.sh</path> <text>cat "${installer_installation_log}" &gt;&gt;"${installdir}/installation.log" echo --- &gt;&gt;"${installdir}/installation.log" </text> </writeFile> <runProgram> <program>sh</program> <programArguments>"${system_temp_directory}/combine_log_file.sh"</programArguments> </runProgram> <deleteFile> <path>${system_temp_directory}/combine_log_file.sh</path> </deleteFile> </elseActionList> </if>


answered 09 Dec '12, 13:24

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Combining logs looks too complicated to me. I'll just rename the old log to a different name.

<!-- if old log file exists, rename it to <log_file>.log.<index> -->
    <setInstallerVariable name="index" value="1"/>
          <text>${index} +1</text>

answered 11 Dec '12, 04:18

gt8967884's gravatar image

accept rate: 12%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



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



Asked: 08 Dec '12, 04:25

Seen: 1,302 times

Last updated: 11 Dec '12, 04:18