OLD | NEW |
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 <shlobj.h> | 5 #include <shlobj.h> |
6 #include <time.h> | 6 #include <time.h> |
7 | 7 |
8 #include "chrome/installer/setup/install.h" | 8 #include "chrome/installer/setup/install.h" |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 uninstall_cmd.append(installer::GetInstallerPathUnderChrome(install_path, | 91 uninstall_cmd.append(installer::GetInstallerPathUnderChrome(install_path, |
92 new_version)); | 92 new_version)); |
93 file_util::AppendToPath(&uninstall_cmd, | 93 file_util::AppendToPath(&uninstall_cmd, |
94 file_util::GetFilenameFromPath(exe_path)); | 94 file_util::GetFilenameFromPath(exe_path)); |
95 uninstall_cmd.append(L"\" --"); | 95 uninstall_cmd.append(L"\" --"); |
96 uninstall_cmd.append(installer_util::switches::kUninstall); | 96 uninstall_cmd.append(installer_util::switches::kUninstall); |
97 | 97 |
98 #ifdef CHROME_EXP_BUILD | 98 #ifdef CHROME_EXP_BUILD |
99 uninstall_cmd.append(L" --"); | 99 uninstall_cmd.append(L" --"); |
100 uninstall_cmd.append(installer_util::switches::kForceUninstall); | 100 uninstall_cmd.append(installer_util::switches::kForceUninstall); |
| 101 uninstall_cmd.append(L" --"); |
| 102 uninstall_cmd.append(installer_util::switches::kDeleteProfile); |
101 #endif | 103 #endif |
102 | 104 |
103 if (reg_root == HKEY_LOCAL_MACHINE) { | 105 if (reg_root == HKEY_LOCAL_MACHINE) { |
104 uninstall_cmd.append(L" --"); | 106 uninstall_cmd.append(L" --"); |
105 uninstall_cmd.append(installer_util::switches::kSystemLevel); | 107 uninstall_cmd.append(installer_util::switches::kSystemLevel); |
106 } | 108 } |
107 | 109 |
108 // Create DisplayName, UninstallString and InstallLocation keys | 110 // Create DisplayName, UninstallString and InstallLocation keys |
109 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 111 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
110 std::wstring uninstall_reg = dist->GetUninstallRegPath(); | 112 std::wstring uninstall_reg = dist->GetUninstallRegPath(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 std::wstring setup_exe(installer::GetInstallerPathUnderChrome(install_path, | 242 std::wstring setup_exe(installer::GetInstallerPathUnderChrome(install_path, |
241 new_version)); | 243 new_version)); |
242 file_util::AppendToPath(&setup_exe, | 244 file_util::AppendToPath(&setup_exe, |
243 file_util::GetFilenameFromPath(exe_path)); | 245 file_util::GetFilenameFromPath(exe_path)); |
244 std::wstring arguments(L" --"); | 246 std::wstring arguments(L" --"); |
245 arguments.append(installer_util::switches::kUninstall); | 247 arguments.append(installer_util::switches::kUninstall); |
246 | 248 |
247 #ifdef CHROME_EXP_BUILD | 249 #ifdef CHROME_EXP_BUILD |
248 arguments.append(L" --"); | 250 arguments.append(L" --"); |
249 arguments.append(installer_util::switches::kForceUninstall); | 251 arguments.append(installer_util::switches::kForceUninstall); |
| 252 arguments.append(L" --"); |
| 253 arguments.append(installer_util::switches::kDeleteProfile); |
250 #endif | 254 #endif |
251 | 255 |
252 if (system_install) { | 256 if (system_install) { |
253 arguments.append(L" --"); | 257 arguments.append(L" --"); |
254 arguments.append(installer_util::switches::kSystemLevel); | 258 arguments.append(installer_util::switches::kSystemLevel); |
255 } | 259 } |
256 | 260 |
257 LOG(INFO) << "Creating/updating uninstall link at " | 261 LOG(INFO) << "Creating/updating uninstall link at " |
258 << uninstall_link.value(); | 262 << uninstall_link.value(); |
259 ret = ret && file_util::CreateShortcutLink(setup_exe.c_str(), | 263 ret = ret && file_util::CreateShortcutLink(setup_exe.c_str(), |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 } | 626 } |
623 | 627 |
624 std::wstring latest_version_to_keep(new_version.GetString()); | 628 std::wstring latest_version_to_keep(new_version.GetString()); |
625 if (!current_version.empty()) | 629 if (!current_version.empty()) |
626 latest_version_to_keep.assign(current_version); | 630 latest_version_to_keep.assign(current_version); |
627 RemoveOldVersionDirs(install_path, latest_version_to_keep); | 631 RemoveOldVersionDirs(install_path, latest_version_to_keep); |
628 } | 632 } |
629 | 633 |
630 return result; | 634 return result; |
631 } | 635 } |
OLD | NEW |