| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/installer/setup/setup_main.h" | 5 #include "chrome/installer/setup/setup_main.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <msi.h> | 8 #include <msi.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 // specified by --new-setup-exe. But we need to first unpack the file | 1122 // specified by --new-setup-exe. But we need to first unpack the file |
| 1123 // given in --update-setup-exe. | 1123 // given in --update-setup-exe. |
| 1124 base::ScopedTempDir temp_path; | 1124 base::ScopedTempDir temp_path; |
| 1125 if (!temp_path.CreateUniqueTempDir()) { | 1125 if (!temp_path.CreateUniqueTempDir()) { |
| 1126 PLOG(ERROR) << "Could not create temporary path."; | 1126 PLOG(ERROR) << "Could not create temporary path."; |
| 1127 } else { | 1127 } else { |
| 1128 base::FilePath compressed_archive(cmd_line.GetSwitchValuePath( | 1128 base::FilePath compressed_archive(cmd_line.GetSwitchValuePath( |
| 1129 installer::switches::kUpdateSetupExe)); | 1129 installer::switches::kUpdateSetupExe)); |
| 1130 VLOG(1) << "Opening archive " << compressed_archive.value(); | 1130 VLOG(1) << "Opening archive " << compressed_archive.value(); |
| 1131 if (installer::ArchivePatchHelper::UncompressAndPatch( | 1131 if (installer::ArchivePatchHelper::UncompressAndPatch( |
| 1132 temp_path.path(), | 1132 temp_path.GetPath(), compressed_archive, setup_exe, |
| 1133 compressed_archive, | |
| 1134 setup_exe, | |
| 1135 cmd_line.GetSwitchValuePath(installer::switches::kNewSetupExe))) { | 1133 cmd_line.GetSwitchValuePath(installer::switches::kNewSetupExe))) { |
| 1136 status = installer::NEW_VERSION_UPDATED; | 1134 status = installer::NEW_VERSION_UPDATED; |
| 1137 } | 1135 } |
| 1138 if (!temp_path.Delete()) { | 1136 if (!temp_path.Delete()) { |
| 1139 // PLOG would be nice, but Delete() doesn't leave a meaningful value in | 1137 // PLOG would be nice, but Delete() doesn't leave a meaningful value in |
| 1140 // the Windows last-error code. | 1138 // the Windows last-error code. |
| 1141 LOG(WARNING) << "Scheduling temporary path " << temp_path.path().value() | 1139 LOG(WARNING) << "Scheduling temporary path " |
| 1140 << temp_path.GetPath().value() |
| 1142 << " for deletion at reboot."; | 1141 << " for deletion at reboot."; |
| 1143 ScheduleDirectoryForDeletion(temp_path.path()); | 1142 ScheduleDirectoryForDeletion(temp_path.GetPath()); |
| 1144 } | 1143 } |
| 1145 } | 1144 } |
| 1146 | 1145 |
| 1147 *exit_code = InstallUtil::GetInstallReturnCode(status); | 1146 *exit_code = InstallUtil::GetInstallReturnCode(status); |
| 1148 if (*exit_code) { | 1147 if (*exit_code) { |
| 1149 LOG(WARNING) << "setup.exe patching failed."; | 1148 LOG(WARNING) << "setup.exe patching failed."; |
| 1150 installer_state->WriteInstallerResult( | 1149 installer_state->WriteInstallerResult( |
| 1151 status, IDS_SETUP_PATCH_FAILED_BASE, NULL); | 1150 status, IDS_SETUP_PATCH_FAILED_BASE, NULL); |
| 1152 } | 1151 } |
| 1153 } else if (cmd_line.HasSwitch(installer::switches::kShowEula)) { | 1152 } else if (cmd_line.HasSwitch(installer::switches::kShowEula)) { |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1911 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
| 1913 // to pass through, since this is only returned on uninstall which is | 1912 // to pass through, since this is only returned on uninstall which is |
| 1914 // never invoked directly by Google Update. | 1913 // never invoked directly by Google Update. |
| 1915 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1914 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 1916 } | 1915 } |
| 1917 | 1916 |
| 1918 VLOG(1) << "Installation complete, returning: " << return_code; | 1917 VLOG(1) << "Installation complete, returning: " << return_code; |
| 1919 | 1918 |
| 1920 return return_code; | 1919 return return_code; |
| 1921 } | 1920 } |
| OLD | NEW |