Index: chrome/installer/setup/install_worker.cc |
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc |
index 245abc4f53cf4e3b9ec25cfd5a03f91e822e88cc..fa8fde4673348f5c4331d844e675858b39fae557 100644 |
--- a/chrome/installer/setup/install_worker.cc |
+++ b/chrome/installer/setup/install_worker.cc |
@@ -108,6 +108,13 @@ void GetIELowRightsElevationPolicyKeyPath(ElevationPolicyId policy, |
} |
} |
+// Returns true if this install (as described by |installer_state|) requires |
+// Active Setup. |
+bool RequiresActiveSetup(const InstallerState& installer_state) { |
grt (UTC plus 2)
2013/01/09 18:57:45
did you consider making this a method on Installer
gab
2013/01/09 19:35:10
Arg...! Sorry for wasting your time, this is what
|
+ return (installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) && |
+ installer_state.system_install()); |
+} |
+ |
// Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of |
// products managed by a given package. |
// |old_version| can be NULL to indicate no Chrome is currently installed. |
@@ -168,6 +175,13 @@ void AddInstallerCopyTasks(const InstallerState& installer_state, |
temp_path.value(), WorkItem::ALWAYS); |
} |
+ if (RequiresActiveSetup(installer_state)) { |
+ FilePath active_setup_exe(installer_dir.Append(kActiveSetupExe)); |
grt (UTC plus 2)
2013/01/09 18:57:45
suggested comment:
// Make a copy of setup.exe
gab
2013/01/09 19:35:10
Done.
|
+ install_list->AddCopyTreeWorkItem( |
+ setup_path.value(), active_setup_exe.value(), temp_path.value(), |
+ WorkItem::ALWAYS); |
+ } |
+ |
// If only the App Host (not even the Chrome Binaries) is being installed, |
// this must be a user-level App Host piggybacking on system-level Chrome |
// Binaries. Only setup.exe is required, and only for uninstall. |
@@ -1400,6 +1414,7 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state, |
<< "-level " << distribution->GetAppShortCutName(); |
return; |
} |
+ DCHECK(RequiresActiveSetup(installer_state)); |
robertshield
2013/01/09 18:53:14
Doesn't this check duplicate that done in the if s
gab
2013/01/09 18:56:35
Right, but as discussed with Greg, putting it here
|
const HKEY root = HKEY_LOCAL_MACHINE; |
const string16 active_setup_path( |
@@ -1410,8 +1425,9 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state, |
list->AddSetRegValueWorkItem(root, active_setup_path, L"", |
distribution->GetAppShortCutName(), true); |
- CommandLine cmd(installer_state.GetInstallerDirectory(new_version). |
- Append(setup_path.BaseName())); |
+ FilePath active_setup_exe(installer_state.GetInstallerDirectory(new_version) |
+ .Append(kActiveSetupExe)); |
+ CommandLine cmd(active_setup_exe); |
cmd.AppendSwitch(installer::switches::kConfigureUserSettings); |
cmd.AppendSwitch(installer::switches::kVerboseLogging); |
cmd.AppendSwitch(installer::switches::kSystemLevel); |