Updating extensions in a XULRunner application - xul

Is it possible for extensions in XUL application to auto update to newer version when app starts? I'm trying to figure this out. If this is possible I would be very grateful if someone would point me to good documentation about this, because I can't find any good articles about this subject on the Internet.

XULRunner has the same extension update mechanism built in as Firefox - it will look for extension updates once daily when the application is running. If it finds an update then it will update restartless extensions immediately, other extensions are downloaded and updated on next application start. You have to make sure that the following preferences are defined for your application (copied from Firefox preferences):
pref("extensions.update.autoUpdateDefault", true);
pref("extensions.update.enabled", true);
pref("extensions.update.interval", 86400);
pref("extensions.update.url", "...");
pref("extensions.update.background.url", "...");
The tricky part are the update URLs. Of course you can use the same URLs as Firefox:
https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
This will work fine for extensions available on addons.mozilla.org. However, I suspect that the extensions for your application will not be available there. Then you have two options. You can enter some dummy URL here like data:text/xml,<nada/> to keep the add-on manager quiet and make sure that all extensions have a custom updateURL. Or you can run your own update server that will produce update manifests for all known extensions (basically what addons.mozilla.org is doing).

Related

Twitter-Bootstrap 3.3.7- Getting Started

I'm stumped. I cannot understand the getbootstrap.com Getting Started info. I'm running on Windows 7 Pro. I would like to use Pingendo - which I'm new to - to create my website.
I downloaded the distribution version bootstrap-3.3.7-dist.zip (pre-compiled) and unzipped it. Then I came to the MaxCDN code. Where do I put that code??
For the source code version, I see references to things I don't know about: Bower, npm, Composer, Grunt, Less, and SASS. All these appear to be Linux based tools - from the command lines shown. How does one accomplish the same thing under Windows without installing yet more tools? Do I even need to compile this code to use the greater features?
You can either add the downloaded bootstrap css and js files to your project and reference them or you can just use the cdn which is just the same files hosted on a server. You do now have to know about any of those to get started with Bootstrap. They are just additional ways to install it, and different preprocessors that you can leverage.

Programmatically install extensions on Safari 8 OSX 10.10

I'm trying to fix a couple of bugs for SafariDriver/Selenium.
Here is the problem:
On Safari 7 and bellow, to install a new plug in all you had to do is put the extension into ~/Library/Safari/Extensions. Next all you have to do is activate the plugin by adding it to the ~/Library/Safari/Extensions/Extensions.plist after this the Safari will have the plugin installed.
Starting with 10.10, this is no longer possible to do. The location of the extension is the same but i'm not sure how to activate the extension, since the Extensions.plist no longer exists.
My understanding is that there is some file that is controlled via "Safari Extensions List" password in the keychain under login but I have no idea which file this may apply to.
If I compile and install the extention by hand, everything works just fine but the automatic installation of the latest plugin is broken. (documentation for this https://code.google.com/p/selenium/wiki/SafariDriverInternals)
"Safari Extensions List" password is not password actually but a binary plist same as ~/Library/Safari/Extensions/Extensions.plist
Read it, modify it, write it back.
The correct thing to do is to have the user install the extension by opening it manually (double-click or command o). That's what Apple is trying to get you to do.
Apple never really wanted anybody messing about with plists for other apps.
Most preferences plists are cached in memory anyway and would require a new login session to blow them away and get new copies.
plists are updated on ending the session or the app in question.
They were never intended as a means to modify another app's behavior. That is a security risk.
In the case of Selenium, the intent is clearly to create an automated test environment. Setting up a nice installer pre-empts that to some degree.
The right thing to do is to file a bug with Apple letting them know what kind of functionality you need in Safari.

NPRuntime plugin says Missing Plug-in in Safari(Windows)

I have developed an NPRuntime plugin, everything is ok, but it not initialized in Safari. I registered the plugin in MozillaPlugins registry key, it works fine for Chrome/FF/Opera, but Safari writes the the plugin is missing, although I found my plugin in the list of isntalled safari plugins. What am i doing wrong ?
That's real hard to say. Safari on windows isn't supported real well by Apple, so I don't bother supporting it much myself. If it's really important I'd recommend adding logging in all your NPP_ methods (and your NP_ functions too) and see what is getting called; find out if it even loads your plugin. Often if something doesn't go as the browser wants during startup it will act like it didn't find it at all.
You could also use Process Monitor to see if it is trying to load the file or not.

How to browse Metacello repositories in Pharo Smalltalk?

I have downloaded Pharo 1.2.2 #12353 and wanted to install some packages in a easier way than going through Monticello Browser. I do not want to copy and paste scripts to install packages. After I opened the Menu, Tools, Configuration Browser a new window is shown with 3 ConfigurationOf...
ConfigurationOfFFI
ConfigurationOfMagma
ConfigurationOfVistaCursors
There is no help or description of what's the purpose of the Configuration Browser. What's one supposed to do with that?
there is no way to select a repository of configurations
there is no menu option to add a ConfigurationOf
there is no way to browse the Configurations from that window
Besides, is that the right tool to browse a "Metacello Repository" like http://www.squeaksource.com/MetacelloRepository.html ?
There is a custom browser to Metacello? Why isn't included in the release by default?
You can give MetacelloBrowser a try. It is aimed at providing a Metacello-centric interface for managing your project. The browser is still in development, but can be used for many tasks quite nicely.
If you decide to take it for a spin, please submit any issues here. Join the Metacello mailing list if you have any questions or comments.
Dale
Please report an issue about the Configuration Browser at http://code.google.com/p/pharo/issues/list and post your difficulties to the Pharo list. I played with the tool too and couldn't understand it either.
see
http://lists.gforge.inria.fr/pipermail/pharo-project/2011-December/057409.html
and for its origins:
http://code.google.com/p/pharo/issues/detail?id=2752
The ideas is that we have an own Squeaksource repo (universe) for a
specific Pharo version where we have a copy all the ConfigurationOfXXX
that are known to work in this specific Pharo version.
Since nobody (yet) mainted the one for Pharo 1.3 the browser is just empty.
I will try to find the time to fill the repo for Pharo 1.3

Cocoa - How to copy files to /usr/share?

I'm developing an "installation" like cocoa application wich needs to take care of some http request, some file system reading, copying files to /usr/share, set up cron (not launchd) and ask some information to user.
I discarded PackageMaker since I need more flexibility.
Currently everything is going well, but on my last installation step, I need to:
Delete my previously installed application folder (if exists). It's always the same path: /usr/share/MY_APP
Create again the application folder at: /usr/share/MY_APP
Copy application files to /usr/share/MY_APP
Update a cron job
It's very important that /usr/share/MY_APP keeps protected with administrative privileges, so a regular shouldn't delete it.
What would be the best approach to implement those steps?
BTW, I'm using Xcode 3.2.
Thanks a lot!
Carlos.
Between the preflight script, the postflight script, and perhaps an Installer plug-in for the custom UI, I see no reason why you can't do all of this in PackageMaker.
Note: “Installer plug-in” is a little misleading. The user does not have to install the plug-in somewhere as a separate step; you include the plug-in inside your package, and Installer will use it from there.
The relevant document is a ReadMe file in a sample code project. There's also an Installer plug-in project template in Xcode since 2.0.
Also, an Installer plug-in won't get used if the user does a command-line installation. Of course, they can't install from the command line at all (which includes remote installation onto an office or lab full of machines) if you write your own custom installer.
By the way: Why /usr/share? What are you putting there? There may be a better way to do what you're really trying to accomplish.