Bug 842334 - Move distribution/ back to the installation directory. r=bsmedberg,r=gavin

This commit is contained in:
Mike Hommey 2013-05-11 20:14:58 +02:00
parent 82db710cfc
commit b69ccc0a17
4 changed files with 14 additions and 12 deletions

View File

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

View File

@ -19,8 +19,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
this.DistributionCustomizer = function DistributionCustomizer() {
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
let iniFile = dirSvc.get("XCurProcD", Ci.nsIFile);
iniFile.append("distribution");
let iniFile = dirSvc.get("XREExeF", Ci.nsIFile);
iniFile.leafName = "distribution";
iniFile.append("distribution.ini");
if (iniFile.exists())
this._iniFile = iniFile;

View File

@ -18,8 +18,8 @@ function run_test()
do_test_pending();
// Copy distribution.ini file to our app dir.
let distroDir = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
distroDir.append("distribution");
let distroDir = Services.dirsvc.get("XREExeF", Ci.nsIFile);
distroDir.leafName = "distribution";
let iniFile = distroDir.clone();
iniFile.append("distribution.ini");
if (iniFile.exists()) {
@ -94,8 +94,8 @@ function onCustomizationComplete()
do_register_cleanup(function() {
// Remove the distribution file, even if the test failed, otherwise all
// next tests will import it.
let iniFile = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
iniFile.append("distribution");
let iniFile = Services.dirsvc.get("XREExeF", Ci.nsIFile);
iniFile.leafName = "distribution";
iniFile.append("distribution.ini");
if (iniFile.exists())
iniFile.remove(false);

View File

@ -373,9 +373,10 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
#endif
}
else if (!strcmp(aProperty, XRE_APP_DISTRIBUTION_DIR)) {
rv = GetAppDir()->Clone(getter_AddRefs(file));
bool persistent = false;
rv = GetFile(XRE_EXECUTABLE_FILE, &persistent, getter_AddRefs(file));
if (NS_SUCCEEDED(rv))
rv = file->AppendNative(NS_LITERAL_CSTRING("distribution"));
rv = file->SetNativeLeafName(NS_LITERAL_CSTRING("distribution"));
}
else if (NS_SUCCEEDED(GetProfileStartupDir(getter_AddRefs(file)))) {
// We need to allow component, xpt, and chrome registration to
@ -611,11 +612,12 @@ void
nsXREDirProvider::LoadAppBundleDirs()
{
nsCOMPtr<nsIFile> dir;
nsresult rv = mXULAppDir->Clone(getter_AddRefs(dir));
bool persistent = false;
nsresult rv = GetFile(XRE_EXECUTABLE_FILE, &persistent, getter_AddRefs(dir));
if (NS_FAILED(rv))
return;
dir->AppendNative(NS_LITERAL_CSTRING("distribution"));
dir->SetNativeLeafName(NS_LITERAL_CSTRING("distribution"));
dir->AppendNative(NS_LITERAL_CSTRING("bundles"));
nsCOMPtr<nsISimpleEnumerator> e;