зеркало из https://github.com/mozilla/gecko-dev.git
Allow a blank (magic) registry name passed to StartInstall() as in 4.x;
Don't delete a jarfile we didn't download! plus bugs 10749,13386
This commit is contained in:
Родитель
0ed39c7f4e
Коммит
92f34f9d7a
|
@ -136,8 +136,9 @@ static NS_DEFINE_IID(kJARCID, NS_JAR_CID);
|
|||
nsInstall::nsInstall()
|
||||
{
|
||||
mScriptObject = nsnull; // this is the jsobject for our context
|
||||
mVersionInfo = nsnull; // this is the version information passed to us in StartInstall()
|
||||
mRegistryPackageName = ""; // this is the name that we will add into the registry for the component we are installing
|
||||
mVersionInfo = nsnull; // this is the version information passed to us in StartInstall()
|
||||
mInstalledFiles = nsnull; // the list of installed objects
|
||||
mRegistryPackageName = ""; // this is the name that we will add into the registry for the component we are installing
|
||||
mUIName = ""; // this is the name that will be displayed in UI.
|
||||
|
||||
mUninstallPackage = PR_FALSE;
|
||||
|
@ -1217,6 +1218,13 @@ nsInstall::SetPackageFolder(const nsString& aFolder)
|
|||
PRInt32
|
||||
nsInstall::StartInstall(const nsString& aUserPackageName, const nsString& aRegistryPackageName, const nsString& aVersion, PRInt32* aReturn)
|
||||
{
|
||||
if ( aUserPackageName.Length() == 0 )
|
||||
{
|
||||
// There must be some pretty name for the UI and the uninstall list
|
||||
*aReturn = SaveError(INVALID_ARGUMENTS);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
char szRegPackagePath[MAXREGPATHLEN];
|
||||
char* szRegPackageName = aRegistryPackageName.ToNewCString();
|
||||
|
||||
|
@ -1232,13 +1240,7 @@ nsInstall::StartInstall(const nsString& aUserPackageName, const nsString& aRegis
|
|||
ResetError();
|
||||
|
||||
mUserCancelled = PR_FALSE;
|
||||
|
||||
if ( aRegistryPackageName.Equals("") )
|
||||
{
|
||||
*aReturn = nsInstall::INVALID_ARGUMENTS;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
mUIName = aUserPackageName;
|
||||
|
||||
*aReturn = GetQualifiedPackageName( aRegistryPackageName, mRegistryPackageName );
|
||||
|
@ -1786,7 +1788,7 @@ nsInstall::ScheduleForInstall(nsInstallObject* ob)
|
|||
PRInt32
|
||||
nsInstall::SanityCheck(void)
|
||||
{
|
||||
if ( mRegistryPackageName == "" || mUIName == "")
|
||||
if ( mInstalledFiles == nsnull )
|
||||
{
|
||||
return INSTALL_NOT_STARTED;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ nsLoggingProgressNotifier::FinalizeProgress(const PRUnichar* message, PRInt32 it
|
|||
{
|
||||
if (mLogStream == nsnull) return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*mLogStream << " Item [" << (itemNum+1) << "/" << totNum << "]\t" << nsAutoCString(message) << nsEndl;
|
||||
*mLogStream << " Item [" << (itemNum) << "/" << totNum << "]\t" << nsAutoCString(message) << nsEndl;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -374,8 +374,14 @@ bail:
|
|||
notifier->AfterJavascriptEvaluation( url.GetUnicode() );
|
||||
|
||||
if (scriptBuffer) delete [] scriptBuffer;
|
||||
if (jarpath) {
|
||||
PR_Delete(jarpath);
|
||||
if (jarpath)
|
||||
{
|
||||
if ( !url.Equals("file://",7) )
|
||||
{
|
||||
// delete the jarfile only if we've downloaded it
|
||||
PR_Delete(jarpath);
|
||||
}
|
||||
|
||||
nsCRT::free(jarpath);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче