Closed Bug 85564 Opened 25 years ago Closed 25 years ago

InstallTrigger.getVersion returns NULL when the component has been installed

Categories

(SeaMonkey :: Installer, defect, P1)

x86
Windows 2000

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jprice, Assigned: ssu0262)

Details

(Whiteboard: pdt+ critical for 0.9.2)

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; DigExt) BuildID: 2001052904 /0.9.1 It appears that in 0.9.1 that InstallTrigger.getVersion does not return a valid version within a web page until an install has been attempted in that browser. That is, calling InstallTrigger.getVersion() will return null when there has been a valid version installed. If the same check is done in the install.js of a XPI file the return is correct. If the install is attempted (the install.js is run) and cancelled, then the InstallTrigger.getVersion call becomes valid until the browser is shut down. This was not an issue in 6.01. Reproducible: Always Steps to Reproduce: 1. Install a XPI component (setting the version as you do)... 2. Restart the browser. 3. Load a page that detects the installed version of a XPI component (per the browser registry using InstallTrigger.getVersion). InstallTrigger.getVersion returns null. 4. Invoke the XPI again, cancel the install, then check the version again (without restarting the browser). The correct value will be there. Actual Results: The version of an installed component was not returned, making it a tad bit dificult to decide whether an update is needed:) Expected Results: InstallTrigger.getVersion() to return the version in mozver.dat. If you need test pages, let me know and i'll send them...
Quick update. First I think I had this asigned to the wrong component. Second, I have now confirmed the bug on Netscape 6.1 Preview Release.
ssu, this one prevents component vendors from determining component version, so using XPInstall trigger scripts they can never figure out whether to upgrade :-( nominating 0.9.2.
Keywords: mozilla0.9.2
Priority: -- → P1
confirming. reporter, can you post attachments? i can do so, but i'm assuming you have some trigger scripts handy that demonstrate this. Also, putting pdt+ in the status whiteboard. pdt has given permission to work on this for 0.9.2 -- change milestone whenever possible.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Here's the test code I've been using (i believe the XPI is web visible, if not just modify the script to point to your favorite xpi file): <html> <head> <title>Bug test page</title> </head> <body leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <script> function triggerXPI() { var XPIFileName = "http://ea2.str.ea.com/downloads/games/common/boot_strap/NPGils.xpi"; try { var xpiLeaf = XPIFileName; xpiObj = new Object(); if(!InstallTrigger.updateEnabled()) { alert("Please enable \"Software Installation\" under the Avdanced tab in your Netscape Preferences."); return false; } else { xpiObj[xpiLeaf] = xpiLeaf; // alert(xpiLeaf); InstallTrigger.install(xpiObj, xpiCB); } } catch(e) { alert(e); } } function xpiCB(url, status) { //succeded, or not needed if (status == 0) { alert("Please follow the direction of the intstaller. Once the installation is complete it will be nescessary to restart the browser to complete the installation (all browser windows must be closed)."); } else if (status == -227) { alert("Component install was cancelled by install.js. Prolly becasue the component is already already up to date"); } else { alert("An error has been encountered while installing required software(" + status + ")."); } //window.close(); // alert(status+": "+url); } function TestVersion() { try { regName = "EACOMGILS"; jarSrc = "gilssetup.exe"; var version = "1.1.0.0"; compValue = InstallTrigger.CompareVersion(regName, version); alert("compValue: " + compValue); }catch(e) { alert("Error: " + e); } } </script> <br><br> <a href="javascript:TestVersion();">Test Version</a>&nbsp;&nbsp; <a href="javascript:triggerXPI();">triggerXPI</a>&nbsp;&nbsp; </body> </html>
Jeff, Thanks for all the info. Another piece of info. we'd like is -- can we see your actual install script? The one included above in the link to the *.xpi doesn't mention how you do a CompareVersion. You mentioned it works in your install script, and I'd like to see what API you're using. Another suggestion: have you tried doing a GetVersion rather than a CompareVersion? Using GetVersion, you could do some mathematical manipulation and do a version check. This is, however, definitely a bug.
just to clarify: this mentions CompareVersion, but your initial summary mentions getVersion. Are they both at flaw?
Marking pdt+ in status whiteboard. ssu, based on our informal discussion in my cube, do you think this is a bug? could you do a brain dump in the bug log here as to why (or why not) this is a problem?
Whiteboard: pdt+
Both CompareVersion and getVersion return appear to be broken.
who gave this a PDT+, did someone get approval from PDT?
Syd, I gave it a PDT+ after meeting with PDT (selmer et al.) last week (Wednesday).
r=sgehani contingent upon building on the mac.
sr=mscott
a=blizzard on behalf of drivers for 0.9.2
Whiteboard: pdt+ → pdt+ critical for 0.9.2
patch checked in. Let me know if you're still having problems with these two functions.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
verified on branch builds 2001071606(mozilla), 2001071306(N6)---Windows 2001071603 (Mac) adding vtrunk as reminder to verify on trunk
Keywords: vtrunk
verified on trunk build 2001091705
Status: RESOLVED → VERIFIED
Keywords: vtrunk
Product: Browser → Seamonkey
Component: Installer: XPI Packages → Installer
QA Contact: agracebush → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: