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

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: comments + exit code + create shell 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 29 matching lines...) Expand all
40 #include "chrome/installer/util/l10n_string_util.h" 40 #include "chrome/installer/util/l10n_string_util.h"
41 #include "chrome/installer/util/product.h" 41 #include "chrome/installer/util/product.h"
42 #include "chrome/installer/util/set_reg_value_work_item.h" 42 #include "chrome/installer/util/set_reg_value_work_item.h"
43 #include "chrome/installer/util/shell_util.h" 43 #include "chrome/installer/util/shell_util.h"
44 #include "chrome/installer/util/util_constants.h" 44 #include "chrome/installer/util/util_constants.h"
45 #include "chrome/installer/util/work_item_list.h" 45 #include "chrome/installer/util/work_item_list.h"
46 #include "chrome_frame/chrome_tab.h" 46 #include "chrome_frame/chrome_tab.h"
47 47
48 using base::win::RegKey; 48 using base::win::RegKey;
49 49
50 namespace {
51
52 // This is not the Chrome version. To have Active Setup (a method Chrome
grt (UTC plus 2) 2012/09/01 03:20:28 please reword the comment so that it begins by tel
gab 2012/09/01 22:28:40 Done.
53 // registers for on Windows for it to call setup at user login on system-level
54 // installs) run again for users that have already run it, simply increment this
55 // number.
56 // Start at 23,0,0,0 because this was set to Chrome's version for a short
57 // period on dev-channel of Chrome 22.
58 static const wchar_t* kActiveSetupVersion = L"23,0,0,0";
grt (UTC plus 2) 2012/09/01 03:20:28 const wchar_t kActiveSetupVersion[] = L"23,0,0,0";
gab 2012/09/01 22:28:40 Done.
59
60 } // namespace
61
50 namespace installer { 62 namespace installer {
51 63
52 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of 64 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of
53 // products managed by a given package. 65 // products managed by a given package.
54 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, 66 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state,
55 const Version* old_version, 67 const Version* old_version,
56 const Version& new_version, 68 const Version& new_version,
57 WorkItemList* work_item_list) { 69 WorkItemList* work_item_list) {
58 // First collect the list of DLLs to be registered from each product. 70 // First collect the list of DLLs to be registered from each product.
59 std::vector<FilePath> com_dll_list; 71 std::vector<FilePath> com_dll_list;
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 913
902 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, 914 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version,
903 install_list, *product); 915 install_list, *product);
904 916
905 AddVersionKeyWorkItems(root, product->distribution(), new_version, 917 AddVersionKeyWorkItems(root, product->distribution(), new_version,
906 add_language_identifier, install_list); 918 add_language_identifier, install_list);
907 919
908 AddDelegateExecuteWorkItems(installer_state, src_path, new_version, 920 AddDelegateExecuteWorkItems(installer_state, src_path, new_version,
909 *product, install_list); 921 *product, install_list);
910 922
911 // TODO(gab): This is only disabled for M22 as the shortcut CL using Active
912 // Setup will not make it in M22.
913 #if 0
914 AddActiveSetupWorkItems(installer_state, new_version, *product, 923 AddActiveSetupWorkItems(installer_state, new_version, *product,
915 install_list); 924 install_list);
916 #endif
917 } 925 }
918 926
919 // Add any remaining work items that involve special settings for 927 // Add any remaining work items that involve special settings for
920 // each product. 928 // each product.
921 AddProductSpecificWorkItems(original_state, installer_state, setup_path, 929 AddProductSpecificWorkItems(original_state, installer_state, setup_path,
922 new_version, install_list); 930 new_version, install_list);
923 931
924 // Copy over brand, usagestats, and other values. 932 // Copy over brand, usagestats, and other values.
925 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); 933 AddGoogleUpdateWorkItems(original_state, installer_state, install_list);
926 934
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 1261
1254 const HKEY root = HKEY_LOCAL_MACHINE; 1262 const HKEY root = HKEY_LOCAL_MACHINE;
1255 const string16 active_setup_path(GetActiveSetupPath(distribution)); 1263 const string16 active_setup_path(GetActiveSetupPath(distribution));
1256 1264
1257 VLOG(1) << "Adding registration items for Active Setup."; 1265 VLOG(1) << "Adding registration items for Active Setup.";
1258 list->AddCreateRegKeyWorkItem(root, active_setup_path); 1266 list->AddCreateRegKeyWorkItem(root, active_setup_path);
1259 list->AddSetRegValueWorkItem(root, active_setup_path, L"", 1267 list->AddSetRegValueWorkItem(root, active_setup_path, L"",
1260 distribution->GetAppShortCutName(), true); 1268 distribution->GetAppShortCutName(), true);
1261 1269
1262 CommandLine cmd(installer_state.GetInstallerDirectory(new_version). 1270 CommandLine cmd(installer_state.GetInstallerDirectory(new_version).
1263 Append(installer::kSetupExe)); 1271 Append(installer::kSetupExe));
grt (UTC plus 2) 2012/09/01 03:20:28 please switch this to using BaseName of the curren
gab 2012/09/01 22:28:40 Done.
1264 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); 1272 cmd.AppendSwitch(installer::switches::kConfigureUserSettings);
1265 cmd.AppendSwitch(installer::switches::kVerboseLogging); 1273 cmd.AppendSwitch(installer::switches::kVerboseLogging);
1274 cmd.AppendSwitch(installer::switches::kSystemLevel);
1275 product.AppendProductFlags(&cmd);
1266 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", 1276 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath",
1267 cmd.GetCommandLineString(), true); 1277 cmd.GetCommandLineString(), true);
1268 1278
1269 // TODO(grt): http://crbug.com/75152 Write a reference to a localized 1279 // TODO(grt): http://crbug.com/75152 Write a reference to a localized
1270 // resource. 1280 // resource.
1271 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", 1281 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name",
1272 distribution->GetAppShortCutName(), true); 1282 distribution->GetAppShortCutName(), true);
1273 1283
1274 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", 1284 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled",
1275 static_cast<DWORD>(1U), true); 1285 static_cast<DWORD>(1U), true);
1276 1286
1277 string16 comma_separated_version(ASCIIToUTF16(new_version.GetString()));
1278 ReplaceChars(comma_separated_version, L".", L",", &comma_separated_version);
1279 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", 1287 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version",
1280 comma_separated_version, true); 1288 string16(kActiveSetupVersion), true);
grt (UTC plus 2) 2012/09/01 03:20:28 remove string16() since it's implicit
gab 2012/09/01 22:28:40 Done.
1281 } 1289 }
1282 1290
1283 namespace { 1291 namespace {
1284 1292
1285 enum ElevationPolicyId { 1293 enum ElevationPolicyId {
1286 CURRENT_ELEVATION_POLICY, 1294 CURRENT_ELEVATION_POLICY,
1287 OLD_ELEVATION_POLICY, 1295 OLD_ELEVATION_POLICY,
1288 }; 1296 };
1289 1297
1290 // Although the UUID of the ChromeFrame class is used for the "current" value, 1298 // Although the UUID of the ChromeFrame class is used for the "current" value,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 machine_state, 1595 machine_state,
1588 setup_path, 1596 setup_path,
1589 new_version, 1597 new_version,
1590 work_item_list, 1598 work_item_list,
1591 false, // have_child_product 1599 false, // have_child_product
1592 cmd_line, 1600 cmd_line,
1593 kCmdQuickEnableApplicationHost); 1601 kCmdQuickEnableApplicationHost);
1594 } 1602 }
1595 1603
1596 } // namespace installer 1604 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698