Bug 760747 - Wrong check in Mac and Windows webapp runtimes; r=myk

This commit is contained in:
Marco Castelluccio 2012-06-12 13:01:01 -07:00
Родитель 5c37cfaae2
Коммит 65a3e6d735
2 изменённых файлов: 8 добавлений и 9 удалений

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

@ -223,10 +223,6 @@ main(int argc, char **argv)
// directory.
snprintf(rtINIPath, MAXPATHLEN, "%s%s%s%s", [firefoxPath UTF8String], APP_CONTENTS_PATH, WEBAPPRT_PATH, WEBRTINI_NAME);
NSLog(@"WebappRT application.ini path: %s", rtINIPath);
if (![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%s", rtINIPath]]) {
NSString* msg = [NSString stringWithFormat: @"This copy of Firefox (%@) cannot run web applications, because it is missing important files", firefoxVersion];
@throw MakeException(@"Missing WebRT Files", msg);
}
// Load the runtime's INI from its path.
nsCOMPtr<nsIFile> rtINI;
@ -235,9 +231,11 @@ main(int argc, char **argv)
@throw MakeException(@"Error", @"Incorrect path to base INI file.");
}
if (!rtINI) {
NSLog(@"Error: missing WebappRT application.ini");
@throw MakeException(@"Error", @"Missing base INI file.");
bool exists;
nsresult rv = rtINI->Exists(&exists);
if (NS_FAILED(rv) || !exists) {
NSString* msg = [NSString stringWithFormat: @"This copy of Firefox (%@) cannot run web applications, because it is missing WebappRT application.ini", firefoxVersion];
@throw MakeException(@"Missing WebappRT application.ini", msg);
}
nsXREAppData *webShellAppData;

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

@ -278,9 +278,10 @@ namespace {
rv = XRE_GetFileFromPath(rtIniPath, getter_AddRefs(rtINI));
NS_ENSURE_SUCCESS(rv, false);
if (!rtINI) {
bool exists;
rv = rtINI->Exists(&exists);
if (NS_FAILED(rv) || !exists)
return false;
}
ScopedXREAppData webShellAppData;
rv = webShellAppData.create(rtINI);