Re: How do you use "archive" property reference to determine XPI install folder?

Daniel Veditz <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpinstall
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Jason Bassford wrote:
> The value of "archive" holds the full path to the temporary location
> of an installing XPI.  So, in my case, if I run "test.xpi" I'd get:
> 
> c:\Temp\test.xpi
> 
> But how to I get JUST the value of the folder?  (I need to strip out
> the filename itself and leave just the folder or, in other words,
> "c:\Temp".)

Actually archive holds a fileobject, but in a string context it gets
converted as needed. Use your favorite javascript string functions to
truncate from the last slash forward. (It'd be really convenient if the
filespecobjects had a parent() method, but they don't.)

But unless you really want the archive itself, you might be better off
getting the system's idea of the temporary location directly:
getFolder("Temporary")

-Dan Veditz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.