Index: chrome/installer/util/install_util.cc |
=================================================================== |
--- chrome/installer/util/install_util.cc (revision 72487) |
+++ chrome/installer/util/install_util.cc (working copy) |
@@ -12,24 +12,24 @@ |
#include <algorithm> |
+#include "base/command_line.h" |
#include "base/file_util.h" |
#include "base/logging.h" |
#include "base/path_service.h" |
#include "base/scoped_ptr.h" |
#include "base/string_util.h" |
#include "base/values.h" |
+#include "base/version.h" |
#include "base/win/registry.h" |
#include "base/win/windows_version.h" |
#include "chrome/common/json_value_serializer.h" |
#include "chrome/installer/util/browser_distribution.h" |
#include "chrome/installer/util/google_update_constants.h" |
#include "chrome/installer/util/l10n_string_util.h" |
-#include "chrome/installer/util/master_preferences_constants.h" |
#include "chrome/installer/util/util_constants.h" |
#include "chrome/installer/util/work_item_list.h" |
using base::win::RegKey; |
-using installer::MasterPreferences; |
bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { |
FilePath::StringType program(cmd.GetProgram().value()); |
@@ -240,3 +240,25 @@ |
return status; |
} |
} |
+ |
+// static |
+void InstallUtil::MakeUninstallCommand(const std::wstring& exe_path, |
+ const std::wstring& arguments, |
+ CommandLine* command_line) { |
+ const bool no_program = exe_path.empty(); |
+ |
+ // Return a bunch of nothingness. |
+ if (no_program && arguments.empty()) { |
+ *command_line = CommandLine(CommandLine::NO_PROGRAM); |
+ } else { |
+ // Form a full command line string. |
+ std::wstring command; |
+ command.append(1, L'"') |
+ .append(no_program ? L"" : exe_path) |
+ .append(L"\" ") |
+ .append(arguments); |
+ |
+ // If we have a program name, return this complete command line. |
+ *command_line = CommandLine::FromString(command); |
+ } |
+} |