Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Launch Chrome with the full path to the executable instead of 'start chrome' #243

Merged
merged 2 commits into from May 13, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions appshell/appshell_extensions_win.cpp
Expand Up @@ -327,7 +327,7 @@ static bool ConvertToShortPathName(std::wstring & path)


int32 OpenLiveBrowser(ExtensionString argURL, bool enableRemoteDebugging) int32 OpenLiveBrowser(ExtensionString argURL, bool enableRemoteDebugging)
{ {
std::wstring appPath = L"/c start chrome "; std::wstring appPath = GetPathToLiveBrowser();
std::wstring args = appPath; std::wstring args = appPath;


if (enableRemoteDebugging) { if (enableRemoteDebugging) {
Expand All @@ -348,12 +348,10 @@ int32 OpenLiveBrowser(ExtensionString argURL, bool enableRemoteDebugging)


STARTUPINFO si = {0}; STARTUPINFO si = {0};
si.cb = sizeof(si); si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi = {0}; PROCESS_INFORMATION pi = {0};


// Launch cmd.exe and pass in the arguments // Launch cmd.exe and pass in the arguments
if (!CreateProcess(_wgetenv(L"COMSPEC"), argsBuf.get(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { if (!CreateProcess(NULL, argsBuf.get(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weren't these lines also added for starting from the command line?

    si.dwFlags = STARTF_USESHOWWINDOW;
    si.wShowWindow = SW_HIDE;

If so, do you still want them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. Good catch. Those lines don't seem to be doing any harm, but they are not needed any more. Removed.

return ConvertWinErrorCode(GetLastError()); return ConvertWinErrorCode(GetLastError());
} }


Expand Down