Guido Roeskens wrote:
 >

>>* If I simply repackage my JAR file as a XPI file, will the install.js
>>in it work in Netscape 6?  It use netscape.softupdate.VersionInfo and
>>netscape.softupdate.SoftwareUpdate objects as documented in the
>>Netscape 4.x documentation for creating installation packages.  A call
>>to netscape.softupdate.SoftwareUpdate.Execute is what runs the
>>installer EXE that's inside the JAR file.
>>
> 
> In the documentation mentioned above you see the new methods and semantics
> of SmartUpdate. You don't use netscape.softupdate.XXX anymore
> Most of the methods (functions) have the same name and semantics as before.
> 
> netscape.softupdate.SoftwareUpdate.Execute -> File.execute
> netscape.softupdate.VersionInfo -> InstallVersion


File.execute() will execute a file that's already on the users system, the 
closer analogue is simply "execute()"

>>* What's the "official" way in Netscape 6 of figuring out the Netscape
>>plugins directory (so my EXE can install the Netscape plugin in the
>>right place)?


In the windows registry, HKLM\SOFTWARE\Mozilla contains a bunch of subkeys 
representing each "Gecko" embedding product. Under each subkey will be a key 
called "Extensions" with values "Components" and "Plugins". For example, the 
latest Netscape release created the key

    HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Netscape 6 6.1\Extensions

The above was added along the way to 6.1 so that all mozilla-based products 
would appear in one place. If for some reason you want to restrict your 
plugin to Netscape's version of Mozilla (or must install into 6.0) there is 
also a registry location similar to the Communicator one:
    HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Netscape 6\<ua>\Main

where you'll have to enumerate the <ua> for the various versions installed

If all you're doing is launching a native executable your script could be 
simply:

    initInstall("My Plugin Display Text","plugins/MyCompany/MyPlugin","1.2");
    err = execute("myfile.exe");
    if (err == SUCCESS)
       performInstall();
    else
        cancelInstall();

If all you're doing is installing some files into the plugin directory, you 
can save download size by using the XPInstall engine to do the install. Put 
all the files you want in a subdirectory in the .xpi file, say "myfiles", 
and then your script is

  initInstall("My Plugin Display Text","plugins/MyCompany/MyPlugin","1.2");
  err = addDirectory("myfiles");
  if (err == SUCCESS)
     performInstall();
  else
     cancelInstall();

If you stick with execute() there is an optional second boolean argument 
that tells the install script to wait for the executable to finish. The 
default is non-blocking, the 4.x behavior

     execute("myfile.exe",true);  // waits

-Dan Veditz


Reply via email to