}
dump(']]]]]]]]]]]]]]]]]]]]]]]]]]]]]\n');
}
+
+
+// This entire block basically dupliates autoupdate.js as a default preference file
+// Useful if you did not build your initial 2.1+ client, but are using the official download
+try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
+ .getService(Components.interfaces.nsIXULAppInfo);
+ // This ensures that if someone is running in extension mode we don't break the host app's updater
+ // And that we likely have a valid web hostname for later
+ if (appInfo.ID == "staff-client@open-ils.org" && (window.location.protocol == 'http:' || window.location.protocol == 'https:'))
+ {
+ var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+ // Enable Updater
+ prefs.setBoolPref("app.update.enabled", true);
+ // Change to "false" to not automatically update
+ prefs.setBoolPref("app.update.auto", true);
+ // 0 downloads without prompt always
+ prefs.setIntPref("app.update.mode", 0);
+
+ // These settings are in seconds
+ // Interval for checking
+ prefs.setIntPref("app.update.interval", 86400);
+ // Time before prompting to download - If auto is off, mainly
+ prefs.setIntPref("app.update.nagTimer.download", 86400);
+ // Time before prompting to restart to apply update that has downloaded
+ prefs.setIntPref("app.update.nagTimer.restart", 1800);
+
+ // How often to check timers (above) - in MILLIseconds
+ prefs.setIntPref("app.update.timer", 600000);
+
+ // URL for downloading. For Thomas Berezansky's script the update.xml part isn't needed.
+ // NOTE: Certs that default to invalid, even those overridden with cert_override.txt, won't work with this!
+ prefs.setCharPref("app.update.url", "https://" + window.location.hostname + "/updates/check/%CHANNEL%/%VERSION%/update.xml");
+
+ // URL for manual update information
+ prefs.setCharPref("app.update.url.manual", "http://" + window.location.hostname + "/updates/manualupdate.html");
+
+ // Default details URL for updates
+ prefs.setCharPref("app.update.url.details", "http://" + window.location.hostname + "/updates/updatedetails.html");
+ }
+} catch(E) {
+ dump('Error updating automatic update settings for ' + location.href + '\n');
+}