Self Updating Application
| Newsgroups | gmane.comp.mozilla.devel.xpinstall |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
I would like to make my application self-updating. I have not seen any
documentation on how to do this. I am looking for general guidance and
direction.
Right now to update the user must:
Go to our website and click on a link to the new .xpi file.
Confirm they want to install
Click ok after success
Close all mozilla windows.
Sometimes 'Quick Launch' gets in the way of this.
Run the appliation.
This is very cumbersome. My application is capable of detetecting when
there is a new version available.
I have tried just doing a 'window.open()' on the XPI file. That works
but looks rather ugly: an empty browser window opens and the installer
popups over that. After the install the user is left staring at that
empty window.
I also tried this:
var xpi={'Updated App':'https://pathtoapp.xpi'};
InstallTrigger.install(xpi);
That seems to work but when the app is restarted it is still the old
version. I think the InstallTrigger is not meant to install
applications anyway.
Too other approaches have occureed to me:
1) Somehow contstruct an 'Install' object, tell it to load the .xpi file
and run it.
2) Construct an 'Install' object and perform the same steps on it that
the install.js script would have done, but do it right in the application.
Option 2 seems to be problematic becuase the new version may have new or
different steps that need to be done.
Concerning the restart I have these strategies:
1) Tell the user to restart (not very helpful)
2) Somehow tell mozilla to shutdown and let the user start Mozilla.
This seems a little dangerous because Mozilla may have windows open that
should not be closed without the user's concent (for example a half
edited message in the email composition screen).
3) Somehow tell Mozilla to close my app, flush all resources loaded from
the .jar file, and then possibly restart it.
Bryan