rv = NS_NewLocalFile(jarFile, getter_AddRefs(jFile));
nsresult rv = NS_NewLocalFile(jarFile, getter_AddRefs(jFile));
GetInstallScriptFromJarfile(nsFileSpec& jarFile, char** scriptBuffer, PRUint32 *scriptLength){    nsCOMPtr<nsIZipReader> hZip;    PRInt32 result = NS_OK;        *scriptBuffer = nsnull;    *scriptLength = 0;    static NS_DEFINE_IID(kIZipReaderIID, NS_IZIPREADER_IID);    static NS_DEFINE_IID(kZipReaderCID,  NS_ZIPREADER_CID);    nsresult rv = nsComponentManager::CreateInstance(kZipReaderCID, nsnull, kIZipReaderIID,                                                      getter_AddRefs(hZip));    if (NS_FAILED(rv))        return nsInstall::CANT_READ_ARCHIVE;    nsCOMPtr<nsILocalFile> jFile;    rv = NS_NewLocalFile(jarFile, getter_AddRefs(jFile));    if (NS_SUCCEEDED(rv))      rv = hZip->Init(jFile);    if (NS_FAILED(rv))        return nsInstall::CANT_READ_ARCHIVE;    rv = hZip->Open();    if (NS_FAILED(rv))        return nsInstall::CANT_READ_ARCHIVE;    // Extract the install.js file to the temporary directory    nsSpecialSystemDirectory installJSFileSpec(nsSpecialSystemDirectory::OS_TemporaryDirectory);    installJSFileSpec += "install.js";    installJSFileSpec.MakeUnique();    // Extract the install.js file.    nsCOMPtr<nsILocalFile> iFile;    rv = NS_NewLocalFile(installJSFileSpec, getter_AddRefs(iFile));    if (NS_SUCCEEDED(rv))      rv = hZip->Extract("install.js", iFile);    if ( NS_SUCCEEDED(rv) )    {        // Read it into a buffer        char* buffer;        PRUint32 bufferLength;        PRUint32 readLength;        result = nsInstall::CANT_READ_ARCHIVE;        nsInputFileStream fileStream(installJSFileSpec);        nsCOMPtr<nsIInputStream> instream = fileStream.GetIStream();        if ( instream )        {            instream->Available(&bufferLength);            buffer = new char[bufferLength + 1];            if (buffer != nsnull)            {                rv = instream->Read(buffer, bufferLength, &readLength);                if (NS_SUCCEEDED(rv) && readLength > 0)                {                    *scriptBuffer = buffer;                    *scriptLength = readLength;                    result = NS_OK;                }                else                {                    delete [] buffer;                }            }            fileStream.close();        }        installJSFileSpec.Delete(PR_FALSE);    }    else    {        result = nsInstall::NO_INSTALL_SCRIPT;    }    return result;   }