In this case workstream.exe us running on our machine. But even if I close workstream.exe and start it again, the old version won't be replaced by the new version.
When this happens, after debugging mini_installer.exe and setup.exe I have noticed it creates a registry key here: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\CloudFactory\Update\Clients\{F797A2A7-ABEE-4B88-B9A9-FB230284BEEE} and on the right pane: cmd's value will be "C:\Program Files (x86)\CloudFactory\WorkStream\Application\55.2.2883.95\Installer\setup.exe" --rename-chrome-exe --system-level --verbose-logging as can be seen below:
If the above command is manually executed then new version of Chrome will replace the old version, that's what we want. But who is responsible for executing that command? Will Omaha do it or Chromium? Is Chromium supposed to do so after a new instance of Chromium is launched? I have been debugging through Chromium source code (WorkStream.exe) but looks like it doesn't do so. We want our browser to be replaced with new version after the user closes the browser just like Chrome does. Can someone give me a pointer on how to do it?
Thanks
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
base::win::ScopedComPtr<IProcessLauncher> process_launcher; | |
if (SUCCEEDED(process_launcher.CreateInstance(__uuidof(ProcessLauncherClass)))) | |
{ | |
ULONG_PTR phandle = NULL; | |
DWORD current_process_id = ::GetCurrentProcessId(); | |
BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | |
HRESULT hCmdElevated = process_launcher->LaunchCmdElevated(dist->GetAppGuid().c_str(), | |
google_update::kRegRenameCmdField, | |
current_process_id, | |
&phandle); | |
if(SUCCEEDED(hCmdElevated)) | |
{ | |
HANDLE handle = HANDLE(phandle); | |
::WaitForSingleObject(handle, INFINITE); | |
DWORD exit_code; | |
::GetExitCodeProcess(handle, &exit_code); | |
::CloseHandle(handle); | |
if (exit_code == installer::RENAME_SUCCESSFUL) | |
return true; | |
} | |
} |
I have finally managed to fix it. We had to change the GUID of Omaha (fork) and also had to replace Chromium's and Omaha's GUID with ours in src/chrome/installer/util/google_update_constants.ccThen I copied that idl file from our Omaha fork and placed it in src\google_update and renamed it to google_update_idl.idl. You will also have to compile it before building chrome or mini_installer. Use this command: ninja -C out\YourBuildFolder google_update to do so
You should also place this code (or uncomment GOOGLE_CHROME_BUILD) inside src/chrome/browser/first_run/upgrade_util_win.cc @InvokeGoogleUpdateForRename
base::win::ScopedComPtr<IProcessLauncher> process_launcher; if (SUCCEEDED(process_launcher.CreateInstance(__uuidof(ProcessLauncherClass)))) { ULONG_PTR phandle = NULL; DWORD current_process_id = ::GetCurrentProcessId(); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); HRESULT hCmdElevated = process_launcher->LaunchCmdElevated(dist->GetAppGuid().c_str(), google_update::kRegRenameCmdField, current_process_id, &phandle); if(SUCCEEDED(hCmdElevated)) { HANDLE handle = HANDLE(phandle); ::WaitForSingleObject(handle, INFINITE); DWORD exit_code; ::GetExitCodeProcess(handle, &exit_code); ::CloseHandle(handle); if (exit_code == installer::RENAME_SUCCESSFUL) return true; } }
That's it. While debugging I noticed the GUID of IProcessLauncher was different from that of our Omaha fork which is specified in idl file. Just a suggestion, it's better to use SUCCEEDED macro as opposed to using more confusing !FAILED macro.