diff options
author | sra@chromium.org <sra@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 22:35:17 +0000 |
---|---|---|
committer | sra@chromium.org <sra@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 22:35:17 +0000 |
commit | 44a8378abdda16649e196cc0f1d91a80305ff785 (patch) | |
tree | 1f158fc351f7a3f3afbecb16266cd058f461ca6f | |
parent | c07ed843bd990def22004505571f3c1c5e7c7784 (diff) | |
download | chromium_src-44a8378abdda16649e196cc0f1d91a80305ff785.zip chromium_src-44a8378abdda16649e196cc0f1d91a80305ff785.tar.gz chromium_src-44a8378abdda16649e196cc0f1d91a80305ff785.tar.bz2 |
Setup.exe now tries to uncompress patch using courgette.
Review URL: http://codereview.chromium.org/113412
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16114 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/installer/setup/DEPS | 1 | ||||
-rw-r--r-- | chrome/installer/setup/main.cc | 17 |
2 files changed, 16 insertions, 2 deletions
diff --git a/chrome/installer/setup/DEPS b/chrome/installer/setup/DEPS index ab2a48a..6ea9f75 100644 --- a/chrome/installer/setup/DEPS +++ b/chrome/installer/setup/DEPS @@ -1,3 +1,4 @@ include_rules = [
"+chrome/app",
+ "+courgette",
]
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc index 2795edd..b4e2793 100644 --- a/chrome/installer/setup/main.cc +++ b/chrome/installer/setup/main.cc @@ -32,6 +32,7 @@ #include "chrome/installer/util/shell_util.h" #include "chrome/installer/util/util_constants.h" #include "chrome/installer/util/work_item.h" +#include "courgette/courgette.h" #include "third_party/bspatch/mbspatch.h" #include "installer_util_strings.h" @@ -56,6 +57,18 @@ int PatchArchiveFile(bool system_install, const std::wstring& archive_path, LOG(INFO) << "Applying patch " << patch_archive << " to file " << existing_archive << " and generating file " << uncompressed_archive; + + // Try Courgette first. Courgette checks the patch file first and fails + // quickly if the patch file does not have a valid Courgette header. + courgette::Status patch_status = + courgette::ApplyEnsemblePatch(existing_archive.c_str(), + patch_archive.c_str(), + uncompressed_archive.c_str()); + + if (patch_status == courgette::C_OK) { + return 0; + } + return ApplyBinaryPatch(existing_archive.c_str(), patch_archive.c_str(), uncompressed_archive.c_str()); @@ -438,7 +451,7 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line, } installer_util::InstallStatus UninstallChrome(const CommandLine& cmd_line, - const wchar_t* cmd_params, + const wchar_t* cmd_params, const installer::Version* version, bool system_install) { LOG(INFO) << "Uninstalling Chome"; @@ -495,7 +508,7 @@ bool HandleNonInstallCmdLineOptions(const CommandLine& cmd_line, if (cmd_line.HasSwitch(installer_util::switches::kShowEula)) { // Check if we need to show the EULA. If it is passed as a command line // then the dialog is shown and regardless of the outcome setup exits here. - std::wstring inner_frame = + std::wstring inner_frame = cmd_line.GetSwitchValue(installer_util::switches::kShowEula); exit_code = ShowEULADialog(inner_frame); if (installer_util::EULA_REJECTED != exit_code) |