Index: chrome/tools/build/win/create_installer_archive.py |
=================================================================== |
--- chrome/tools/build/win/create_installer_archive.py (revision 79843) |
+++ chrome/tools/build/win/create_installer_archive.py (working copy) |
@@ -1,5 +1,5 @@ |
#!/usr/bin/python |
-# Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
+# Copyright (c) 2011 The Chromium Authors. All rights reserved. |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
@@ -74,7 +74,16 @@ |
def CompressUsingLZMA(output_dir, compressed_file, input_file): |
lzma_exec = GetLZMAExec(output_dir) |
- cmd = '%s a -t7z "%s" "%s" -mx9' % (lzma_exec, compressed_file, input_file) |
+ cmd = ('%s a -t7z ' |
+ # Flags equivalent to -mx9 but with bcj2 turned on (exe pre-filter). |
+ # This results in ~3MB decrease in installer size on a 24MB installer. |
+ '-m0=BCJ2 ' |
+ '-m1=LZMA:d26:fb64 ' |
+ '-m2=LZMA:d20:fb64:mf=bt2 ' |
+ '-m3=LZMA:d20:fb64:mf=bt2 ' |
+ '-mb0:1 -mb0s1:2 ' |
+ '-mb0s2:3 ' |
+ '"%s" "%s"') % (lzma_exec, compressed_file, input_file) |
if os.path.exists(compressed_file): |
os.remove(compressed_file) |
RunSystemCommand(cmd) |
@@ -132,7 +141,7 @@ |
def GetLZMAExec(output_dir): |
lzma_exec = os.path.join(output_dir, "..", "..", "third_party", |
- "lzma_sdk", "Executable", "7za.exe") |
+ "lzma_sdk", "7zr.exe") |
return lzma_exec |
def GetPrevVersion(output_dir, temp_dir, last_chrome_installer): |
@@ -191,7 +200,7 @@ |
options.output_name + ARCHIVE_SUFFIX) |
cmd = '%s a -t7z "%s" "%s" -mx0' % (lzma_exec, archive_file, |
os.path.join(staging_dir, CHROME_DIR)) |
- # There doesnt seem to be any way in 7za.exe to override existing file so |
+ # There doesnt seem to be any way in 7zr.exe to override existing file so |
# we always delete before creating a new one. |
if not os.path.exists(archive_file): |
RunSystemCommand(cmd) |