OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file defines specific implementation of BrowserDistribution class for | 5 // This file defines specific implementation of BrowserDistribution class for |
6 // Google Chrome. | 6 // Google Chrome. |
7 | 7 |
8 #include "chrome/installer/util/google_chrome_distribution.h" | 8 #include "chrome/installer/util/google_chrome_distribution.h" |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
11 #include <wtsapi32.h> | 11 #include <wtsapi32.h> |
12 #include <msi.h> | 12 #include <msi.h> |
13 #include <sddl.h> | 13 #include <sddl.h> |
14 | 14 |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/rand_util.h" | 19 #include "base/rand_util.h" |
| 20 #include "base/string_number_conversions.h" |
20 #include "base/string_split.h" | 21 #include "base/string_split.h" |
21 #include "base/string_number_conversions.h" | |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
| 23 #include "base/stringprintf.h" |
23 #include "base/utf_string_conversions.h" | 24 #include "base/utf_string_conversions.h" |
24 #include "base/win/registry.h" | 25 #include "base/win/registry.h" |
25 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
26 #include "chrome/common/attrition_experiments.h" | 27 #include "chrome/common/attrition_experiments.h" |
27 #include "chrome/common/chrome_result_codes.h" | 28 #include "chrome/common/chrome_result_codes.h" |
28 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
30 #include "chrome/installer/util/channel_info.h" | 31 #include "chrome/installer/util/channel_info.h" |
31 #include "chrome/installer/util/product.h" | 32 #include "chrome/installer/util/product.h" |
32 #include "chrome/installer/util/install_util.h" | 33 #include "chrome/installer/util/install_util.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // It would be nice to send the locale, too, but I don't see an | 357 // It would be nice to send the locale, too, but I don't see an |
357 // easy way to get that in the existing code. It's something we | 358 // easy way to get that in the existing code. It's something we |
358 // can add later, if needed. | 359 // can add later, if needed. |
359 // We depend on installed_version.GetString() not having spaces or other | 360 // We depend on installed_version.GetString() not having spaces or other |
360 // characters that need escaping: 0.2.13.4. Should that change, we will | 361 // characters that need escaping: 0.2.13.4. Should that change, we will |
361 // need to escape the string before using it in a URL. | 362 // need to escape the string before using it in a URL. |
362 const std::wstring kVersionParam = L"crversion"; | 363 const std::wstring kVersionParam = L"crversion"; |
363 const std::wstring kOSParam = L"os"; | 364 const std::wstring kOSParam = L"os"; |
364 base::win::OSInfo::VersionNumber version_number = | 365 base::win::OSInfo::VersionNumber version_number = |
365 base::win::OSInfo::GetInstance()->version_number(); | 366 base::win::OSInfo::GetInstance()->version_number(); |
366 std::wstring os_version = StringPrintf(L"%d.%d.%d", version_number.major, | 367 std::wstring os_version = base::StringPrintf(L"%d.%d.%d", |
367 version_number.minor, version_number.build); | 368 version_number.major, version_number.minor, version_number.build); |
368 | 369 |
369 FilePath iexplore; | 370 FilePath iexplore; |
370 if (!PathService::Get(base::DIR_PROGRAM_FILES, &iexplore)) | 371 if (!PathService::Get(base::DIR_PROGRAM_FILES, &iexplore)) |
371 return; | 372 return; |
372 | 373 |
373 iexplore = iexplore.AppendASCII("Internet Explorer"); | 374 iexplore = iexplore.AppendASCII("Internet Explorer"); |
374 iexplore = iexplore.AppendASCII("iexplore.exe"); | 375 iexplore = iexplore.AppendASCII("iexplore.exe"); |
375 | 376 |
376 std::wstring command = iexplore.value() + L" " + GetUninstallSurveyUrl() + | 377 std::wstring command = iexplore.value() + L" " + GetUninstallSurveyUrl() + |
377 L"&" + kVersionParam + L"=" + UTF8ToWide(version.GetString()) + L"&" + | 378 L"&" + kVersionParam + L"=" + UTF8ToWide(version.GetString()) + L"&" + |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 // we waited for chrome to exit so the uninstall would not detect chrome | 801 // we waited for chrome to exit so the uninstall would not detect chrome |
801 // running. | 802 // running. |
802 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( | 803 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( |
803 installer::switches::kSystemLevelToast); | 804 installer::switches::kSystemLevelToast); |
804 | 805 |
805 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, | 806 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, |
806 GetType())); | 807 GetType())); |
807 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 808 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
808 } | 809 } |
809 #endif | 810 #endif |
OLD | NEW |