OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <shlobj.h> | 5 #include <shlobj.h> |
6 | 6 |
7 #include "chrome/installer/setup/setup.h" | 7 #include "chrome/installer/setup/setup.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 bool system_level = (options & installer_util::SYSTEM_LEVEL) != 0; | 44 bool system_level = (options & installer_util::SYSTEM_LEVEL) != 0; |
45 // Try to add Chrome to Media Player shim inclusion list. We don't do any | 45 // Try to add Chrome to Media Player shim inclusion list. We don't do any |
46 // error checking here because this operation will fail if user doesn't | 46 // error checking here because this operation will fail if user doesn't |
47 // have admin rights and we want to ignore the error. | 47 // have admin rights and we want to ignore the error. |
48 AddChromeToMediaPlayerList(); | 48 AddChromeToMediaPlayerList(); |
49 | 49 |
50 // We try to register Chrome as a valid browser on local machine. This | 50 // We try to register Chrome as a valid browser on local machine. This |
51 // will work only if current user has admin rights. | 51 // will work only if current user has admin rights. |
52 std::wstring chrome_exe(install_path); | 52 std::wstring chrome_exe(install_path); |
53 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); | 53 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); |
54 CommandLine cmd_line; | |
55 LOG(INFO) << "Registering Chrome as browser"; | 54 LOG(INFO) << "Registering Chrome as browser"; |
56 ShellUtil::RegisterStatus ret = ShellUtil::FAILURE; | 55 ShellUtil::RegisterStatus ret = ShellUtil::FAILURE; |
57 if (options & installer_util::MAKE_CHROME_DEFAULT) { | 56 if (options & installer_util::MAKE_CHROME_DEFAULT) { |
58 ret = ShellUtil::AddChromeToSetAccessDefaults(chrome_exe, false); | 57 ret = ShellUtil::AddChromeToSetAccessDefaults(chrome_exe, false); |
59 if (ret == ShellUtil::SUCCESS) { | 58 if (ret == ShellUtil::SUCCESS) { |
60 if (system_level) { | 59 if (system_level) { |
61 ShellUtil::MakeChromeDefault( | 60 ShellUtil::MakeChromeDefault( |
62 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, chrome_exe); | 61 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, chrome_exe); |
63 } else { | 62 } else { |
64 ShellUtil::MakeChromeDefault(ShellUtil::CURRENT_USER, chrome_exe); | 63 ShellUtil::MakeChromeDefault(ShellUtil::CURRENT_USER, chrome_exe); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (result == installer_util::FIRST_INSTALL_SUCCESS || | 235 if (result == installer_util::FIRST_INSTALL_SUCCESS || |
237 result == installer_util::INSTALL_REPAIRED) { | 236 result == installer_util::INSTALL_REPAIRED) { |
238 DoFirstInstallTasks(install_path, options); | 237 DoFirstInstallTasks(install_path, options); |
239 } else { | 238 } else { |
240 RemoveOldVersionDirs(install_path, new_version.GetString()); | 239 RemoveOldVersionDirs(install_path, new_version.GetString()); |
241 } | 240 } |
242 } | 241 } |
243 | 242 |
244 return result; | 243 return result; |
245 } | 244 } |
OLD | NEW |