OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 contains the definitions of the installer functions that build | 5 // This file contains the definitions of the installer functions that build |
6 // the WorkItemList used to install the application. | 6 // the WorkItemList used to install the application. |
7 | 7 |
8 #include "chrome/installer/setup/install_worker.h" | 8 #include "chrome/installer/setup/install_worker.h" |
9 | 9 |
10 #include <oaidl.h> | 10 #include <oaidl.h> |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
22 #include "base/path_service.h" | 22 #include "base/path_service.h" |
23 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
25 #include "base/version.h" | 25 #include "base/version.h" |
26 #include "base/win/registry.h" | 26 #include "base/win/registry.h" |
27 #include "base/win/scoped_comptr.h" | 27 #include "base/win/scoped_comptr.h" |
28 #include "base/win/windows_version.h" | 28 #include "base/win/windows_version.h" |
29 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/installer/setup/app_launcher_installer.h" | |
31 #include "chrome/installer/setup/install.h" | 32 #include "chrome/installer/setup/install.h" |
32 #include "chrome/installer/setup/setup_constants.h" | 33 #include "chrome/installer/setup/setup_constants.h" |
33 #include "chrome/installer/setup/setup_util.h" | 34 #include "chrome/installer/setup/setup_util.h" |
34 #include "chrome/installer/util/app_registration_data.h" | 35 #include "chrome/installer/util/app_registration_data.h" |
35 #include "chrome/installer/util/browser_distribution.h" | 36 #include "chrome/installer/util/browser_distribution.h" |
36 #include "chrome/installer/util/callback_work_item.h" | 37 #include "chrome/installer/util/callback_work_item.h" |
37 #include "chrome/installer/util/conditional_work_item_list.h" | 38 #include "chrome/installer/util/conditional_work_item_list.h" |
38 #include "chrome/installer/util/create_reg_key_work_item.h" | 39 #include "chrome/installer/util/create_reg_key_work_item.h" |
39 #include "chrome/installer/util/firewall_manager_win.h" | 40 #include "chrome/installer/util/firewall_manager_win.h" |
40 #include "chrome/installer/util/google_update_constants.h" | 41 #include "chrome/installer/util/google_update_constants.h" |
41 #include "chrome/installer/util/helper.h" | 42 #include "chrome/installer/util/helper.h" |
42 #include "chrome/installer/util/install_util.h" | 43 #include "chrome/installer/util/install_util.h" |
43 #include "chrome/installer/util/installation_state.h" | 44 #include "chrome/installer/util/installation_state.h" |
44 #include "chrome/installer/util/installer_state.h" | 45 #include "chrome/installer/util/installer_state.h" |
45 #include "chrome/installer/util/l10n_string_util.h" | 46 #include "chrome/installer/util/l10n_string_util.h" |
46 #include "chrome/installer/util/product.h" | 47 #include "chrome/installer/util/product.h" |
47 #include "chrome/installer/util/set_reg_value_work_item.h" | 48 #include "chrome/installer/util/set_reg_value_work_item.h" |
48 #include "chrome/installer/util/shell_util.h" | 49 #include "chrome/installer/util/shell_util.h" |
49 #include "chrome/installer/util/updating_app_registration_data.h" | |
50 #include "chrome/installer/util/util_constants.h" | 50 #include "chrome/installer/util/util_constants.h" |
51 #include "chrome/installer/util/work_item_list.h" | 51 #include "chrome/installer/util/work_item_list.h" |
52 | 52 |
53 using base::ASCIIToUTF16; | 53 using base::ASCIIToUTF16; |
54 using base::win::RegKey; | 54 using base::win::RegKey; |
55 | 55 |
56 namespace installer { | 56 namespace installer { |
57 | 57 |
58 namespace { | 58 namespace { |
59 | 59 |
60 // The version identifying the work done by setup.exe --configure-user-settings | 60 // The version identifying the work done by setup.exe --configure-user-settings |
61 // on user login by way of Active Setup. Increase this value if the work done | 61 // on user login by way of Active Setup. Increase this value if the work done |
62 // in setup_main.cc's handling of kConfigureUserSettings changes and should be | 62 // in setup_main.cc's handling of kConfigureUserSettings changes and should be |
63 // executed again for all users. | 63 // executed again for all users. |
64 const wchar_t kActiveSetupVersion[] = L"24,0,0,0"; | 64 const wchar_t kActiveSetupVersion[] = L"24,0,0,0"; |
65 | 65 |
66 // Although the UUID of the ChromeFrame class is used for the "current" value, | 66 // Although the UUID of the ChromeFrame class is used for the "current" value, |
67 // this is done only as a convenience; there is no need for the GUID of the Low | 67 // this is done only as a convenience; there is no need for the GUID of the Low |
68 // Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to | 68 // Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to |
69 // use this completely unrelated GUID for the "old" policies. | 69 // use this completely unrelated GUID for the "old" policies. |
70 const wchar_t kIELowRightsPolicyOldGuid[] = | 70 const wchar_t kIELowRightsPolicyOldGuid[] = |
71 L"{6C288DD7-76FB-4721-B628-56FAC252E199}"; | 71 L"{6C288DD7-76FB-4721-B628-56FAC252E199}"; |
72 | 72 |
73 const wchar_t kElevationPolicyKeyPath[] = | 73 const wchar_t kElevationPolicyKeyPath[] = |
74 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; | 74 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; |
75 | 75 |
76 // The legacy command ids for installing an application or extension. These are | |
77 // only here so they can be removed from the registry. | |
78 const wchar_t kLegacyCmdInstallApp[] = L"install-application"; | |
79 const wchar_t kLegacyCmdInstallExtension[] = L"install-extension"; | |
80 | |
81 void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { | 76 void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { |
82 key_path->assign(kElevationPolicyKeyPath, | 77 key_path->assign(kElevationPolicyKeyPath, |
83 arraysize(kElevationPolicyKeyPath) - 1); | 78 arraysize(kElevationPolicyKeyPath) - 1); |
84 key_path->append(kIELowRightsPolicyOldGuid, | 79 key_path->append(kIELowRightsPolicyOldGuid, |
85 arraysize(kIELowRightsPolicyOldGuid)- 1); | 80 arraysize(kIELowRightsPolicyOldGuid)- 1); |
86 } | 81 } |
87 | 82 |
88 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of | 83 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of |
89 // products managed by a given package. | 84 // products managed by a given package. |
90 // |old_version| can be NULL to indicate no Chrome is currently installed. | 85 // |old_version| can be NULL to indicate no Chrome is currently installed. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 143 |
149 if (installer_state.RequiresActiveSetup()) { | 144 if (installer_state.RequiresActiveSetup()) { |
150 // Make a copy of setup.exe with a different name so that Active Setup | 145 // Make a copy of setup.exe with a different name so that Active Setup |
151 // doesn't require an admin on XP thanks to Application Compatibility. | 146 // doesn't require an admin on XP thanks to Application Compatibility. |
152 base::FilePath active_setup_exe(installer_dir.Append(kActiveSetupExe)); | 147 base::FilePath active_setup_exe(installer_dir.Append(kActiveSetupExe)); |
153 install_list->AddCopyTreeWorkItem( | 148 install_list->AddCopyTreeWorkItem( |
154 setup_path.value(), active_setup_exe.value(), temp_path.value(), | 149 setup_path.value(), active_setup_exe.value(), temp_path.value(), |
155 WorkItem::ALWAYS); | 150 WorkItem::ALWAYS); |
156 } | 151 } |
157 | 152 |
158 // If only the App Host (not even the Chrome Binaries) is being installed, | 153 // TODO(huangs): remove the following comments (after review). |
159 // this must be a user-level App Host piggybacking on system-level Chrome | 154 // Reverting https://chromiumcodereview.appspot.com/11412015 |
160 // Binaries. Only setup.exe is required, and only for uninstall. | 155 // but keeping https://chromiumcodereview.appspot.com/12051069 |
161 if (installer_state.products().size() != 1 || | 156 base::FilePath archive_dst(installer_dir.Append(archive_path.BaseName())); |
162 !installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) { | 157 if (archive_path != archive_dst) { |
163 base::FilePath archive_dst(installer_dir.Append(archive_path.BaseName())); | 158 // In the past, we copied rather than moved for system level installs so |
164 if (archive_path != archive_dst) { | 159 // that the permissions of %ProgramFiles% would be picked up. Now that |
165 // In the past, we copied rather than moved for system level installs so | 160 // |temp_path| is in %ProgramFiles% for system level installs (and in |
166 // that the permissions of %ProgramFiles% would be picked up. Now that | 161 // %LOCALAPPDATA% otherwise), there is no need to do this for the archive. |
167 // |temp_path| is in %ProgramFiles% for system level installs (and in | 162 // Setup.exe, on the other hand, is created elsewhere so it must always be |
168 // %LOCALAPPDATA% otherwise), there is no need to do this for the archive. | 163 // copied. |
169 // Setup.exe, on the other hand, is created elsewhere so it must always be | 164 if (temp_path.IsParent(archive_path)) { |
170 // copied. | 165 install_list->AddMoveTreeWorkItem(archive_path.value(), |
171 if (temp_path.IsParent(archive_path)) { | 166 archive_dst.value(), |
172 install_list->AddMoveTreeWorkItem(archive_path.value(), | 167 temp_path.value(), |
173 archive_dst.value(), | 168 WorkItem::ALWAYS_MOVE); |
174 temp_path.value(), | 169 } else { |
175 WorkItem::ALWAYS_MOVE); | 170 // This may occur when setup is run out of an existing installation |
176 } else { | 171 // directory. We cannot remove the system-level archive. |
177 // This may occur when setup is run out of an existing installation | 172 install_list->AddCopyTreeWorkItem(archive_path.value(), |
178 // directory. For example, when quick-enabling user-level App Launcher | 173 archive_dst.value(), |
179 // from system-level Binaries. We can't (and don't want to) remove the | 174 temp_path.value(), |
180 // system-level archive. | 175 WorkItem::ALWAYS); |
181 install_list->AddCopyTreeWorkItem(archive_path.value(), | |
182 archive_dst.value(), | |
183 temp_path.value(), | |
184 WorkItem::ALWAYS); | |
185 } | |
186 } | 176 } |
187 } | 177 } |
188 } | 178 } |
189 | 179 |
190 base::string16 GetRegCommandKey(BrowserDistribution* dist, | 180 base::string16 GetRegCommandKey(BrowserDistribution* dist, |
191 const wchar_t* name) { | 181 const wchar_t* name) { |
192 return GetRegistrationDataCommandKey(dist->GetAppRegistrationData(), name); | 182 return GetRegistrationDataCommandKey(dist->GetAppRegistrationData(), name); |
193 } | 183 } |
194 | 184 |
195 // Adds work items to create (or delete if uninstalling) app commands to launch | 185 // Adds work items to create (or delete if uninstalling) app commands to launch |
(...skipping 29 matching lines...) Expand all Loading... | |
225 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); | 215 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); |
226 | 216 |
227 AppCommand cmd(cmd_line.GetCommandLineString()); | 217 AppCommand cmd(cmd_line.GetCommandLineString()); |
228 cmd.set_sends_pings(true); | 218 cmd.set_sends_pings(true); |
229 cmd.set_is_web_accessible(true); | 219 cmd.set_is_web_accessible(true); |
230 cmd.set_is_run_as_user(true); | 220 cmd.set_is_run_as_user(true); |
231 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); | 221 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); |
232 } | 222 } |
233 } | 223 } |
234 | 224 |
235 void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state, | |
236 const AppRegistrationData& reg_data, | |
237 const wchar_t* name, | |
238 WorkItemList* work_item_list) { | |
239 // These failures are ignored because this is a clean-up operation that | |
240 // shouldn't block an install or update on failing. | |
241 work_item_list->AddDeleteRegKeyWorkItem( | |
242 installer_state.root_key(), | |
243 GetRegistrationDataCommandKey(reg_data, name), | |
244 KEY_WOW64_32KEY)->set_ignore_failure(true); | |
245 } | |
246 | |
247 // A callback invoked by |work_item| that adds firewall rules for Chrome. Rules | 225 // A callback invoked by |work_item| that adds firewall rules for Chrome. Rules |
248 // are left in-place on rollback unless |remove_on_rollback| is true. This is | 226 // are left in-place on rollback unless |remove_on_rollback| is true. This is |
249 // the case for new installs only. Updates and overinstalls leave the rule | 227 // the case for new installs only. Updates and overinstalls leave the rule |
250 // in-place on rollback since a previous install of Chrome will be used in that | 228 // in-place on rollback since a previous install of Chrome will be used in that |
251 // case. | 229 // case. |
252 bool AddFirewallRulesCallback(bool system_level, | 230 bool AddFirewallRulesCallback(bool system_level, |
253 BrowserDistribution* dist, | 231 BrowserDistribution* dist, |
254 const base::FilePath& chrome_path, | 232 const base::FilePath& chrome_path, |
255 bool remove_on_rollback, | 233 bool remove_on_rollback, |
256 const CallbackWorkItem& work_item) { | 234 const CallbackWorkItem& work_item) { |
(...skipping 28 matching lines...) Expand all Loading... | |
285 bool is_new_install, | 263 bool is_new_install, |
286 WorkItemList* list) { | 264 WorkItemList* list) { |
287 list->AddCallbackWorkItem( | 265 list->AddCallbackWorkItem( |
288 base::Bind(&AddFirewallRulesCallback, | 266 base::Bind(&AddFirewallRulesCallback, |
289 installer_state.system_install(), | 267 installer_state.system_install(), |
290 dist, | 268 dist, |
291 installer_state.target_path().Append(kChromeExe), | 269 installer_state.target_path().Append(kChromeExe), |
292 is_new_install)); | 270 is_new_install)); |
293 } | 271 } |
294 | 272 |
295 // Returns the basic CommandLine to setup.exe for a quick-enable operation on | |
296 // the binaries. This will unconditionally include --multi-install as well as | |
297 // --verbose-logging if the current installation was launched with | |
298 // --verbose-logging. |setup_path| and |new_version| are optional only when | |
299 // the operation is an uninstall. | |
300 CommandLine GetGenericQuickEnableCommand( | |
301 const InstallerState& installer_state, | |
302 const InstallationState& machine_state, | |
303 const base::FilePath& setup_path, | |
304 const Version& new_version) { | |
305 // Only valid for multi-install operations. | |
306 DCHECK(installer_state.is_multi_install()); | |
307 // Only valid when Chrome Binaries aren't being uninstalled. | |
308 DCHECK(installer_state.operation() != InstallerState::UNINSTALL || | |
309 !installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES)); | |
310 // setup_path and new_version are required when not uninstalling. | |
311 DCHECK(installer_state.operation() == InstallerState::UNINSTALL || | |
312 (!setup_path.empty() && new_version.IsValid())); | |
313 | |
314 // The path to setup.exe contains the version of the Chrome Binaries, so it | |
315 // takes a little work to get it right. | |
316 base::FilePath binaries_setup_path; | |
317 if (installer_state.operation() == InstallerState::UNINSTALL) { | |
318 // One or more products are being uninstalled, but not Chrome Binaries. | |
319 // Use the path to the currently installed Chrome Binaries' setup.exe. | |
320 const ProductState* product_state = machine_state.GetProductState( | |
321 installer_state.system_install(), | |
322 BrowserDistribution::CHROME_BINARIES); | |
323 DCHECK(product_state); | |
324 binaries_setup_path = product_state->uninstall_command().GetProgram(); | |
325 } else { | |
326 // Chrome Binaries are being installed, updated, or otherwise operated on. | |
327 // Use the path to the given |setup_path| in the normal location of | |
328 // multi-install Chrome Binaries of the given |version|. | |
329 binaries_setup_path = installer_state.GetInstallerDirectory(new_version) | |
330 .Append(setup_path.BaseName()); | |
331 } | |
332 DCHECK(!binaries_setup_path.empty()); | |
333 | |
334 CommandLine cmd_line(binaries_setup_path); | |
335 cmd_line.AppendSwitch(switches::kMultiInstall); | |
336 if (installer_state.verbose_logging()) | |
337 cmd_line.AppendSwitch(switches::kVerboseLogging); | |
338 return cmd_line; | |
339 } | |
340 | |
341 // Adds work items to add the "quick-enable-application-host" command to the | |
342 // multi-installer binaries' version key on the basis of the current operation | |
343 // (represented in |installer_state|) and the pre-existing machine configuration | |
344 // (represented in |machine_state|). | |
345 void AddQuickEnableApplicationLauncherWorkItems( | |
346 const InstallerState& installer_state, | |
347 const InstallationState& machine_state, | |
348 const base::FilePath& setup_path, | |
349 const Version& new_version, | |
350 WorkItemList* work_item_list) { | |
351 DCHECK(work_item_list); | |
352 | |
353 bool will_have_chrome_binaries = | |
354 WillProductBePresentAfterSetup(installer_state, machine_state, | |
355 BrowserDistribution::CHROME_BINARIES); | |
356 | |
357 // For system-level binaries there is no way to keep the command state in sync | |
358 // with the installation/uninstallation of the Application Launcher (which is | |
359 // always at user-level). So we do not try to remove the command, i.e., it | |
360 // will always be installed if the Chrome Binaries are installed. | |
361 if (will_have_chrome_binaries) { | |
362 base::string16 cmd_key( | |
363 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( | |
364 BrowserDistribution::CHROME_BINARIES), | |
365 kCmdQuickEnableApplicationHost)); | |
366 CommandLine cmd_line(GetGenericQuickEnableCommand(installer_state, | |
367 machine_state, | |
368 setup_path, | |
369 new_version)); | |
370 // kMultiInstall and kVerboseLogging were processed above. | |
371 cmd_line.AppendSwitch(switches::kChromeAppLauncher); | |
372 cmd_line.AppendSwitch(switches::kEnsureGoogleUpdatePresent); | |
373 AppCommand cmd(cmd_line.GetCommandLineString()); | |
374 cmd.set_sends_pings(true); | |
375 cmd.set_is_web_accessible(true); | |
376 cmd.set_is_run_as_user(true); | |
377 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); | |
378 } | |
379 } | |
380 | |
381 void AddProductSpecificWorkItems(const InstallationState& original_state, | 273 void AddProductSpecificWorkItems(const InstallationState& original_state, |
382 const InstallerState& installer_state, | 274 const InstallerState& installer_state, |
383 const base::FilePath& setup_path, | 275 const base::FilePath& setup_path, |
384 const Version& new_version, | 276 const Version& new_version, |
385 bool is_new_install, | 277 bool is_new_install, |
386 WorkItemList* list) { | 278 WorkItemList* list) { |
387 const Products& products = installer_state.products(); | 279 const Products& products = installer_state.products(); |
388 for (Products::const_iterator it = products.begin(); it < products.end(); | 280 for (Products::const_iterator it = products.begin(); it < products.end(); |
389 ++it) { | 281 ++it) { |
390 const Product& p = **it; | 282 const Product& p = **it; |
391 if (p.is_chrome()) { | 283 if (p.is_chrome()) { |
392 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, | 284 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
393 list); | 285 list); |
394 AddFirewallRulesWorkItems( | 286 AddFirewallRulesWorkItems( |
395 installer_state, p.distribution(), is_new_install, list); | 287 installer_state, p.distribution(), is_new_install, list); |
396 AddLegacyAppCommandRemovalItem( | |
397 installer_state, | |
398 p.distribution()->GetAppRegistrationData(), | |
399 kLegacyCmdInstallExtension, | |
400 list); | |
401 | |
402 if (p.distribution()->AppHostIsSupported()) { | |
403 // Unconditionally remove the "install-application" command from the app | |
404 // hosts's key. | |
405 UpdatingAppRegistrationData app_launcher_reg_data( | |
406 installer::kAppLauncherGuid); | |
407 AddLegacyAppCommandRemovalItem(installer_state, app_launcher_reg_data, | |
408 kLegacyCmdInstallApp, list); | |
409 } | |
410 } | 288 } |
411 if (p.is_chrome_binaries()) { | 289 if (p.is_chrome_binaries()) { |
412 AddQueryEULAAcceptanceWorkItems( | 290 AddQueryEULAAcceptanceWorkItems( |
413 installer_state, setup_path, new_version, p, list); | 291 installer_state, setup_path, new_version, p, list); |
414 AddQuickEnableChromeFrameWorkItems(installer_state, list); | 292 AddQuickEnableChromeFrameWorkItems(installer_state, list); |
415 AddQuickEnableApplicationLauncherWorkItems( | |
416 installer_state, original_state, setup_path, new_version, list); | |
417 } | 293 } |
418 } | 294 } |
295 AppLauncherInstaller::RemoveLegacyAppCommandsWorkItems(installer_state, list); | |
grt (UTC plus 2)
2014/12/18 19:27:36
this isn't a product-specific item if it isn't don
huangs
2015/01/05 06:01:12
Moved.
| |
419 } | 296 } |
420 | 297 |
421 // This is called when an MSI installation is run. It may be that a user is | 298 // This is called when an MSI installation is run. It may be that a user is |
422 // attempting to install the MSI on top of a non-MSI managed installation. | 299 // attempting to install the MSI on top of a non-MSI managed installation. |
423 // If so, try and remove any existing uninstallation shortcuts, as we want the | 300 // If so, try and remove any existing uninstallation shortcuts, as we want the |
424 // uninstall to be managed entirely by the MSI machinery (accessible via the | 301 // uninstall to be managed entirely by the MSI machinery (accessible via the |
425 // Add/Remove programs dialog). | 302 // Add/Remove programs dialog). |
426 void AddDeleteUninstallShortcutsForMSIWorkItems( | 303 void AddDeleteUninstallShortcutsForMSIWorkItems( |
427 const InstallerState& installer_state, | 304 const InstallerState& installer_state, |
428 const Product& product, | 305 const Product& product, |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1264 installer_state, | 1141 installer_state, |
1265 setup_path, | 1142 setup_path, |
1266 archive_path, | 1143 archive_path, |
1267 src_path, | 1144 src_path, |
1268 temp_path, | 1145 temp_path, |
1269 current_version, | 1146 current_version, |
1270 new_version, | 1147 new_version, |
1271 install_list); | 1148 install_list); |
1272 } | 1149 } |
1273 | 1150 |
1274 if (installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) { | |
grt (UTC plus 2)
2014/12/18 19:27:36
this could be a good place for something like
//
huangs
2015/01/05 06:01:12
Done.
| |
1275 install_list->AddCopyTreeWorkItem( | |
1276 src_path.Append(installer::kChromeAppHostExe).value(), | |
1277 target_path.Append(installer::kChromeAppHostExe).value(), | |
1278 temp_path.value(), | |
1279 WorkItem::ALWAYS, | |
1280 L""); | |
1281 } | |
1282 | |
1283 // Copy installer in install directory | 1151 // Copy installer in install directory |
1284 AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path, | 1152 AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path, |
1285 new_version, install_list); | 1153 new_version, install_list); |
1286 | 1154 |
1287 const HKEY root = installer_state.root_key(); | 1155 const HKEY root = installer_state.root_key(); |
1288 // Only set "lang" for user-level installs since for system-level, the install | 1156 // Only set "lang" for user-level installs since for system-level, the install |
1289 // language may not be related to a given user's runtime language. | 1157 // language may not be related to a given user's runtime language. |
1290 const bool add_language_identifier = !installer_state.system_install(); | 1158 const bool add_language_identifier = !installer_state.system_install(); |
1291 | 1159 |
1292 const Products& products = installer_state.products(); | 1160 const Products& products = installer_state.products(); |
(...skipping 12 matching lines...) Expand all Loading... | |
1305 add_language_identifier, | 1173 add_language_identifier, |
1306 install_list); | 1174 install_list); |
1307 | 1175 |
1308 AddDelegateExecuteWorkItems(installer_state, target_path, new_version, | 1176 AddDelegateExecuteWorkItems(installer_state, target_path, new_version, |
1309 product, install_list); | 1177 product, install_list); |
1310 | 1178 |
1311 AddActiveSetupWorkItems(installer_state, setup_path, new_version, product, | 1179 AddActiveSetupWorkItems(installer_state, setup_path, new_version, product, |
1312 install_list); | 1180 install_list); |
1313 } | 1181 } |
1314 | 1182 |
1315 // TODO(huangs): Implement actual migration code and remove the hack below. | 1183 // For Chrome, add "shadow" App Launcher Client keys so Google Update can |
1316 // If installing Chrome without the legacy stand-alone App Launcher (to be | 1184 // recognize the "dr" value in the App Launcher ClientState key. |
1317 // handled later), add "shadow" App Launcher registry keys so Google Update | 1185 // Checking .is_multi_install() excludes Chrome Canary and Chromium. |
grt (UTC plus 2)
2014/12/18 19:27:36
the presence or absence of the app launcher's Clie
huangs
2015/01/05 06:01:12
Done.
| |
1318 // would recognize the "dr" value in the App Launcher ClientState key. | |
1319 // Checking .is_multi_install() excludes Chrome Canary and stand-alone Chrome. | |
1320 if (installer_state.is_multi_install() && | 1186 if (installer_state.is_multi_install() && |
1321 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) && | 1187 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER)) { |
1322 !installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) { | 1188 AppLauncherInstaller::AddAppLauncherVersionKeyWorkItems( |
1323 BrowserDistribution* shadow_app_launcher_dist = | 1189 root, new_version, add_language_identifier, install_list); |
1324 BrowserDistribution::GetSpecificDistribution( | |
1325 BrowserDistribution::CHROME_APP_HOST); | |
1326 AddVersionKeyWorkItems(root, | |
1327 shadow_app_launcher_dist->GetVersionKey(), | |
1328 shadow_app_launcher_dist->GetDisplayName(), | |
1329 new_version, | |
1330 add_language_identifier, | |
1331 install_list); | |
1332 } | 1190 } |
1333 | 1191 |
1334 // Add any remaining work items that involve special settings for | 1192 // Add any remaining work items that involve special settings for |
1335 // each product. | 1193 // each product. |
1336 AddProductSpecificWorkItems(original_state, | 1194 AddProductSpecificWorkItems(original_state, |
1337 installer_state, | 1195 installer_state, |
1338 setup_path, | 1196 setup_path, |
1339 new_version, | 1197 new_version, |
1340 current_version == NULL, | 1198 current_version == NULL, |
1341 install_list); | 1199 install_list); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1653 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1511 // Unconditionally remove the legacy Quick Enable command from the binaries. |
1654 // Do this even if multi-install Chrome isn't installed to ensure that it is | 1512 // Do this even if multi-install Chrome isn't installed to ensure that it is |
1655 // not left behind in any case. | 1513 // not left behind in any case. |
1656 work_item_list->AddDeleteRegKeyWorkItem( | 1514 work_item_list->AddDeleteRegKeyWorkItem( |
1657 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) | 1515 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) |
1658 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + | 1516 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + |
1659 " command"); | 1517 " command"); |
1660 } | 1518 } |
1661 | 1519 |
1662 } // namespace installer | 1520 } // namespace installer |
OLD | NEW |