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

Side by Side Diff: chrome/installer/mini_installer/mini_installer.h

Issue 2655473002: Handle spaces in the name of the mini_installer. (Closed)
Patch Set: rewrite with tests Created 3 years, 10 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_ 5 #ifndef CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_
6 #define CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_ 6 #define CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "chrome/installer/mini_installer/exit_code.h" 10 #include "chrome/installer/mini_installer/exit_code.h"
11 #include "chrome/installer/mini_installer/mini_string.h"
11 12
12 namespace mini_installer { 13 namespace mini_installer {
13 14
14 // A container of a process exit code (eventually passed to ExitProcess) and 15 // A container of a process exit code (eventually passed to ExitProcess) and
15 // a Windows error code for cases where the exit code is non-zero. 16 // a Windows error code for cases where the exit code is non-zero.
16 struct ProcessExitResult { 17 struct ProcessExitResult {
17 DWORD exit_code; 18 DWORD exit_code;
18 DWORD windows_error; 19 DWORD windows_error;
19 20
20 explicit ProcessExitResult(DWORD exit) : exit_code(exit), windows_error(0) {} 21 explicit ProcessExitResult(DWORD exit) : exit_code(exit), windows_error(0) {}
21 ProcessExitResult(DWORD exit, DWORD win) 22 ProcessExitResult(DWORD exit, DWORD win)
22 : exit_code(exit), windows_error(win) {} 23 : exit_code(exit), windows_error(win) {}
23 24
24 bool IsSuccess() const { return exit_code == SUCCESS_EXIT_CODE; } 25 bool IsSuccess() const { return exit_code == SUCCESS_EXIT_CODE; }
25 }; 26 };
26 27
28 // A stack-based string large enough to hold an executable to run, two path
29 // arguments, plus a few extra arguments.
30 using CommandString = StackString<MAX_PATH * 4>;
bcwhite 2017/01/27 14:52:24 Change to MAX_PATH * 2 + NNN to match the comm
grt (UTC plus 2) 2017/01/27 15:31:38 If you mean "NNN" to be the room for extra argumen
31
32 // Appends all command line flags (i.e., switches and arguments) in
33 // |command_line| to |buffer|. |buffer| is unchanged in case of error.
bcwhite 2017/01/27 14:52:24 // The flags section is copied exactly: spaces, qu
grt (UTC plus 2) 2017/01/27 15:31:38 Done.
34 void AppendCommandLineFlags(const wchar_t* command_line, CommandString* buffer);
35
27 // Main function for Chrome's mini_installer. First gets a working dir, unpacks 36 // Main function for Chrome's mini_installer. First gets a working dir, unpacks
28 // the resources, and finally executes setup.exe to do the install/update. Also 37 // the resources, and finally executes setup.exe to do the install/update. Also
29 // handles invoking a previous version's setup.exe to patch itself in the case 38 // handles invoking a previous version's setup.exe to patch itself in the case
30 // of differential updates. 39 // of differential updates.
31 ProcessExitResult WMain(HMODULE module); 40 ProcessExitResult WMain(HMODULE module);
32 41
33 } // namespace mini_installer 42 } // namespace mini_installer
34 43
35 #endif // CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_ 44 #endif // CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698