moving NS_SoftwareUpdateRequestAutoReg to somewhere where it can do no harm.

This commit is contained in:
dougt%netscape.com 2002-08-12 23:22:36 +00:00
parent 8302c260df
commit 027108fddf
2 changed files with 31 additions and 29 deletions

View File

@ -86,34 +86,5 @@ class nsISoftwareUpdate : public nsISupports
};
/**
* Request that an autoreg be performed at next startup. (Used
* internally by XPI.) This basically drops a files next to the
* application. Next time XPCOM sees this file, it will cause
* an autoreg, then delete this file.
*/
void
NS_SoftwareUpdateRequestAutoReg()
{
nsresult rv;
nsCOMPtr<nsIFile> file;
NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
getter_AddRefs(file));
if (!file) {
NS_WARNING("Getting NS_XPCOM_CURRENT_PROCESS_DIR failed");
return;
}
file->AppendNative(nsDependentCString(".autoreg"));
rv = file->Create(nsIFile::NORMAL_FILE_TYPE, 0666);
if (NS_FAILED(rv)) {
NS_WARNING("creating file failed");
return;
}
}
#endif // nsISoftwareUpdate_h__

View File

@ -100,6 +100,37 @@ static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
#define kInstallLocaleProperties "chrome://global/locale/commonDialogs.properties"
/**
* Request that an autoreg be performed at next startup. (Used
* internally by XPI.) This basically drops a files next to the
* application. Next time XPCOM sees this file, it will cause
* an autoreg, then delete this file.
*/
static void
NS_SoftwareUpdateRequestAutoReg()
{
nsresult rv;
nsCOMPtr<nsIFile> file;
NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
getter_AddRefs(file));
if (!file) {
NS_WARNING("Getting NS_XPCOM_CURRENT_PROCESS_DIR failed");
return;
}
file->AppendNative(nsDependentCString(".autoreg"));
rv = file->Create(nsIFile::NORMAL_FILE_TYPE, 0666);
if (NS_FAILED(rv)) {
NS_WARNING("creating file failed");
return;
}
}
MOZ_DECL_CTOR_COUNTER(nsInstallInfo)
nsInstallInfo::nsInstallInfo(PRUint32 aInstallType,