Closed Bug 298718 Opened 20 years ago Closed 9 years ago

Installation of XPI packages/extensions does not seem to work

Categories

(Toolkit Graveyard :: XULRunner, defect, P5)

x86
Windows 2000

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: dverspui, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Build Identifier: XULRunner 1.8b2_2005062305

Nothing happens when I use the InstallTrigger.install(...) method to install an 
XPI package in a XUL application run with XULRunner. It just returns 0 
(==success) after doing nothing (I guess).

Related preferences:
pref("xpinstall.enabled", true);
pref("xpinstall.whitelist.required", false);)

InstallTrigger.enabled() indeed returns true.

The mechanism does work when I run the application with Firefox, so nothing 
wrong with that. The XPI package I test with has both a working install.js and 
a working install.rdf, tested with Firefox.


Reproducible: Always

Steps to Reproduce:
1. call InstallTrigger.install(...) with a valid XPI package
2.
3.

Actual Results:  
Returns 0 (success) while no package is installed

Expected Results:  
Installs the package and returns actual status code
I'm interested in this one, it probably points out some bad
extensionmanager->browser dependency or we're missing important prefs of some
sort. Is there anything interesting in the JS console with chrome errors turned on?
Hi Benjamin, glad to hear you're interested. I just found out the following 
preferences are missing in the preferences files:

xpinstall.dialog.confirm
xpinstall.dialog.progress.chrome
xpinstall.dialog.progress.type.chrome
xpinstall.dialog.progress.skin
xpinstall.dialog.progress.type.skin

I copied over the values from Firefox configuration into my application's 
defaults/preferences/application.js file. Now when I invoke 
installTrigger.install a window opens, the confirm dialog I suppose, but 
showing errors about unknown doctype entities.

I must say I am fairly new to Mozilla so can you help me out how to turn on 
chrome errors and opening a Javascript console from an application run with 
XULrunner, because javascript: does not seem to work?
I've been trying to get this to work in ChatZilla. I added the
app.extensions.version and extensions.getMoreExtensionsURL prefs, as well as the
ones mentioned above. I also added a branding package with brand.dtd and
brand.properties.

The Extension Manager shows up, the Install button lets me pick an extension and
add it to the list, but it doesn't actually install, and disable/uninstall/about
don't work.
I'm not going to have time to look at this for 1.8, but if somebody can diagnose
the problems I can probably help get it fixed. It's definitely on the 1.9 radar.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hi Benjamin,

Somehow I got most of the extensions/themes installation mechanism working with 
the
latest 1.8b4 nightly build, by doing the following:

1 created a branding package and manifest, e.g. this means the following files:
    <xulrunner>/chrome/branding/locale/en-US/branding/brand.dtd:
      <!ENTITY  brandShortName        "MyApp">
      <!ENTITY  brandFullName         "MyCompany MyApp">            
      <!ENTITY  vendorShortName       "MyCompany">
      <!ENTITY  releaseURL            "http://www.mycompany.com/myapp/">
    
    <xulrunner>/chrome/branding/locale/en-US/branding/brand.properties:
      brandShortName=MyApp
      brandFullName=MyCompany MyApp
      vendorShortName=MyCompany
    
    <xulrunner>/chrome/branding.manifest:
      locale branding en-US branding/locale/en-US/branding/
      locale branding nl-NL branding/locale/nl-NL/branding/

2 set at least the following preferences in 
<myapp>/defaults/preferences/myapp.js:
    pref("xpinstall.enabled", true);  // disable while not functioning yet
    pref
("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfir
m.xul");
    pref
("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extens
ions.xul?type=extensions");
    pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager-
extensions");
    pref
("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensio
ns.xul?type=themes");
    pref("xpinstall.dialog.progress.type.skin", "Extension:Manager-themes");
    pref
("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensio
ns.properties");
    pref
("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.p
roperties");


Below are my findings installing a package using the various methods available:

o installation into global chrome (CHROME_DELAYED) with install.js works:
  1 installs the files correctly (e.g. in <xulrunner>/chrome/...)
  2 creates/appends <xulrunner>/chrome/installed-chrome.txt with package 
registration info
  3 creates/complements <xulrunner>/chrome/xpinstall.manifest with package 
registration info
  4 creates <xulrunner>/.autoreg for finalizing installation after restart
  5 after restart application creates/complements <xulrunner>/chrome/app-
chrome.manifest with the
    info of <xulrunner>/chrome/xpinstall.manifest, and the latter one is removed
  6 the installed chrome is now available to all users, but off course not 
visible in the extension manager

o installation into user profile (PROFILE_CHROME) with install.js works but 
acts like a global install:
  1 installs the files correctly (e.g. in <profile>/chrome/...)
  2 does not create/append <profile>/chrome/installed-chrome.txt with package 
registration info, neither in <xulrunner>/chrome/
  3 creates/appends <xulrunner>/chrome/xpinstall.manifest with package 
registration info,
    I guess this should be done in the <profile>/chrome directory instead?
  4 creates <xulrunner>/.autoreg in the global directory for finalizing 
installation after restart,
    I guess this should be done in the <profile>/ directory instead?
  5 after restart application nothing is done, xpinstall.manifest remains 
unchanged
  6 the installed chrome is however available to all users because of the 
existence of the xpinstall.manifest.
    Off course the package is not visible in the extension manager

o installation into user profile with install.rdf does not get finalized:
  1 correctly verifies whether or not the extension is compatible with the 
application GUID and version.
    Any em:requires did not seem to work, but I did not test that thoroughly
  2 creates empty directory <profile>/extensions/<GUID>/
  3 installs the jar file into <profile>/extensions/staged-xpis/<GUID>/
  4 complements <profile>/extensions.rdf with the extension info
  5 creates <profile>/.autoreg and creates/complements <profile>/extensions-
startup.manifest with
    the action to be performed upon next restart of the application:
    app-profile <GUID> extensions/<GUID> <date> needs-install
  6 after restart the <profile>.autoreg is removed, but nothing happens with 
the staged xpi
    and extensions-startup.manifest. The installed extension is visible in the 
extension manager,
    but uninstallation, disabling, about, etc. does not work because the 
package is not
    properly installed and registered in <profile>/extensions/Extensions.rdf

o logging of installation always occurs in <xulrunner>/install.log

o <xulrunner>/.autoreg is never removed once it is created

o every installation generates the following error in my console because of 
testing a non-existent
  property canAccess of object installLocation:
    Error: installLocation has no properties
    Source File: <xulrunner>/components/nsExtensionManager.js
    Line: 6449

  I preceded the erroneous statement with an hardcoded return EM_L("true");, 
the error disappeared,
  but it had no impact on finalizing installations.

I hope this may help one out correcting the installation mechanism, and 
hopefully before 1.9!
Flags: blocking1.9?
Flags: blocking1.9? → blocking1.9-
Priority: -- → P5
XULRunner has been removed from the Mozilla tree: see https://groups.google.com/forum/#!topic/mozilla.dev.platform/_rFMunG2Bgw for context.

I am closing all the bugs currently in the XULRunner bugzilla component, in preparation for moving this component to the graveyard. If this bug is still valid in a XULRunner-less world, it will need to be moved to a different bugzilla component to be reopened.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.