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

Unified Diff: chrome/installer/util/install_util.cc

Issue 6288009: More installer refactoring in the interest of fixing some bugs and cleaning t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+}
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698