nsresult rv = nsComponentManager::CreateInstance(kSoftwareUpdateCID, nsnull, kISoftwareUpdateIID, (void**) &softwareUpdate);
nsresult rv = CallCreateInstance(kSoftwareUpdateCID, &softwareUpdate);
main(int argc, char **argv){     for (int i = 1; i < argc; i++)     {        if (argv[i][0] != '-')            break;        switch (argv[i][1])         {            case 'f':            if (argv[i][2] == '\0' && i == argc)             {                fputs("ERROR: missing path after -f\n", stderr);                xpinstall_usage(argc, argv);                return 1;            }            //foo = argv[i + 1];            i++;            break;          default:            fprintf(stderr, "unknown option %s\n", argv[i]);            xpinstall_usage(argc, argv);            return 1;        }    }    nsCOMPtr<nsIServiceManager> servMan;    NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, nsnull);    nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(servMan);    if (!registrar) {        NS_ASSERTION(0, "Null nsIComponentRegistrar");        return rv;    }    registrar->AutoRegister(nsnull);    nsresult rv = nsComponentManager::CreateInstance(kSoftwareUpdateCID,                                                      nsnull,                                                     kISoftwareUpdateIID,                                                     (void**) &softwareUpdate);         if (NS_SUCCEEDED(rv))    {        nsSimpleNotifier *progress = new nsSimpleNotifier();        nsFileSpec jarFile(argv[i]);        nsFileURL jarFileURL(jarFile);                softwareUpdate->InstallJar(  nsString( jarFileURL.GetAsString() ) ,                                     nsString( nsNSPRPath(jarFile) ),                                      0x0000FFFF,                                     progress);    }    return rv;}