зеркало из https://github.com/mozilla/gecko-dev.git
Bug 759615 - Avoid running the PostUpdate step when only staging the update in the background; r=rstrong
This commit is contained in:
Родитель
b860e0877e
Коммит
e52d047f9d
|
@ -239,6 +239,7 @@ StartUpdateProcess(int argc,
|
||||||
if (updateWasSuccessful && argc > 2) {
|
if (updateWasSuccessful && argc > 2) {
|
||||||
LPCWSTR installationDir = argv[2];
|
LPCWSTR installationDir = argv[2];
|
||||||
LPCWSTR updateInfoDir = argv[1];
|
LPCWSTR updateInfoDir = argv[1];
|
||||||
|
bool backgroundUpdate = (argc == 4 && !wcscmp(argv[3], L"-1"));
|
||||||
|
|
||||||
// Launch the PostProcess with admin access in session 0. This is
|
// Launch the PostProcess with admin access in session 0. This is
|
||||||
// actually launching the post update process but it takes in the
|
// actually launching the post update process but it takes in the
|
||||||
|
@ -247,9 +248,14 @@ StartUpdateProcess(int argc,
|
||||||
// the unelevated updater.exe after the update process is complete
|
// the unelevated updater.exe after the update process is complete
|
||||||
// from the service. We don't know here which session to start
|
// from the service. We don't know here which session to start
|
||||||
// the user PostUpdate process from.
|
// the user PostUpdate process from.
|
||||||
LOG(("Launching post update process as the service in session 0.\n"));
|
// Note that we don't need to do this if we're just staging the
|
||||||
if (!LaunchWinPostProcess(installationDir, updateInfoDir, true, NULL)) {
|
// update in the background, as the PostUpdate step runs when
|
||||||
LOG(("The post update process could not be launched.\n"));
|
// performing the replacing in that case.
|
||||||
|
if (!backgroundUpdate) {
|
||||||
|
LOG(("Launching post update process as the service in session 0.\n"));
|
||||||
|
if (!LaunchWinPostProcess(installationDir, updateInfoDir, true, NULL)) {
|
||||||
|
LOG(("The post update process could not be launched.\n"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2428,7 +2428,10 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
// we need to manually start the PostUpdate process from the
|
// we need to manually start the PostUpdate process from the
|
||||||
// current user's session of this unelevated updater.exe the
|
// current user's session of this unelevated updater.exe the
|
||||||
// current process is running as.
|
// current process is running as.
|
||||||
if (useService) {
|
// Note that we don't need to do this if we're just staging the
|
||||||
|
// update in the background, as the PostUpdate step runs when
|
||||||
|
// performing the replacing in that case.
|
||||||
|
if (useService && !sBackgroundUpdate) {
|
||||||
bool updateStatusSucceeded = false;
|
bool updateStatusSucceeded = false;
|
||||||
if (IsUpdateStatusSucceeded(updateStatusSucceeded) &&
|
if (IsUpdateStatusSucceeded(updateStatusSucceeded) &&
|
||||||
updateStatusSucceeded) {
|
updateStatusSucceeded) {
|
||||||
|
@ -2751,12 +2754,12 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
// the service to a newer version in that case. If we are not running
|
// the service to a newer version in that case. If we are not running
|
||||||
// through the service, then MOZ_USING_SERVICE will not exist.
|
// through the service, then MOZ_USING_SERVICE will not exist.
|
||||||
if (!usingService) {
|
if (!usingService) {
|
||||||
if (!LaunchWinPostProcess(argv[callbackIndex], gSourcePath, false, NULL)) {
|
|
||||||
LOG(("NS_main: The post update process could not be launched.\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_tchar installDir[MAXPATHLEN];
|
NS_tchar installDir[MAXPATHLEN];
|
||||||
if (GetInstallationDir(installDir)) {
|
if (GetInstallationDir(installDir)) {
|
||||||
|
if (!LaunchWinPostProcess(installDir, gSourcePath, false, NULL)) {
|
||||||
|
LOG(("NS_main: The post update process could not be launched.\n"));
|
||||||
|
}
|
||||||
|
|
||||||
StartServiceUpdate(installDir);
|
StartServiceUpdate(installDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче