Why do you use alert()s/confirm()s in your install scripts?

Talk about add-ons and extension development.
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Why do you use alert()s/confirm()s in your install scripts?

Post by bengoodger »

I'm doing some xpinstall work at the moment, and one of the things that bugs me most about Firebird extensions is the way most use poorly configured confirm() dialogs from the installer.js scripts that are run when the XPIs are installed.

The obvious first one is "Profile" vs. "Application Directory" question, something that will be dealt with in 0.9.

But what else?

I looked at Piro's TBE and counted three popups in ADDITION to the profile v. application choice above. Here they are, with my explanation of why they are or will become unnecessary.

Install the Japanese Language Pack?

This should be handled as a separate XPI download, and configured from the webpage. e.g.:

Code: Select all

var usejaJALangPack = document.getElementById("usejaJALangPack").checked;
var obj = { "Tabbrowser Extensions": "http://url.to/tabbrowser.extensions.xpi"};
if (usejaJALangPack)
  obj["Tabbrowser Extensions (Japanese Language Pack)"] = "http://url.to/tabbrowser.extensions/ja-JA.xpi";
InstallTrigger.install(obj);


The InstallTrigger's install method supports loading more than one extension at once, it takes an object parameter and each key in the object parameter represents an extension to install. i.e.

Code: Select all

var obj = { "Extension 1": "http://www.site.com/extension1.xpi", "Extension 2": "http://www.site.com/extension2.xpi", etc};
InstallTrigger.install(obj); // Installs all of them


No one should be offering add-on modules via poorly worded about boxes (e.g. OK/Cancel are not suitable verbs for installing a language pack) when this mechanism exists.

Installed with Light settings?
This can either be handled at runtime (complex, requires some "tip of the day" style code to offer this simple mode the first time the app is run).. or... the lite settings pack can be factored into a separate XPI and downloaded as well using the method I described above.

Summary, restart message.
From Firebird 0.8 onward, extensions won't have to deliver a restart message, the application framework will provide this for you, so any such informational popups are unnecessary.

Are there any other uses people put these abominable little dialogs to? ;-)
old momokatte
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old momokatte »

Error messages
If there's a write access error, most of us have a custom error message informing the user that their chrome directory doesn't have sufficient read/write permissions to install the extension. If the XPInstaller provided more information for errors, this wouldn't be necessary.
TychoQuad
Posts: 1263
Joined: December 11th, 2002, 12:30 am
Location: Australia

Post by TychoQuad »

I'm extremely happy you are doing something about this, Installing extensions is a pain in the arse because of these dialogs, especially when the questions asked are not Ok/Cancel questions, and different extension developers assign different actions to the buttons.
rue
Posts: 673
Joined: June 10th, 2003, 2:20 pm

Post by rue »

Speaking with a view to future-development makes criticism easy. But, most seemingly complex installers are actually working to address shortcomings in either the routines they use, or the documentation that should explain them.
.
I've read through install-docs, and never seen this keyed-parameter method before.
.
Also, if there were a way to throw "custom" confirms that allowed more buttons / user-defined labels, the process would feel a lot more natural.
User avatar
bengoodger
Posts: 318
Joined: November 4th, 2002, 4:24 pm
Location: Campbell, CA
Contact:

Post by bengoodger »

momokatte wrote:Error messages
If there's a write access error, most of us have a custom error message informing the user that their chrome directory doesn't have sufficient read/write permissions to install the extension. If the XPInstaller provided more information for errors, this wouldn't be necessary.


OK, I suppose that deserves an error popup.
old momokatte
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old momokatte »

Thinking about it a bit more -- it would be nice if the XPInstaller simply told the user which directory was unable to be written to. Then the installer script wouldn't have to keep track of where the installation is occurring (application/profile/other) in order to provide the user with sufficient information to solve the problem.
TychoQuad
Posts: 1263
Joined: December 11th, 2002, 12:30 am
Location: Australia

Post by TychoQuad »

This may sound like a stupid idea, but I reccomend somehow restricting install scripts to one dialog popup. I can't think of anyy reason why more than one would be absolutely nessesary, that's what we have options for. Using the TBE example, as ben said, it shouldn't ask about language packs, light settings is already in the settings anyway, and the other two dialogs, restart and install directory is being dealt with anyway.

There are plenty of programs out there that have built in installers like Mozilla, and they mostly just supply a text box for copyright info. I don't see why Mozilla based programs have to be different in this respect. It just complicates things.
IGAU
Posts: 831
Joined: November 18th, 2003, 2:25 pm

Post by IGAU »

bengoodger wrote:OK, I suppose that deserves an error popup.


Does that mean it'll be in the XPInstall or will developers still have to include their own?
mjwilson
Posts: 140
Joined: December 17th, 2002, 2:43 pm

Post by mjwilson »

e.g. OK/Cancel are not suitable verbs for installing a language pack


I don't believe there is a way to change the OK/Cancel texts from an XPI install script, I believe.
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Post by Pike »

mjwilson wrote:I don't believe there is a way to change the OK/Cancel texts from an XPI install script, I believe.

Correct, see Bug 216399.
David H
Posts: 2254
Joined: June 13th, 2003, 5:17 am
Location: Japan

Post by David H »

As a simple user, I can't really follow all of this conversation, but there are a couple of things I want to be clear about.

First, will whatever changes made still allow for easy installation from files stored on your local drive? because bengooder's OP was saying something like Piro's language packs should be a separate xpi configured from the web page. That wouldn't do at all for some people. Also, I personally would prefer having language packs and such be selectable as you install the extension rather than through a separate installation procedure. It's better in my mind to have everything installed at once.

Second, he mentioned that restarts would now be handled automatically by the install script. I hope that doesn't mean that every time you install an extension the browser closes down and restarts. That would make installing twenty extensions at a time a real pain, even with the reduced number of confirmation screens. With the current method you can install a bunch of extensions at once and then restart the browser one time when you are finished. He said that the new trigger can handle multiple installs at once, but I'm not sure if this means you can actually install a variety of extensions at once, or if they have to be designed to work and install together like the language pack example above.

My feeling on the whole thing is that Firebird should provide the ability for the installation scripts to define their own dialogs, including such things as radio buttons or text imput for labels, so that the extensions can have MORE control over intallation, rather than less. (Though I suppose most of it can be done with after-installation popup screens, I can still imagine there'd be situations when you need to have it done at installation time.)
rue
Posts: 673
Joined: June 10th, 2003, 2:20 pm

Post by rue »

David:
Spot-on -- the last paragraph.
richwklein
Posts: 331
Joined: November 24th, 2002, 8:20 pm
Location: Iowa
Contact:

Post by richwklein »

It would be nice if we could use a XUL wizard dialog.
My Extensions:
<a href="http://forecastfox.mozdev.org">Forecastfox</a>
<a href="http://tipbar.mozdev.org">Tip of the Day</a>
<a href="http://urlnav.mozdev.org">Location Navigator</a>
<a href="http://finder.mozdev.org">Finder</a>
<a href="http://rsszilla.mozdev.org">RSSzilla</a>
User avatar
Waldo
Posts: 596
Joined: July 29th, 2003, 8:21 am
Location: Cambridge, MA
Contact:

Post by Waldo »

David H wrote:My feeling on the whole thing is that Firebird should provide the ability for the installation scripts to define their own dialogs, including such things as radio buttons or text imput for labels, so that the extensions can have MORE control over intallation, rather than less. (Though I suppose most of it can be done with after-installation popup screens, I can still imagine there'd be situations when you need to have it done at installation time.)


<acronym title="XML User Interface Language">XUL</acronym> to the rescue! ;-) And yes, there is some use in showing a mini-options dialog during install. For the Googlebar extension with respect to choice of Google site, such a dialog would be essential for any non-English-speaking international user. Suffice it to say that most options should be set to the general default in install, but those few options that can render an extension completely unusable (mostly localization issues, I would imagine - not chrome or functionality tweaks) would be settable during install.

Ben, if you're still reading this, with respect to the XUL idea: if it ever happens, could someone write some sort of XUL example (nothing actually functional or pretty, just shows how to make the different widgets) in the Firebird QA Test Info page that would demonstrate all the various elements that might likely be included in such a dialog? What I'm thinking of would demonstrate buttons, labels, text inputs, selects, and check/radio buttons & boxes. Perhaps a fieldset or two (or whatever the equivalent in XUL is, I can't remember at the moment) as well for grouping wouldn't be remiss, as would a demonstration of how to link in a stylesheet using a PI. This would greatly ease the transition from JS installs to XUL installs. Thanks for all the great work!
velcrospud
Posts: 506
Joined: January 27th, 2003, 4:00 am
Contact:

Post by velcrospud »

I use an alert to tell first time users of the download statusbar to clear their download history before restarting.

I don't think it's unreasonable to want to communicate something to your users.
Post Reply