Im just wondering is there a way of getting the current directory a
script resides in?
Say my xulrunner powered application was installed by the end user in
e:\apps\myapp, how could I check what directory the application.ini
file was in using javascript?
Cheers,
Heath
Use directory service:
http://developer.mozilla.org/en/docs/nsDirectoryService
The key to the folder where application.ini resides is "resource:app"
Igor Tandetnik
Components.classes['@mozilla.org/file/directory_service;1'].getService(Components.interfaces.nsIProperties).get("resource:app",Components.interfaces.nsIFile).path
but it came up with:
Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript:
Components.classes['@mozilla.org/file/directory_service;1'].getService(Components.interfaces.nsIProperties).get("resource:app",Components.interfaces.nsIFile).path
:: <TOP_LEVEL> :: line 1" data: no]
Any ideas?
Cheers,
Heath
Igor Tandetnik