This is related to this post:

Due to performance issue (the installation taking too long on Windows for software with very large number of folders and files) I plan to create a 7z file first, then package the 7z file in the installer. During installation I ask 7z to unzip the files.

This approach worked for big zip files with not many files, but with a zip files with very large nubmer files (more than 32000 files), the runProgram action for 7z unzip runs very slowly. The problem is that runProgram action pipes every output to program_stdout, since the number of files is huge, it hurts the performance really bad. Sadly the 7z tool doesn't have a quite mode that not outputting anything. I tried to call "7z x tmp.7z > nil", but got the same slow performace.

Is it possible to tell the installer not piping the output to program_stdout?

asked 02 Oct '12, 14:49

gt8967884's gravatar image

accept rate: 12%

It is not possible to disable reading of stdout and stderr from a child process.

The best solution for these cases is to create a .bat script and shell script on Unix systems file that does redirect to /dev/null or NUL and run that bat/shell file inside <runProgram>. For example:

<if> <actionList> <writeFile> <path>${system_temp_directory}/7z_temp.bat</path> <text>cd /D "${installdir.dos}" 7z\7z.exe x tmp.7z &gt;NUL 2&gt;NUL </text> </writeFile> <runProgram> <program>${system_temp_directory}/7z_temp.bat</program> <programArguments></programArguments> </runProgram> <deleteFile> <path>${system_temp_directory}/7z_temp.bat</path> </deleteFile> </actionList> <conditionRuleList> <platformTest> <type>windows</type> </platformTest> </conditionRuleList> <elseActionList> <writeFile> <path>${system_temp_directory}/</path> <text>cd "${installdir}" 7z/7z x tmp.7z &gt;/dev/null 2&gt;/dev/null </text> </writeFile> <runProgram> <program>sh</program> <programArguments>${system_temp_directory}/</programArguments> </runProgram> <deleteFile> <path>${system_temp_directory}/</path> </deleteFile> </elseActionList> </if>


answered 09 Oct '12, 08:05

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

This may be a problem for Linux, althought bash is pretty common, but I don't think everyone uses bash for all different kinds of Linux distribution.

(15 Oct '12, 17:04) gt8967884

All Unix systems have shells, and the syntax in this case is basic enough that any shell will run it without problems. I have also udpated the example above to run Windows and Unix scripts depending on platforms.

(16 Oct '12, 03:54) wojciechka ♦♦

Tested for your solution, it worked on Windows, but still slow on Linux. I realize it's the problem with 7z on Linux because it is just slow to run the plain cmd in shell, 7z x -y qhp.7z >/dev/null 2>/dev/null

(17 Oct '12, 19:41) gt8967884
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]( "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: 02 Oct '12, 14:49

Seen: 2,311 times

Last updated: 17 Oct '12, 19:41