Mac v2 signing - Bug 1047738 - Make distribution code look for the distribution directory under Contents/Resources due to v2 signing requirements. r=bsmedberg

This commit is contained in:
Steven Michaud 2014-09-29 11:51:51 -07:00
parent 462a374b6f
commit 66beaa2106
3 changed files with 13 additions and 10 deletions

View File

@ -125,12 +125,11 @@ static void
AppendDistroSearchDirs(nsIProperties* aDirSvc, nsCOMArray<nsIFile> &array) AppendDistroSearchDirs(nsIProperties* aDirSvc, nsCOMArray<nsIFile> &array)
{ {
nsCOMPtr<nsIFile> searchPlugins; nsCOMPtr<nsIFile> searchPlugins;
nsresult rv = aDirSvc->Get(XRE_EXECUTABLE_FILE, nsresult rv = aDirSvc->Get(XRE_APP_DISTRIBUTION_DIR,
NS_GET_IID(nsIFile), NS_GET_IID(nsIFile),
getter_AddRefs(searchPlugins)); getter_AddRefs(searchPlugins));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return; return;
searchPlugins->SetNativeLeafName(NS_LITERAL_CSTRING("distribution"));
searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins")); searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins"));
bool exists; bool exists;

View File

@ -26,12 +26,16 @@ this.DistributionCustomizer = function DistributionCustomizer() {
} catch(ex) {} } catch(ex) {}
let dirSvc = Cc["@mozilla.org/file/directory_service;1"]. let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties); getService(Ci.nsIProperties);
try {
let iniFile = loadFromProfile ? dirSvc.get("ProfD", Ci.nsIFile) let iniFile = loadFromProfile ? dirSvc.get("ProfD", Ci.nsIFile)
: dirSvc.get("XREExeF", Ci.nsIFile); : dirSvc.get("XREAppDist", Ci.nsIFile);
if (loadFromProfile) {
iniFile.leafName = "distribution"; iniFile.leafName = "distribution";
}
iniFile.append("distribution.ini"); iniFile.append("distribution.ini");
if (iniFile.exists()) if (iniFile.exists())
this._iniFile = iniFile; this._iniFile = iniFile;
} catch(ex) {}
} }
DistributionCustomizer.prototype = { DistributionCustomizer.prototype = {

View File

@ -373,9 +373,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
} }
else if (!strcmp(aProperty, XRE_APP_DISTRIBUTION_DIR)) { else if (!strcmp(aProperty, XRE_APP_DISTRIBUTION_DIR)) {
bool persistent = false; bool persistent = false;
rv = GetFile(XRE_EXECUTABLE_FILE, &persistent, getter_AddRefs(file)); rv = GetFile(NS_GRE_DIR, &persistent, getter_AddRefs(file));
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
rv = file->SetNativeLeafName(NS_LITERAL_CSTRING("distribution")); rv = file->AppendNative(NS_LITERAL_CSTRING("distribution"));
} }
else if (NS_SUCCEEDED(GetProfileStartupDir(getter_AddRefs(file)))) { else if (NS_SUCCEEDED(GetProfileStartupDir(getter_AddRefs(file)))) {
// We need to allow component, xpt, and chrome registration to // We need to allow component, xpt, and chrome registration to