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

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

Issue 660168: Disable registering, unregistering, and setting default browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <shellapi.h> 8 #include <shellapi.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 10
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 IDS_INSTALL_OS_NOT_SUPPORTED_BASE, NULL); 592 IDS_INSTALL_OS_NOT_SUPPORTED_BASE, NULL);
593 return installer_util::OS_NOT_SUPPORTED; 593 return installer_util::OS_NOT_SUPPORTED;
594 } 594 }
595 595
596 // Initialize COM for use later. 596 // Initialize COM for use later.
597 AutoCom auto_com; 597 AutoCom auto_com;
598 if (!auto_com.Init(system_install)) { 598 if (!auto_com.Init(system_install)) {
599 return installer_util::OS_ERROR; 599 return installer_util::OS_ERROR;
600 } 600 }
601 601
602 int exit_code = 0;
603 if (HandleNonInstallCmdLineOptions(parsed_command_line, system_install,
604 exit_code))
605 return exit_code;
606
607 // Some command line options don't work with SxS install/uninstall 602 // Some command line options don't work with SxS install/uninstall
608 if (InstallUtil::IsChromeSxSProcess()) { 603 if (InstallUtil::IsChromeSxSProcess()) {
609 if (system_install || 604 if (system_install ||
610 parsed_command_line.HasSwitch( 605 parsed_command_line.HasSwitch(
611 installer_util::switches::kForceUninstall) || 606 installer_util::switches::kForceUninstall) ||
612 parsed_command_line.HasSwitch( 607 parsed_command_line.HasSwitch(
613 installer_util::switches::kMakeChromeDefault) || 608 installer_util::switches::kMakeChromeDefault) ||
614 parsed_command_line.HasSwitch( 609 parsed_command_line.HasSwitch(
615 installer_util::switches::kRegisterChromeBrowser) || 610 installer_util::switches::kRegisterChromeBrowser) ||
616 parsed_command_line.HasSwitch( 611 parsed_command_line.HasSwitch(
617 installer_util::switches::kRemoveChromeRegistration) || 612 installer_util::switches::kRemoveChromeRegistration) ||
618 parsed_command_line.HasSwitch( 613 parsed_command_line.HasSwitch(
619 installer_util::switches::kInactiveUserToast) || 614 installer_util::switches::kInactiveUserToast) ||
620 parsed_command_line.HasSwitch( 615 parsed_command_line.HasSwitch(
621 installer_util::switches::kSystemLevelToast)) { 616 installer_util::switches::kSystemLevelToast)) {
622 return installer_util::SXS_OPTION_NOT_SUPPORTED; 617 return installer_util::SXS_OPTION_NOT_SUPPORTED;
623 } 618 }
624 } 619 }
625 620
621 int exit_code = 0;
622 if (HandleNonInstallCmdLineOptions(parsed_command_line, system_install,
623 exit_code))
624 return exit_code;
625
626 if (system_install && !IsUserAnAdmin()) { 626 if (system_install && !IsUserAnAdmin()) {
627 if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA && 627 if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA &&
628 !parsed_command_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { 628 !parsed_command_line.HasSwitch(installer_util::switches::kRunAsAdmin)) {
629 std::wstring exe = parsed_command_line.program(); 629 std::wstring exe = parsed_command_line.program();
630 std::wstring params(command_line); 630 std::wstring params(command_line);
631 // Append --run-as-admin flag to let the new instance of setup.exe know 631 // Append --run-as-admin flag to let the new instance of setup.exe know
632 // that we already tried to launch ourselves as admin. 632 // that we already tried to launch ourselves as admin.
633 params.append(L" --"); 633 params.append(L" --");
634 params.append(installer_util::switches::kRunAsAdmin); 634 params.append(installer_util::switches::kRunAsAdmin);
635 DWORD exit_code = installer_util::UNKNOWN_STATUS; 635 DWORD exit_code = installer_util::UNKNOWN_STATUS;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 dist->GetApplicationName().c_str(), 681 dist->GetApplicationName().c_str(),
682 MB_OK); 682 MB_OK);
683 } 683 }
684 } 684 }
685 685
686 // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT 686 // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT
687 // to pass through, since this is only returned on uninstall which is never 687 // to pass through, since this is only returned on uninstall which is never
688 // invoked directly by Google Update. 688 // invoked directly by Google Update.
689 return dist->GetInstallReturnCode(install_status); 689 return dist->GetInstallReturnCode(install_status);
690 } 690 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698