Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/installer/setup/install_worker.cc

Issue 10889028: Install a user-level Start Menu shortcut for every user on system-installs through Active Setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove TODO for Notify Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/installer/util/l10n_string_util.h" 43 #include "chrome/installer/util/l10n_string_util.h"
44 #include "chrome/installer/util/product.h" 44 #include "chrome/installer/util/product.h"
45 #include "chrome/installer/util/set_reg_value_work_item.h" 45 #include "chrome/installer/util/set_reg_value_work_item.h"
46 #include "chrome/installer/util/shell_util.h" 46 #include "chrome/installer/util/shell_util.h"
47 #include "chrome/installer/util/util_constants.h" 47 #include "chrome/installer/util/util_constants.h"
48 #include "chrome/installer/util/work_item_list.h" 48 #include "chrome/installer/util/work_item_list.h"
49 #include "chrome_frame/chrome_tab.h" 49 #include "chrome_frame/chrome_tab.h"
50 50
51 using base::win::RegKey; 51 using base::win::RegKey;
52 52
53 namespace {
54
55 // The version identifying the work done by setup.exe --configure-user-settings
56 // on user login by way of Active Setup. Increase this value if the work done
57 // in setup_main.cc's handling of kConfigureUserSettings changes and should be
58 // executed again for all users.
59 const wchar_t kActiveSetupVersion[] = L"23,0,0,0";
60
61 } // namespace
62
53 namespace installer { 63 namespace installer {
54 64
55 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of 65 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of
56 // products managed by a given package. 66 // products managed by a given package.
57 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, 67 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state,
58 const Version* old_version, 68 const Version* old_version,
59 const Version& new_version, 69 const Version& new_version,
60 WorkItemList* work_item_list) { 70 WorkItemList* work_item_list) {
61 // First collect the list of DLLs to be registered from each product. 71 // First collect the list of DLLs to be registered from each product.
62 std::vector<FilePath> com_dll_list; 72 std::vector<FilePath> com_dll_list;
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 920
911 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, 921 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version,
912 install_list, *product); 922 install_list, *product);
913 923
914 AddVersionKeyWorkItems(root, product->distribution(), new_version, 924 AddVersionKeyWorkItems(root, product->distribution(), new_version,
915 add_language_identifier, install_list); 925 add_language_identifier, install_list);
916 926
917 AddDelegateExecuteWorkItems(installer_state, src_path, new_version, 927 AddDelegateExecuteWorkItems(installer_state, src_path, new_version,
918 *product, install_list); 928 *product, install_list);
919 929
920 // TODO(gab): This is only disabled for M22 as the shortcut CL using Active 930 AddActiveSetupWorkItems(installer_state, setup_path, new_version, *product,
921 // Setup will not make it in M22.
922 #if 0
923 AddActiveSetupWorkItems(installer_state, new_version, *product,
924 install_list); 931 install_list);
925 #endif
926 } 932 }
927 933
928 // Add any remaining work items that involve special settings for 934 // Add any remaining work items that involve special settings for
929 // each product. 935 // each product.
930 AddProductSpecificWorkItems(original_state, installer_state, setup_path, 936 AddProductSpecificWorkItems(original_state, installer_state, setup_path,
931 new_version, install_list); 937 new_version, install_list);
932 938
933 // Copy over brand, usagestats, and other values. 939 // Copy over brand, usagestats, and other values.
934 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); 940 AddGoogleUpdateWorkItems(original_state, installer_state, install_list);
935 941
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); 1229 list->AddSetRegValueWorkItem(root, subkey, L"", command, true);
1224 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", 1230 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable",
1225 delegate_execute.value(), true); 1231 delegate_execute.value(), true);
1226 1232
1227 subkey.assign(delegate_execute_path).append(L"\\Programmable"); 1233 subkey.assign(delegate_execute_path).append(L"\\Programmable");
1228 list->AddCreateRegKeyWorkItem(root, subkey); 1234 list->AddCreateRegKeyWorkItem(root, subkey);
1229 } 1235 }
1230 } 1236 }
1231 1237
1232 void AddActiveSetupWorkItems(const InstallerState& installer_state, 1238 void AddActiveSetupWorkItems(const InstallerState& installer_state,
1239 const FilePath& setup_path,
1233 const Version& new_version, 1240 const Version& new_version,
1234 const Product& product, 1241 const Product& product,
1235 WorkItemList* list) { 1242 WorkItemList* list) {
1236 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); 1243 DCHECK(installer_state.operation() != InstallerState::UNINSTALL);
1237 BrowserDistribution* distribution = product.distribution(); 1244 BrowserDistribution* distribution = product.distribution();
1238 1245
1239 if (!product.is_chrome() || !installer_state.system_install()) { 1246 if (!product.is_chrome() || !installer_state.system_install()) {
1240 const char* install_level = 1247 const char* install_level =
1241 installer_state.system_install() ? "system" : "user"; 1248 installer_state.system_install() ? "system" : "user";
1242 VLOG(1) << "No Active Setup processing to do for " << install_level 1249 VLOG(1) << "No Active Setup processing to do for " << install_level
1243 << "-level " << distribution->GetAppShortCutName(); 1250 << "-level " << distribution->GetAppShortCutName();
1244 return; 1251 return;
1245 } 1252 }
1246 1253
1247 const HKEY root = HKEY_LOCAL_MACHINE; 1254 const HKEY root = HKEY_LOCAL_MACHINE;
1248 const string16 active_setup_path(GetActiveSetupPath(distribution)); 1255 const string16 active_setup_path(GetActiveSetupPath(distribution));
1249 1256
1250 VLOG(1) << "Adding registration items for Active Setup."; 1257 VLOG(1) << "Adding registration items for Active Setup.";
1251 list->AddCreateRegKeyWorkItem(root, active_setup_path); 1258 list->AddCreateRegKeyWorkItem(root, active_setup_path);
1252 list->AddSetRegValueWorkItem(root, active_setup_path, L"", 1259 list->AddSetRegValueWorkItem(root, active_setup_path, L"",
1253 distribution->GetAppShortCutName(), true); 1260 distribution->GetAppShortCutName(), true);
1254 1261
1255 CommandLine cmd(installer_state.GetInstallerDirectory(new_version). 1262 CommandLine cmd(installer_state.GetInstallerDirectory(new_version).
1256 Append(installer::kSetupExe)); 1263 Append(setup_path.BaseName()));
1257 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); 1264 cmd.AppendSwitch(installer::switches::kConfigureUserSettings);
1258 cmd.AppendSwitch(installer::switches::kVerboseLogging); 1265 cmd.AppendSwitch(installer::switches::kVerboseLogging);
1266 cmd.AppendSwitch(installer::switches::kSystemLevel);
1267 product.AppendProductFlags(&cmd);
1259 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", 1268 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath",
1260 cmd.GetCommandLineString(), true); 1269 cmd.GetCommandLineString(), true);
1261 1270
1262 // TODO(grt): http://crbug.com/75152 Write a reference to a localized 1271 // TODO(grt): http://crbug.com/75152 Write a reference to a localized
1263 // resource. 1272 // resource.
1264 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", 1273 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name",
1265 distribution->GetAppShortCutName(), true); 1274 distribution->GetAppShortCutName(), true);
1266 1275
1267 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", 1276 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled",
1268 static_cast<DWORD>(1U), true); 1277 static_cast<DWORD>(1U), true);
1269 1278
1270 string16 comma_separated_version(ASCIIToUTF16(new_version.GetString()));
1271 ReplaceChars(comma_separated_version, L".", L",", &comma_separated_version);
1272 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", 1279 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version",
1273 comma_separated_version, true); 1280 kActiveSetupVersion, true);
1274 } 1281 }
1275 1282
1276 namespace { 1283 namespace {
1277 1284
1278 enum ElevationPolicyId { 1285 enum ElevationPolicyId {
1279 CURRENT_ELEVATION_POLICY, 1286 CURRENT_ELEVATION_POLICY,
1280 OLD_ELEVATION_POLICY, 1287 OLD_ELEVATION_POLICY,
1281 }; 1288 };
1282 1289
1283 // Although the UUID of the ChromeFrame class is used for the "current" value, 1290 // Although the UUID of the ChromeFrame class is used for the "current" value,
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 AppCommand cmd(cmd_line.GetCommandLineString()); 1625 AppCommand cmd(cmd_line.GetCommandLineString());
1619 cmd.set_is_auto_run_on_os_upgrade(true); 1626 cmd.set_is_auto_run_on_os_upgrade(true);
1620 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); 1627 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list);
1621 } else { 1628 } else {
1622 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key) 1629 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)
1623 ->set_log_message("Removing OS upgrade command"); 1630 ->set_log_message("Removing OS upgrade command");
1624 } 1631 }
1625 } 1632 }
1626 1633
1627 } // namespace installer 1634 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698