This is related to this post: http://answers.bitrock.com/questions/1876/performance-issue-when-installing-large-software

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

gt8967884
101747678
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}/7z_temp.sh</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}/7z_temp.sh</programArguments> </runProgram> <deleteFile> <path>${system_temp_directory}/7z_temp.sh</path> </deleteFile> </elseActionList> </if>

link

answered 09 Oct '12, 08:05

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
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

By RSS:

Answers

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

Tags:

×54
×2
×2
×2

Asked: 02 Oct '12, 14:49

Seen: 2,258 times

Last updated: 17 Oct '12, 19:41