OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
Mark Mentovai
2011/05/23 00:23:52
I haven’t reviewed this file.
| |
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 <windows.h> | 5 #include <windows.h> |
6 #include <msi.h> | 6 #include <msi.h> |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
841 // be used when setup.exe is launched with admin rights. We do not | 841 // be used when setup.exe is launched with admin rights. We do not |
842 // make any user specific changes in this option. | 842 // make any user specific changes in this option. |
843 std::wstring chrome_exe(cmd_line.GetSwitchValueNative( | 843 std::wstring chrome_exe(cmd_line.GetSwitchValueNative( |
844 installer::switches::kRegisterChromeBrowser)); | 844 installer::switches::kRegisterChromeBrowser)); |
845 std::wstring suffix; | 845 std::wstring suffix; |
846 if (cmd_line.HasSwitch( | 846 if (cmd_line.HasSwitch( |
847 installer::switches::kRegisterChromeBrowserSuffix)) { | 847 installer::switches::kRegisterChromeBrowserSuffix)) { |
848 suffix = cmd_line.GetSwitchValueNative( | 848 suffix = cmd_line.GetSwitchValueNative( |
849 installer::switches::kRegisterChromeBrowserSuffix); | 849 installer::switches::kRegisterChromeBrowserSuffix); |
850 } | 850 } |
851 *exit_code = ShellUtil::RegisterChromeBrowser( | 851 if (cmd_line.HasSwitch( |
852 chrome_install->distribution(), chrome_exe, suffix, false); | 852 installer::switches::kRegisterURLProtocol)) { |
853 std::wstring protocol = cmd_line.GetSwitchValueNative( | |
854 installer::switches::kRegisterURLProtocol); | |
855 *exit_code = ShellUtil::RegisterChromeForProtocol( | |
856 chrome_install->distribution(), chrome_exe, suffix, protocol, | |
857 false); | |
858 } else { | |
859 *exit_code = ShellUtil::RegisterChromeBrowser( | |
860 chrome_install->distribution(), chrome_exe, suffix, false); | |
861 } | |
853 } else { | 862 } else { |
854 LOG(DFATAL) << "Can't register browser - Chrome distribution not found"; | 863 LOG(DFATAL) << "Can't register browser - Chrome distribution not found"; |
855 *exit_code = installer::UNKNOWN_STATUS; | 864 *exit_code = installer::UNKNOWN_STATUS; |
856 } | 865 } |
857 } else if (cmd_line.HasSwitch(installer::switches::kRenameChromeExe)) { | 866 } else if (cmd_line.HasSwitch(installer::switches::kRenameChromeExe)) { |
858 // If --rename-chrome-exe is specified, we want to rename the executables | 867 // If --rename-chrome-exe is specified, we want to rename the executables |
859 // and exit. | 868 // and exit. |
860 *exit_code = RenameChromeExecutables(original_state, installer_state); | 869 *exit_code = RenameChromeExecutables(original_state, installer_state); |
861 } else if (cmd_line.HasSwitch( | 870 } else if (cmd_line.HasSwitch( |
862 installer::switches::kRemoveChromeRegistration)) { | 871 installer::switches::kRemoveChromeRegistration)) { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1208 if (!(installer_state.is_msi() && is_uninstall)) | 1217 if (!(installer_state.is_msi() && is_uninstall)) |
1209 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1218 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1210 // to pass through, since this is only returned on uninstall which is | 1219 // to pass through, since this is only returned on uninstall which is |
1211 // never invoked directly by Google Update. | 1220 // never invoked directly by Google Update. |
1212 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1221 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1213 | 1222 |
1214 VLOG(1) << "Installation complete, returning: " << return_code; | 1223 VLOG(1) << "Installation complete, returning: " << return_code; |
1215 | 1224 |
1216 return return_code; | 1225 return return_code; |
1217 } | 1226 } |
OLD | NEW |