| 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 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/installer/util/install_util.h" | 41 #include "chrome/installer/util/install_util.h" |
| 42 #include "chrome/installer/util/installation_state.h" | 42 #include "chrome/installer/util/installation_state.h" |
| 43 #include "chrome/installer/util/installer_state.h" | 43 #include "chrome/installer/util/installer_state.h" |
| 44 #include "chrome/installer/util/l10n_string_util.h" | 44 #include "chrome/installer/util/l10n_string_util.h" |
| 45 #include "chrome/installer/util/product.h" | 45 #include "chrome/installer/util/product.h" |
| 46 #include "chrome/installer/util/set_reg_value_work_item.h" | 46 #include "chrome/installer/util/set_reg_value_work_item.h" |
| 47 #include "chrome/installer/util/shell_util.h" | 47 #include "chrome/installer/util/shell_util.h" |
| 48 #include "chrome/installer/util/util_constants.h" | 48 #include "chrome/installer/util/util_constants.h" |
| 49 #include "chrome/installer/util/work_item_list.h" | 49 #include "chrome/installer/util/work_item_list.h" |
| 50 | 50 |
| 51 #if !defined(OMIT_CHROME_FRAME) | |
| 52 #include "chrome_frame/chrome_tab.h" | |
| 53 #endif | |
| 54 | |
| 55 using base::ASCIIToWide; | 51 using base::ASCIIToWide; |
| 56 using base::win::RegKey; | 52 using base::win::RegKey; |
| 57 | 53 |
| 58 namespace installer { | 54 namespace installer { |
| 59 | 55 |
| 60 namespace { | 56 namespace { |
| 61 | 57 |
| 62 enum ElevationPolicyId { | |
| 63 CURRENT_ELEVATION_POLICY, | |
| 64 OLD_ELEVATION_POLICY, | |
| 65 }; | |
| 66 | |
| 67 // The version identifying the work done by setup.exe --configure-user-settings | 58 // The version identifying the work done by setup.exe --configure-user-settings |
| 68 // on user login by way of Active Setup. Increase this value if the work done | 59 // on user login by way of Active Setup. Increase this value if the work done |
| 69 // in setup_main.cc's handling of kConfigureUserSettings changes and should be | 60 // in setup_main.cc's handling of kConfigureUserSettings changes and should be |
| 70 // executed again for all users. | 61 // executed again for all users. |
| 71 const wchar_t kActiveSetupVersion[] = L"24,0,0,0"; | 62 const wchar_t kActiveSetupVersion[] = L"24,0,0,0"; |
| 72 | 63 |
| 73 // Although the UUID of the ChromeFrame class is used for the "current" value, | 64 // Although the UUID of the ChromeFrame class is used for the "current" value, |
| 74 // this is done only as a convenience; there is no need for the GUID of the Low | 65 // this is done only as a convenience; there is no need for the GUID of the Low |
| 75 // Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to | 66 // Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to |
| 76 // use this completely unrelated GUID for the "old" policies. | 67 // use this completely unrelated GUID for the "old" policies. |
| 77 const wchar_t kIELowRightsPolicyOldGuid[] = | 68 const wchar_t kIELowRightsPolicyOldGuid[] = |
| 78 L"{6C288DD7-76FB-4721-B628-56FAC252E199}"; | 69 L"{6C288DD7-76FB-4721-B628-56FAC252E199}"; |
| 79 | 70 |
| 80 #if defined(OMIT_CHROME_FRAME) | |
| 81 // For historical reasons, this GUID is the same as CLSID_ChromeFrame. Included | |
| 82 // here to break the dependency on Chrome Frame when Chrome Frame is not being | |
| 83 // built. | |
| 84 // TODO(robertshield): Remove this when Chrome Frame works with Aura. | |
| 85 const wchar_t kIELowRightsPolicyCurrentGuid[] = | |
| 86 L"{E0A900DF-9611-4446-86BD-4B1D47E7DB2A}"; | |
| 87 #endif | |
| 88 | |
| 89 const wchar_t kElevationPolicyKeyPath[] = | 71 const wchar_t kElevationPolicyKeyPath[] = |
| 90 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; | 72 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; |
| 91 | 73 |
| 92 void GetIELowRightsElevationPolicyKeyPath(ElevationPolicyId policy, | 74 void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { |
| 93 base::string16* key_path) { | |
| 94 DCHECK(policy == CURRENT_ELEVATION_POLICY || policy == OLD_ELEVATION_POLICY); | |
| 95 key_path->assign(kElevationPolicyKeyPath, | 75 key_path->assign(kElevationPolicyKeyPath, |
| 96 arraysize(kElevationPolicyKeyPath) - 1); | 76 arraysize(kElevationPolicyKeyPath) - 1); |
| 97 if (policy == CURRENT_ELEVATION_POLICY) { | 77 key_path->append(kIELowRightsPolicyOldGuid, |
| 98 #if defined(OMIT_CHROME_FRAME) | 78 arraysize(kIELowRightsPolicyOldGuid)- 1); |
| 99 key_path->append(kIELowRightsPolicyCurrentGuid, | |
| 100 arraysize(kIELowRightsPolicyCurrentGuid) - 1); | |
| 101 #else | |
| 102 wchar_t cf_clsid[64]; | |
| 103 int len = StringFromGUID2(__uuidof(ChromeFrame), &cf_clsid[0], | |
| 104 arraysize(cf_clsid)); | |
| 105 key_path->append(&cf_clsid[0], len - 1); | |
| 106 #endif | |
| 107 } else { | |
| 108 key_path->append(kIELowRightsPolicyOldGuid, | |
| 109 arraysize(kIELowRightsPolicyOldGuid)- 1); | |
| 110 } | |
| 111 } | 79 } |
| 112 | 80 |
| 113 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of | 81 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of |
| 114 // products managed by a given package. | 82 // products managed by a given package. |
| 115 // |old_version| can be NULL to indicate no Chrome is currently installed. | 83 // |old_version| can be NULL to indicate no Chrome is currently installed. |
| 116 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, | 84 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, |
| 117 const Version* old_version, | 85 const Version* old_version, |
| 118 const Version& new_version, | 86 const Version& new_version, |
| 119 WorkItemList* work_item_list) { | 87 WorkItemList* work_item_list) { |
| 120 // First collect the list of DLLs to be registered from each product. | 88 // First collect the list of DLLs to be registered from each product. |
| (...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", | 1335 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", |
| 1368 kActiveSetupVersion, true); | 1336 kActiveSetupVersion, true); |
| 1369 } | 1337 } |
| 1370 | 1338 |
| 1371 void AddDeleteOldIELowRightsPolicyWorkItems( | 1339 void AddDeleteOldIELowRightsPolicyWorkItems( |
| 1372 const InstallerState& installer_state, | 1340 const InstallerState& installer_state, |
| 1373 WorkItemList* install_list) { | 1341 WorkItemList* install_list) { |
| 1374 DCHECK(install_list); | 1342 DCHECK(install_list); |
| 1375 | 1343 |
| 1376 base::string16 key_path; | 1344 base::string16 key_path; |
| 1377 GetIELowRightsElevationPolicyKeyPath(OLD_ELEVATION_POLICY, &key_path); | 1345 GetOldIELowRightsElevationPolicyKeyPath(&key_path); |
| 1378 install_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), key_path); | 1346 install_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), key_path); |
| 1379 } | 1347 } |
| 1380 | 1348 |
| 1381 void AppendUninstallCommandLineFlags(const InstallerState& installer_state, | 1349 void AppendUninstallCommandLineFlags(const InstallerState& installer_state, |
| 1382 const Product& product, | 1350 const Product& product, |
| 1383 CommandLine* uninstall_cmd) { | 1351 CommandLine* uninstall_cmd) { |
| 1384 DCHECK(uninstall_cmd); | 1352 DCHECK(uninstall_cmd); |
| 1385 | 1353 |
| 1386 uninstall_cmd->AppendSwitch(installer::switches::kUninstall); | 1354 uninstall_cmd->AppendSwitch(installer::switches::kUninstall); |
| 1387 | 1355 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1457 // Unconditionally remove the legacy Quick Enable command from the binaries. |
| 1490 // Do this even if multi-install Chrome isn't installed to ensure that it is | 1458 // Do this even if multi-install Chrome isn't installed to ensure that it is |
| 1491 // not left behind in any case. | 1459 // not left behind in any case. |
| 1492 work_item_list->AddDeleteRegKeyWorkItem( | 1460 work_item_list->AddDeleteRegKeyWorkItem( |
| 1493 installer_state.root_key(), cmd_key)->set_log_message( | 1461 installer_state.root_key(), cmd_key)->set_log_message( |
| 1494 "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); | 1462 "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); |
| 1495 | 1463 |
| 1496 } | 1464 } |
| 1497 | 1465 |
| 1498 } // namespace installer | 1466 } // namespace installer |
| OLD | NEW |