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 #include "chrome/installer/setup/install.h" | 5 #include "chrome/installer/setup/install.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 #include <time.h> | 8 #include <time.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 installer_state.target_path().Append(installer::kChromeExe)); | 124 installer_state.target_path().Append(installer::kChromeExe)); |
125 | 125 |
126 if ((install_status == installer::FIRST_INSTALL_SUCCESS) || | 126 if ((install_status == installer::FIRST_INSTALL_SUCCESS) || |
127 (install_status == installer::INSTALL_REPAIRED)) { | 127 (install_status == installer::INSTALL_REPAIRED)) { |
128 if (!file_util::PathExists(shortcut_path)) | 128 if (!file_util::PathExists(shortcut_path)) |
129 file_util::CreateDirectoryW(shortcut_path); | 129 file_util::CreateDirectoryW(shortcut_path); |
130 | 130 |
131 VLOG(1) << "Creating shortcut to " << chrome_exe.value() << " at " | 131 VLOG(1) << "Creating shortcut to " << chrome_exe.value() << " at " |
132 << chrome_link.value(); | 132 << chrome_link.value(); |
133 ret = ShellUtil::UpdateChromeShortcut(browser_dist, chrome_exe.value(), | 133 ret = ShellUtil::UpdateChromeShortcut(browser_dist, chrome_exe.value(), |
134 chrome_link.value(), product_desc, true); | 134 chrome_link.value(), L"", product_desc, true); |
135 } else if (file_util::PathExists(chrome_link)) { | 135 } else if (file_util::PathExists(chrome_link)) { |
136 VLOG(1) << "Updating shortcut at " << chrome_link.value() | 136 VLOG(1) << "Updating shortcut at " << chrome_link.value() |
137 << " to point to " << chrome_exe.value(); | 137 << " to point to " << chrome_exe.value(); |
138 ret = ShellUtil::UpdateChromeShortcut(browser_dist, chrome_exe.value(), | 138 ret = ShellUtil::UpdateChromeShortcut(browser_dist, chrome_exe.value(), |
139 chrome_link.value(), product_desc, false); | 139 chrome_link.value(), L"", product_desc, false); |
140 } else { | 140 } else { |
141 VLOG(1) | 141 VLOG(1) |
142 << "not first or repaired install, link file doesn't exist. status: " | 142 << "not first or repaired install, link file doesn't exist. status: " |
143 << install_status; | 143 << install_status; |
144 } | 144 } |
145 | 145 |
146 // Create/update uninstall link if we are not an MSI install. MSI | 146 // Create/update uninstall link if we are not an MSI install. MSI |
147 // installations are, for the time being, managed only through the | 147 // installations are, for the time being, managed only through the |
148 // Add/Remove Programs dialog. | 148 // Add/Remove Programs dialog. |
149 // TODO(robertshield): We could add a shortcut to msiexec /X {GUID} here. | 149 // TODO(robertshield): We could add a shortcut to msiexec /X {GUID} here. |
(...skipping 24 matching lines...) Expand all Loading... |
174 NULL); | 174 NULL); |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 // Update Desktop and Quick Launch shortcuts. If --create-new-shortcuts | 178 // Update Desktop and Quick Launch shortcuts. If --create-new-shortcuts |
179 // is specified we want to create them, otherwise we update them only if | 179 // is specified we want to create them, otherwise we update them only if |
180 // they exist. | 180 // they exist. |
181 if (ret) { | 181 if (ret) { |
182 if (installer_state.system_install()) { | 182 if (installer_state.system_install()) { |
183 ret = ShellUtil::CreateChromeDesktopShortcut(product.distribution(), | 183 ret = ShellUtil::CreateChromeDesktopShortcut(product.distribution(), |
184 chrome_exe.value(), product_desc, ShellUtil::SYSTEM_LEVEL, | 184 chrome_exe.value(), product_desc, L"", L"", ShellUtil::SYSTEM_LEVEL, |
185 alt_shortcut, create_all_shortcut); | 185 alt_shortcut, create_all_shortcut); |
186 if (ret) { | 186 if (ret) { |
187 ret = ShellUtil::CreateChromeQuickLaunchShortcut( | 187 ret = ShellUtil::CreateChromeQuickLaunchShortcut( |
188 product.distribution(), chrome_exe.value(), | 188 product.distribution(), chrome_exe.value(), |
189 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, | 189 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, |
190 create_all_shortcut); | 190 create_all_shortcut); |
191 } | 191 } |
192 } else { | 192 } else { |
193 ret = ShellUtil::CreateChromeDesktopShortcut(product.distribution(), | 193 ret = ShellUtil::CreateChromeDesktopShortcut(product.distribution(), |
194 chrome_exe.value(), product_desc, ShellUtil::CURRENT_USER, | 194 chrome_exe.value(), product_desc, L"", L"", ShellUtil::CURRENT_USER, |
195 alt_shortcut, create_all_shortcut); | 195 alt_shortcut, create_all_shortcut); |
196 if (ret) { | 196 if (ret) { |
197 ret = ShellUtil::CreateChromeQuickLaunchShortcut( | 197 ret = ShellUtil::CreateChromeQuickLaunchShortcut( |
198 product.distribution(), chrome_exe.value(), ShellUtil::CURRENT_USER, | 198 product.distribution(), chrome_exe.value(), ShellUtil::CURRENT_USER, |
199 create_all_shortcut); | 199 create_all_shortcut); |
200 } | 200 } |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 return ret; | 204 return ret; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 installer_state.RemoveOldVersionDirectories( | 421 installer_state.RemoveOldVersionDirectories( |
422 new_version, | 422 new_version, |
423 existing_version.get(), | 423 existing_version.get(), |
424 install_temp_path); | 424 install_temp_path); |
425 } | 425 } |
426 | 426 |
427 return result; | 427 return result; |
428 } | 428 } |
429 | 429 |
430 } // namespace installer | 430 } // namespace installer |
OLD | NEW |