Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/installer/setup/main.cc

Issue 67229: Use different names for Chrome/Chromium for Chrome HTML prog id. If we (Closed)
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/installer/setup/setup.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 5 #include <string>
6 #include <windows.h> 6 #include <windows.h>
7 #include <msi.h> 7 #include <msi.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (key.Open(HKEY_CLASSES_ROOT, reg_key.c_str(), KEY_READ) && 287 if (key.Open(HKEY_CLASSES_ROOT, reg_key.c_str(), KEY_READ) &&
288 key.ReadValue(NULL, &value) && (old_val == value)) { 288 key.ReadValue(NULL, &value) && (old_val == value)) {
289 std::wstring key_path = L"Software\\Classes\\" + reg_key; 289 std::wstring key_path = L"Software\\Classes\\" + reg_key;
290 if (key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_WRITE)) 290 if (key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_WRITE))
291 key.WriteValue(NULL, new_val.c_str()); 291 key.WriteValue(NULL, new_val.c_str());
292 if (key.Open(HKEY_LOCAL_MACHINE, key_path.c_str(), KEY_WRITE)) 292 if (key.Open(HKEY_LOCAL_MACHINE, key_path.c_str(), KEY_WRITE))
293 key.WriteValue(NULL, new_val.c_str()); 293 key.WriteValue(NULL, new_val.c_str());
294 } 294 }
295 } 295 }
296 296
297 // This method is only temporary to update Chrome open cmd for existing users
298 // of Chrome. This can be deleted once we make one release including this patch
299 // to every user.
300 void UpdateChromeOpenCmd(bool system_install) {
301 std::wstring chrome_exe = installer::GetChromeInstallPath(system_install);
302 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
303 std::wstring old_open_cmd = L"\"" + chrome_exe + L"\" \"%1\"";
304 std::wstring new_open_cmd = ShellUtil::GetChromeShellOpenCmd(chrome_exe);
305 std::wstring reg_key[] = { L"ChromeHTML\\shell\\open\\command",
306 L"http\\shell\\open\\command",
307 L"https\\shell\\open\\command" };
308 for (int i = 0; i < _countof(reg_key); i++)
309 ReplaceRegistryValue(reg_key[i], old_open_cmd, new_open_cmd);
310 }
311
312 bool CheckPreInstallConditions(const installer::Version* installed_version, 297 bool CheckPreInstallConditions(const installer::Version* installed_version,
313 int options, 298 int options,
314 installer_util::InstallStatus& status) { 299 installer_util::InstallStatus& status) {
315 bool system_install = (options & installer_util::SYSTEM_LEVEL) != 0; 300 bool system_install = (options & installer_util::SYSTEM_LEVEL) != 0;
316 301
317 // Check to avoid simultaneous per-user and per-machine installs. 302 // Check to avoid simultaneous per-user and per-machine installs.
318 scoped_ptr<installer::Version> 303 scoped_ptr<installer::Version>
319 chrome_version(InstallUtil::GetChromeVersion(!system_install)); 304 chrome_version(InstallUtil::GetChromeVersion(!system_install));
320 if (chrome_version.get()) { 305 if (chrome_version.get()) {
321 LOG(ERROR) << "Already installed version " << chrome_version->GetString() 306 LOG(ERROR) << "Already installed version " << chrome_version->GetString()
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 423 }
439 InstallUtil::WriteInstallerResult(system_install, install_status, 424 InstallUtil::WriteInstallerResult(system_install, install_status,
440 install_msg_base, &chrome_exe); 425 install_msg_base, &chrome_exe);
441 if (install_status == installer_util::FIRST_INSTALL_SUCCESS) { 426 if (install_status == installer_util::FIRST_INSTALL_SUCCESS) {
442 LOG(INFO) << "First install successful."; 427 LOG(INFO) << "First install successful.";
443 CopyPreferenceFileForFirstRun(options, cmd_line); 428 CopyPreferenceFileForFirstRun(options, cmd_line);
444 // We never want to launch Chrome in system level install mode. 429 // We never want to launch Chrome in system level install mode.
445 if (!(options & installer_util::DO_NOT_LAUNCH_CHROME) && 430 if (!(options & installer_util::DO_NOT_LAUNCH_CHROME) &&
446 !(options & installer_util::SYSTEM_LEVEL)) 431 !(options & installer_util::SYSTEM_LEVEL))
447 installer::LaunchChrome(system_install); 432 installer::LaunchChrome(system_install);
448 } else if (install_status == installer_util::NEW_VERSION_UPDATED) {
449 // This is temporary hack and will be deleted after one release.
450 UpdateChromeOpenCmd(system_install);
451 } 433 }
452 } 434 }
453 } 435 }
454 } 436 }
455 437
456 // Delete temporary files. These include install temporary directory 438 // Delete temporary files. These include install temporary directory
457 // and master profile file if present. 439 // and master profile file if present.
458 scoped_ptr<WorkItemList> cleanup_list(WorkItem::CreateWorkItemList()); 440 scoped_ptr<WorkItemList> cleanup_list(WorkItem::CreateWorkItemList());
459 LOG(INFO) << "Deleting temporary directory " << temp_path; 441 LOG(INFO) << "Deleting temporary directory " << temp_path;
460 cleanup_list->AddDeleteTreeWorkItem(temp_path, std::wstring()); 442 cleanup_list->AddDeleteTreeWorkItem(temp_path, std::wstring());
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 } else { 601 } else {
620 install_status = InstallChrome(parsed_command_line, 602 install_status = InstallChrome(parsed_command_line,
621 installed_version.get(), 603 installed_version.get(),
622 options); 604 options);
623 } 605 }
624 606
625 CoUninitialize(); 607 CoUninitialize();
626 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 608 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
627 return dist->GetInstallReturnCode(install_status); 609 return dist->GetInstallReturnCode(install_status);
628 } 610 }
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/setup/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698