Bug 510501 - not granting UAC permission to updater.exe causes full update to be downloaded. r=dtownsend

This commit is contained in:
Robert Strong 2009-11-16 16:34:47 -08:00
Родитель fde48f536f
Коммит 658b39cc7f
3 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -106,7 +106,8 @@ const STATE_DOWNLOAD_FAILED = "download-failed";
const STATE_FAILED = "failed";
// From updater/errors.h:
const WRITE_ERROR = 7;
const WRITE_ERROR = 7;
const ELEVATION_CANCELED = 9;
const DOWNLOAD_CHUNK_SIZE = 300000; // bytes
const DOWNLOAD_BACKGROUND_INTERVAL = 600; // seconds
@ -1160,6 +1161,11 @@ UpdateService.prototype = {
writeVersionFile(getUpdatesDir(), update.extensionVersion);
return;
}
else if (update.errorCode == ELEVATION_CANCELED) {
writeStatusFile(getUpdatesDir(), update.state = STATE_PENDING);
writeVersionFile(getUpdatesDir(), update.extensionVersion);
return;
}
}
// Something went wrong with the patch application process.

Просмотреть файл

@ -48,5 +48,6 @@
#define READ_ERROR 6
#define WRITE_ERROR 7
#define UNEXPECTED_ERROR 8
#define ELEVATION_CANCELED 9
#endif // Errors_h__

Просмотреть файл

@ -1445,6 +1445,8 @@ int NS_main(int argc, NS_tchar **argv)
// argument prior to argOffset is the working directory.
const int argOffset = 4;
gSourcePath = argv[1];
#if defined(XP_WIN) && !defined(WINCE)
// Launch a second instance of the updater with the runas verb on Windows
// when write access is denied to the installation directory.
@ -1520,6 +1522,8 @@ int NS_main(int argc, NS_tchar **argv)
if (result) {
WaitForSingleObject(sinfo.hProcess, INFINITE);
CloseHandle(sinfo.hProcess);
} else {
WriteStatusFile(ELEVATION_CANCELED);
}
if (argc > argOffset) {
@ -1532,8 +1536,6 @@ int NS_main(int argc, NS_tchar **argv)
}
#endif
gSourcePath = argv[1];
LogInit();
LOG(("SOURCE DIRECTORY " LOG_S "\n", gSourcePath));