Hi,
the following code, when called from Firefox extension, retrieves
firefox profile directory location.
nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
if (NS_FAILED(rv)) return;
nsCOMPtr<nsIProperties> fileLocator =
do_GetService("@mozilla.org/file/directory_service;1", &rv);
if (NS_FAILED(rv)) return;
if (fileLocator)
{
nsCOMPtr<nsILocalFile> dir;
rv = fileLocator->Get("ProfD", NS_GET_IID(nsILocalFile),
getter_AddRefs(dir));
if (NS_FAILED(rv)) return; // here of course fails if called from
non-extension
if (dir)
{
nsEmbedCString path;
dir->GetNativePath(path);
aDir = path.get();
}
}
However I am wondering how to get the same from a standalone
application (not extenson).
Why do I need it for? I am making an installer which would install my
firefox extension from the command-line.
OS: Windows XP. Firefox 2.0
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding