ogre.rb 0.1-i686-linux → 0.2-i686-linux
Sign up to get free protection for your applications and to get access to all the features.
- data/README +43 -5
- data/Rakefile +67 -165
- data/lib/application.rb +2 -1
- data/lib/application_frame_listener.rb +17 -17
- data/lib/ogre.so +0 -0
- data/lib/ruby_ois.so +0 -0
- data/ogre.rb +3 -0
- data/samples/Ogre.log +358 -257
- data/samples/cel_shading.rb +85 -0
- data/samples/grass.rb +1 -1
- data/samples/media/materials/programs/CelShading.cg +63 -0
- data/samples/media/materials/scripts/CelShading.material +68 -0
- data/samples/media/materials/textures/cel_shading_diffuse.png +0 -0
- data/samples/media/materials/textures/cel_shading_edge.png +0 -0
- data/samples/media/materials/textures/cel_shading_specular.png +0 -0
- data/samples/ogre.cfg +1 -2
- data/samples/plugins.cfg +3 -2
- data/test/ogre.cfg +10 -0
- data/{samples/navi → test}/plugins.cfg +2 -4
- data/test/test_helper.rb +67 -0
- data/test/unit/constants_test.rb +66 -0
- data/test/unit/frame_stats_proxy_test.rb +28 -0
- data/test/unit/math_test.rb +20 -0
- data/test/unit/mesh_test.rb +15 -0
- data/test/unit/methods_test.rb +98 -0
- data/test/unit/movable_object_test.rb +19 -0
- data/test/unit/name_value_pair_list_test.rb +12 -0
- data/test/unit/overlay_element_test.rb +20 -0
- data/test/unit/render_target_test.rb +11 -0
- data/test/unit/resource_test.rb +26 -0
- data/test/unit/scene_manager_test.rb +21 -0
- metadata +25 -356
- data/samples/navi/Media/NaviDemo.material +0 -60
- data/samples/navi/Media/OgreCore.zip +0 -0
- data/samples/navi/Media/cerulean.jpg +0 -0
- data/samples/navi/Media/clouds.jpg +0 -0
- data/samples/navi/Media/controlsNaviMask.png +0 -0
- data/samples/navi/Media/grass.jpg +0 -0
- data/samples/navi/Media/knot.mesh +0 -0
- data/samples/navi/Media/testNaviMask.png +0 -0
- data/samples/navi/NaviLocal/Navi.js +0 -136
- data/samples/navi/NaviLocal/buttonBg.jpg +0 -0
- data/samples/navi/NaviLocal/controls.html +0 -303
- data/samples/navi/NaviLocal/knobBg.jpg +0 -0
- data/samples/navi/NaviLocal/moo.dropdownmenu.js +0 -87
- data/samples/navi/NaviLocal/mootools.v1.1.js +0 -6964
- data/samples/navi/NaviLocal/naviLogo.html +0 -32
- data/samples/navi/NaviLocal/naviLogo.png +0 -0
- data/samples/navi/NaviLocal/pageBg.jpg +0 -0
- data/samples/navi/NaviLocal/sliderBg.jpg +0 -0
- data/samples/navi/NaviLocal/test.html +0 -5
- data/samples/navi/NaviLocal/welcome.html +0 -36
- data/samples/navi/NaviLocal/welcome.png +0 -0
- data/samples/navi/chrome/chromelist.txt +0 -597
- data/samples/navi/chrome/classic.jar +0 -0
- data/samples/navi/chrome/classic.manifest +0 -4
- data/samples/navi/chrome/comm.jar +0 -0
- data/samples/navi/chrome/comm.manifest +0 -2
- data/samples/navi/chrome/en-US.jar +0 -0
- data/samples/navi/chrome/en-US.manifest +0 -9
- data/samples/navi/chrome/toolkit.jar +0 -0
- data/samples/navi/chrome/toolkit.manifest +0 -6
- data/samples/navi/components/FeedProcessor.js +0 -1825
- data/samples/navi/components/alerts.xpt +0 -0
- data/samples/navi/components/appshell.xpt +0 -0
- data/samples/navi/components/appstartup.xpt +0 -0
- data/samples/navi/components/auth.dll +0 -0
- data/samples/navi/components/autocomplete.xpt +0 -0
- data/samples/navi/components/autoconfig.dll +0 -0
- data/samples/navi/components/autoconfig.xpt +0 -0
- data/samples/navi/components/caps.xpt +0 -0
- data/samples/navi/components/chardet.xpt +0 -0
- data/samples/navi/components/chrome.xpt +0 -0
- data/samples/navi/components/commandhandler.xpt +0 -0
- data/samples/navi/components/commandlines.xpt +0 -0
- data/samples/navi/components/composer.xpt +0 -0
- data/samples/navi/components/compreg.dat +0 -1474
- data/samples/navi/components/content_base.xpt +0 -0
- data/samples/navi/components/content_html.xpt +0 -0
- data/samples/navi/components/content_htmldoc.xpt +0 -0
- data/samples/navi/components/content_xmldoc.xpt +0 -0
- data/samples/navi/components/content_xslt.xpt +0 -0
- data/samples/navi/components/content_xtf.xpt +0 -0
- data/samples/navi/components/directory.xpt +0 -0
- data/samples/navi/components/docshell_base.xpt +0 -0
- data/samples/navi/components/dom.xpt +0 -0
- data/samples/navi/components/dom_base.xpt +0 -0
- data/samples/navi/components/dom_canvas.xpt +0 -0
- data/samples/navi/components/dom_core.xpt +0 -0
- data/samples/navi/components/dom_css.xpt +0 -0
- data/samples/navi/components/dom_events.xpt +0 -0
- data/samples/navi/components/dom_html.xpt +0 -0
- data/samples/navi/components/dom_loadsave.xpt +0 -0
- data/samples/navi/components/dom_range.xpt +0 -0
- data/samples/navi/components/dom_sidebar.xpt +0 -0
- data/samples/navi/components/dom_storage.xpt +0 -0
- data/samples/navi/components/dom_stylesheets.xpt +0 -0
- data/samples/navi/components/dom_svg.xpt +0 -0
- data/samples/navi/components/dom_traversal.xpt +0 -0
- data/samples/navi/components/dom_views.xpt +0 -0
- data/samples/navi/components/dom_xbl.xpt +0 -0
- data/samples/navi/components/dom_xpath.xpt +0 -0
- data/samples/navi/components/dom_xul.xpt +0 -0
- data/samples/navi/components/downloads.xpt +0 -0
- data/samples/navi/components/editor.xpt +0 -0
- data/samples/navi/components/embed_base.xpt +0 -0
- data/samples/navi/components/extensions.xpt +0 -0
- data/samples/navi/components/exthandler.xpt +0 -0
- data/samples/navi/components/fastfind.xpt +0 -0
- data/samples/navi/components/feeds.xpt +0 -0
- data/samples/navi/components/find.xpt +0 -0
- data/samples/navi/components/gfx.xpt +0 -0
- data/samples/navi/components/gksvgrenderer.xpt +0 -0
- data/samples/navi/components/history.xpt +0 -0
- data/samples/navi/components/htmlparser.xpt +0 -0
- data/samples/navi/components/imglib2.xpt +0 -0
- data/samples/navi/components/inspector.xpt +0 -0
- data/samples/navi/components/intl.xpt +0 -0
- data/samples/navi/components/intlcmpt.xpt +0 -0
- data/samples/navi/components/jar.xpt +0 -0
- data/samples/navi/components/jsconsole-clhandler.js +0 -170
- data/samples/navi/components/jsconsole.xpt +0 -0
- data/samples/navi/components/jsdservice.xpt +0 -0
- data/samples/navi/components/layout_base.xpt +0 -0
- data/samples/navi/components/layout_printing.xpt +0 -0
- data/samples/navi/components/layout_xul.xpt +0 -0
- data/samples/navi/components/layout_xul_tree.xpt +0 -0
- data/samples/navi/components/locale.xpt +0 -0
- data/samples/navi/components/lwbrk.xpt +0 -0
- data/samples/navi/components/mimetype.xpt +0 -0
- data/samples/navi/components/mozbrwsr.xpt +0 -0
- data/samples/navi/components/mozfind.xpt +0 -0
- data/samples/navi/components/necko.xpt +0 -0
- data/samples/navi/components/necko_about.xpt +0 -0
- data/samples/navi/components/necko_cache.xpt +0 -0
- data/samples/navi/components/necko_cookie.xpt +0 -0
- data/samples/navi/components/necko_data.xpt +0 -0
- data/samples/navi/components/necko_dns.xpt +0 -0
- data/samples/navi/components/necko_file.xpt +0 -0
- data/samples/navi/components/necko_ftp.xpt +0 -0
- data/samples/navi/components/necko_http.xpt +0 -0
- data/samples/navi/components/necko_res.xpt +0 -0
- data/samples/navi/components/necko_socket.xpt +0 -0
- data/samples/navi/components/necko_strconv.xpt +0 -0
- data/samples/navi/components/necko_viewsource.xpt +0 -0
- data/samples/navi/components/nsCloseAllWindows.js +0 -143
- data/samples/navi/components/nsDefaultCLH.js +0 -231
- data/samples/navi/components/nsDictionary.js +0 -148
- data/samples/navi/components/nsExtensionManager.js +0 -8497
- data/samples/navi/components/nsHelperAppDlg.js +0 -990
- data/samples/navi/components/nsInterfaceInfoToIDL.js +0 -590
- data/samples/navi/components/nsKillAll.js +0 -200
- data/samples/navi/components/nsPostUpdateWin.js +0 -711
- data/samples/navi/components/nsProgressDialog.js +0 -949
- data/samples/navi/components/nsProxyAutoConfig.js +0 -396
- data/samples/navi/components/nsResetPref.js +0 -175
- data/samples/navi/components/nsURLFormatter.js +0 -179
- data/samples/navi/components/nsUpdateService.js +0 -3074
- data/samples/navi/components/nsXULAppInstall.js +0 -301
- data/samples/navi/components/nsXmlRpcClient.js +0 -1038
- data/samples/navi/components/oji.xpt +0 -0
- data/samples/navi/components/passwordmgr.xpt +0 -0
- data/samples/navi/components/pipboot.xpt +0 -0
- data/samples/navi/components/pipnss.xpt +0 -0
- data/samples/navi/components/plugin.xpt +0 -0
- data/samples/navi/components/pref.xpt +0 -0
- data/samples/navi/components/prefetch.xpt +0 -0
- data/samples/navi/components/profile.xpt +0 -0
- data/samples/navi/components/progressDlg.xpt +0 -0
- data/samples/navi/components/proxyObject.xpt +0 -0
- data/samples/navi/components/rdf.xpt +0 -0
- data/samples/navi/components/satchel.xpt +0 -0
- data/samples/navi/components/saxparser.xpt +0 -0
- data/samples/navi/components/shistory.xpt +0 -0
- data/samples/navi/components/storage.xpt +0 -0
- data/samples/navi/components/toolkitprofile.xpt +0 -0
- data/samples/navi/components/transformiix.dll +0 -0
- data/samples/navi/components/txmgr.xpt +0 -0
- data/samples/navi/components/txtsvc.xpt +0 -0
- data/samples/navi/components/uconv.xpt +0 -0
- data/samples/navi/components/unicharutil.xpt +0 -0
- data/samples/navi/components/universalchardet.dll +0 -0
- data/samples/navi/components/update.xpt +0 -0
- data/samples/navi/components/uriloader.xpt +0 -0
- data/samples/navi/components/urlformatter.xpt +0 -0
- data/samples/navi/components/webBrowser_core.xpt +0 -0
- data/samples/navi/components/webbrowserpersist.xpt +0 -0
- data/samples/navi/components/webshell_idls.xpt +0 -0
- data/samples/navi/components/websrvcs.dll +0 -0
- data/samples/navi/components/websrvcs.xpt +0 -0
- data/samples/navi/components/widget.xpt +0 -0
- data/samples/navi/components/windowds.xpt +0 -0
- data/samples/navi/components/windowwatcher.xpt +0 -0
- data/samples/navi/components/xml-rpc.xpt +0 -0
- data/samples/navi/components/xmlextras.dll +0 -0
- data/samples/navi/components/xpcom_base.xpt +0 -0
- data/samples/navi/components/xpcom_components.xpt +0 -0
- data/samples/navi/components/xpcom_ds.xpt +0 -0
- data/samples/navi/components/xpcom_io.xpt +0 -0
- data/samples/navi/components/xpcom_obsolete.xpt +0 -0
- data/samples/navi/components/xpcom_thread.xpt +0 -0
- data/samples/navi/components/xpcom_xpti.xpt +0 -0
- data/samples/navi/components/xpconnect.xpt +0 -0
- data/samples/navi/components/xpinstall.xpt +0 -0
- data/samples/navi/components/xpti.dat +0 -1424
- data/samples/navi/components/xulapp.xpt +0 -0
- data/samples/navi/components/xulapp_setup.xpt +0 -0
- data/samples/navi/components/xuldoc.xpt +0 -0
- data/samples/navi/components/xulrunner.xpt +0 -0
- data/samples/navi/components/xultmpl.xpt +0 -0
- data/samples/navi/components/xulutil.dll +0 -0
- data/samples/navi/controlsNaviMask.png +0 -0
- data/samples/navi/greprefs/all.js +0 -1344
- data/samples/navi/greprefs/security-prefs.js +0 -69
- data/samples/navi/greprefs/xpinstall.js +0 -2
- data/samples/navi/navi_demo.rb +0 -207
- data/samples/navi/plugins/NPSWF32.dll +0 -0
- data/samples/navi/plugins/flashplayer.xpt +0 -0
- data/samples/navi/plugins/npnul32.dll +0 -0
- data/samples/navi/res/EditorOverride.css +0 -359
- data/samples/navi/res/Thumbs.db +0 -0
- data/samples/navi/res/arrow.gif +0 -0
- data/samples/navi/res/arrowd.gif +0 -0
- data/samples/navi/res/bloatcycle.html +0 -40
- data/samples/navi/res/broken-image.gif +0 -0
- data/samples/navi/res/charsetData.properties +0 -199
- data/samples/navi/res/charsetalias.properties +0 -517
- data/samples/navi/res/cmessage.txt +0 -1
- data/samples/navi/res/dtd/xhtml11.dtd +0 -300
- data/samples/navi/res/entityTables/html40Latin1.properties +0 -146
- data/samples/navi/res/entityTables/html40Special.properties +0 -69
- data/samples/navi/res/entityTables/html40Symbols.properties +0 -164
- data/samples/navi/res/entityTables/htmlEntityVersions.properties +0 -50
- data/samples/navi/res/entityTables/transliterate.properties +0 -2367
- data/samples/navi/res/fonts/fontEncoding.properties +0 -127
- data/samples/navi/res/fonts/fontNameMap.properties +0 -134
- data/samples/navi/res/forms.css +0 -531
- data/samples/navi/res/grabber.gif +0 -0
- data/samples/navi/res/hiddenWindow.html +0 -1
- data/samples/navi/res/html/Thumbs.db +0 -0
- data/samples/navi/res/html/gopher-audio.gif +0 -0
- data/samples/navi/res/html/gopher-binary.gif +0 -0
- data/samples/navi/res/html/gopher-find.gif +0 -0
- data/samples/navi/res/html/gopher-image.gif +0 -0
- data/samples/navi/res/html/gopher-menu.gif +0 -0
- data/samples/navi/res/html/gopher-movie.gif +0 -0
- data/samples/navi/res/html/gopher-sound.gif +0 -0
- data/samples/navi/res/html/gopher-telnet.gif +0 -0
- data/samples/navi/res/html/gopher-text.gif +0 -0
- data/samples/navi/res/html/gopher-unknown.gif +0 -0
- data/samples/navi/res/html.css +0 -478
- data/samples/navi/res/langGroups.properties +0 -236
- data/samples/navi/res/language.properties +0 -259
- data/samples/navi/res/loading-image.gif +0 -0
- data/samples/navi/res/quirk.css +0 -282
- data/samples/navi/res/samples/Anieyes.gif +0 -0
- data/samples/navi/res/samples/Thumbs.db +0 -0
- data/samples/navi/res/samples/aform.css +0 -69
- data/samples/navi/res/samples/beeptest.html +0 -18
- data/samples/navi/res/samples/bform.css +0 -45
- data/samples/navi/res/samples/bg.jpg +0 -0
- data/samples/navi/res/samples/cform.css +0 -40
- data/samples/navi/res/samples/checkboxTest.xul +0 -47
- data/samples/navi/res/samples/demoform.css +0 -97
- data/samples/navi/res/samples/find.html +0 -97
- data/samples/navi/res/samples/gear1.gif +0 -0
- data/samples/navi/res/samples/image_props.html +0 -58
- data/samples/navi/res/samples/mozform.css +0 -256
- data/samples/navi/res/samples/printsetup.html +0 -175
- data/samples/navi/res/samples/raptor.jpg +0 -0
- data/samples/navi/res/samples/rock_gra.gif +0 -0
- data/samples/navi/res/samples/scrollbarTest1.xul +0 -66
- data/samples/navi/res/samples/scrollbarTest2.xul +0 -19
- data/samples/navi/res/samples/sliderTest1.xul +0 -14
- data/samples/navi/res/samples/soundtest.html +0 -20
- data/samples/navi/res/samples/test.wav +0 -0
- data/samples/navi/res/samples/test0.html +0 -220
- data/samples/navi/res/samples/test1.html +0 -84
- data/samples/navi/res/samples/test10.html +0 -16
- data/samples/navi/res/samples/test11.html +0 -42
- data/samples/navi/res/samples/test12.html +0 -79
- data/samples/navi/res/samples/test13.html +0 -126
- data/samples/navi/res/samples/test14.html +0 -5
- data/samples/navi/res/samples/test15.html +0 -5
- data/samples/navi/res/samples/test16.html +0 -124
- data/samples/navi/res/samples/test2.html +0 -41
- data/samples/navi/res/samples/test3.html +0 -126
- data/samples/navi/res/samples/test4.html +0 -335
- data/samples/navi/res/samples/test5.html +0 -199
- data/samples/navi/res/samples/test6.html +0 -335
- data/samples/navi/res/samples/test7.html +0 -11
- data/samples/navi/res/samples/test8-1.html +0 -66
- data/samples/navi/res/samples/test8.html +0 -662
- data/samples/navi/res/samples/test8dom.html +0 -64
- data/samples/navi/res/samples/test8sca.html +0 -308
- data/samples/navi/res/samples/test8siz.html +0 -224
- data/samples/navi/res/samples/test8tab.html +0 -9
- data/samples/navi/res/samples/test9.html +0 -12
- data/samples/navi/res/samples/test9a.html +0 -39
- data/samples/navi/res/samples/test9b.html +0 -16
- data/samples/navi/res/samples/test_ed.html +0 -5
- data/samples/navi/res/samples/test_form.html +0 -34
- data/samples/navi/res/samples/test_gfx.html +0 -75
- data/samples/navi/res/samples/test_lbox.html +0 -100
- data/samples/navi/res/samples/test_pr.html +0 -87
- data/samples/navi/res/samples/test_weight.html +0 -45
- data/samples/navi/res/samples/toolbarTest1.xul +0 -51
- data/samples/navi/res/samples/treeTest1.css +0 -62
- data/samples/navi/res/samples/treeTest1.xul +0 -110
- data/samples/navi/res/samples/xulTest.css +0 -130
- data/samples/navi/res/svg.css +0 -64
- data/samples/navi/res/table-add-column-after-active.gif +0 -0
- data/samples/navi/res/table-add-column-after-hover.gif +0 -0
- data/samples/navi/res/table-add-column-after.gif +0 -0
- data/samples/navi/res/table-add-column-before-active.gif +0 -0
- data/samples/navi/res/table-add-column-before-hover.gif +0 -0
- data/samples/navi/res/table-add-column-before.gif +0 -0
- data/samples/navi/res/table-add-row-after-active.gif +0 -0
- data/samples/navi/res/table-add-row-after-hover.gif +0 -0
- data/samples/navi/res/table-add-row-after.gif +0 -0
- data/samples/navi/res/table-add-row-before-active.gif +0 -0
- data/samples/navi/res/table-add-row-before-hover.gif +0 -0
- data/samples/navi/res/table-add-row-before.gif +0 -0
- data/samples/navi/res/table-remove-column-active.gif +0 -0
- data/samples/navi/res/table-remove-column-hover.gif +0 -0
- data/samples/navi/res/table-remove-column.gif +0 -0
- data/samples/navi/res/table-remove-row-active.gif +0 -0
- data/samples/navi/res/table-remove-row-hover.gif +0 -0
- data/samples/navi/res/table-remove-row.gif +0 -0
- data/samples/navi/res/throbber/Thumbs.db +0 -0
- data/samples/navi/res/throbber/anim.gif +0 -0
- data/samples/navi/res/throbber/anims00.gif +0 -0
- data/samples/navi/res/throbber/anims01.gif +0 -0
- data/samples/navi/res/throbber/anims02.gif +0 -0
- data/samples/navi/res/throbber/anims03.gif +0 -0
- data/samples/navi/res/throbber/anims04.gif +0 -0
- data/samples/navi/res/throbber/anims05.gif +0 -0
- data/samples/navi/res/throbber/anims06.gif +0 -0
- data/samples/navi/res/throbber/anims07.gif +0 -0
- data/samples/navi/res/throbber/anims08.gif +0 -0
- data/samples/navi/res/throbber/anims09.gif +0 -0
- data/samples/navi/res/throbber/anims10.gif +0 -0
- data/samples/navi/res/throbber/anims11.gif +0 -0
- data/samples/navi/res/throbber/anims12.gif +0 -0
- data/samples/navi/res/throbber/anims13.gif +0 -0
- data/samples/navi/res/throbber/anims14.gif +0 -0
- data/samples/navi/res/throbber/anims15.gif +0 -0
- data/samples/navi/res/throbber/anims16.gif +0 -0
- data/samples/navi/res/throbber/anims17.gif +0 -0
- data/samples/navi/res/throbber/anims18.gif +0 -0
- data/samples/navi/res/throbber/anims19.gif +0 -0
- data/samples/navi/res/throbber/anims20.gif +0 -0
- data/samples/navi/res/throbber/anims21.gif +0 -0
- data/samples/navi/res/throbber/anims22.gif +0 -0
- data/samples/navi/res/throbber/anims23.gif +0 -0
- data/samples/navi/res/throbber/anims24.gif +0 -0
- data/samples/navi/res/throbber/anims25.gif +0 -0
- data/samples/navi/res/throbber/anims26.gif +0 -0
- data/samples/navi/res/throbber/anims27.gif +0 -0
- data/samples/navi/res/throbber/anims28.gif +0 -0
- data/samples/navi/res/throbber/anims29.gif +0 -0
- data/samples/navi/res/ua.css +0 -235
- data/samples/navi/res/viewer.properties +0 -1
- data/samples/navi/res/viewsource.css +0 -118
- data/samples/navi/res/wincharset.properties +0 -55
- data/samples/navi/resources.cfg +0 -14
- data/samples/navi/testNaviMask.png +0 -0
- data/samples/render_run_log.5796 +0 -891
@@ -1,711 +0,0 @@
|
|
1
|
-
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
3
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
4
|
-
*
|
5
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
6
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
7
|
-
* the License. You may obtain a copy of the License at
|
8
|
-
* http://www.mozilla.org/MPL/
|
9
|
-
*
|
10
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
11
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
12
|
-
* for the specific language governing rights and limitations under the
|
13
|
-
* License.
|
14
|
-
*
|
15
|
-
* The Original Code is the Update Service.
|
16
|
-
*
|
17
|
-
* The Initial Developer of the Original Code is Google Inc.
|
18
|
-
* Portions created by the Initial Developer are Copyright (C) 2005
|
19
|
-
* the Initial Developer. All Rights Reserved.
|
20
|
-
*
|
21
|
-
* Contributor(s):
|
22
|
-
* Darin Fisher <darin@meer.net> (original author)
|
23
|
-
*
|
24
|
-
* Alternatively, the contents of this file may be used under the terms of
|
25
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
26
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
27
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
28
|
-
* of those above. If you wish to allow use of your version of this file only
|
29
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
30
|
-
* use your version of this file under the terms of the MPL, indicate your
|
31
|
-
* decision by deleting the provisions above and replace them with the notice
|
32
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
33
|
-
* the provisions above, a recipient may use your version of this file under
|
34
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
35
|
-
*
|
36
|
-
* ***** END LICENSE BLOCK ***** */
|
37
|
-
|
38
|
-
/**
|
39
|
-
* This file contains an implementation of nsIRunnable, which may be invoked
|
40
|
-
* to perform post-update modifications to the windows registry and uninstall
|
41
|
-
* logs required to complete an update of the application. This code is very
|
42
|
-
* specific to the xpinstall wizard for windows.
|
43
|
-
*/
|
44
|
-
|
45
|
-
const URI_BRAND_PROPERTIES = "chrome://branding/locale/brand.properties";
|
46
|
-
|
47
|
-
const KEY_APPDIR = "XCurProcD";
|
48
|
-
const KEY_TMPDIR = "TmpD";
|
49
|
-
const KEY_UPDROOT = "UpdRootD";
|
50
|
-
const KEY_UAPPDATA = "UAppData";
|
51
|
-
|
52
|
-
// see prio.h
|
53
|
-
const PR_RDONLY = 0x01;
|
54
|
-
const PR_WRONLY = 0x02;
|
55
|
-
const PR_APPEND = 0x10;
|
56
|
-
|
57
|
-
const PERMS_FILE = 0644;
|
58
|
-
const PERMS_DIR = 0700;
|
59
|
-
|
60
|
-
const nsIWindowsRegKey = Components.interfaces.nsIWindowsRegKey;
|
61
|
-
|
62
|
-
var gConsole = null;
|
63
|
-
var gAppUpdateLogPostUpdate = false;
|
64
|
-
|
65
|
-
//-----------------------------------------------------------------------------
|
66
|
-
|
67
|
-
/**
|
68
|
-
* Console logging support
|
69
|
-
*/
|
70
|
-
function LOG(s) {
|
71
|
-
if (gAppUpdateLogPostUpdate) {
|
72
|
-
dump("*** PostUpdateWin: " + s + "\n");
|
73
|
-
gConsole.logStringMessage(s);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
/**
|
78
|
-
* This function queries the XPCOM directory service.
|
79
|
-
*/
|
80
|
-
function getFile(key) {
|
81
|
-
var dirSvc =
|
82
|
-
Components.classes["@mozilla.org/file/directory_service;1"].
|
83
|
-
getService(Components.interfaces.nsIProperties);
|
84
|
-
return dirSvc.get(key, Components.interfaces.nsIFile);
|
85
|
-
}
|
86
|
-
|
87
|
-
/**
|
88
|
-
* Return the full path given a relative path and a base directory.
|
89
|
-
*/
|
90
|
-
function getFileRelativeTo(dir, relPath) {
|
91
|
-
var file = dir.clone().QueryInterface(Components.interfaces.nsILocalFile);
|
92
|
-
file.setRelativeDescriptor(dir, relPath);
|
93
|
-
return file;
|
94
|
-
}
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Creates a new file object given a native file path.
|
98
|
-
* @param path
|
99
|
-
* The native file path.
|
100
|
-
* @return nsILocalFile object for the given native file path.
|
101
|
-
*/
|
102
|
-
function newFile(path) {
|
103
|
-
var file = Components.classes["@mozilla.org/file/local;1"]
|
104
|
-
.createInstance(Components.interfaces.nsILocalFile);
|
105
|
-
file.initWithPath(path);
|
106
|
-
return file;
|
107
|
-
}
|
108
|
-
|
109
|
-
/**
|
110
|
-
* This function returns a file input stream.
|
111
|
-
*/
|
112
|
-
function openFileInputStream(file) {
|
113
|
-
var stream =
|
114
|
-
Components.classes["@mozilla.org/network/file-input-stream;1"].
|
115
|
-
createInstance(Components.interfaces.nsIFileInputStream);
|
116
|
-
stream.init(file, PR_RDONLY, 0, 0);
|
117
|
-
return stream;
|
118
|
-
}
|
119
|
-
|
120
|
-
/**
|
121
|
-
* This function returns a file output stream.
|
122
|
-
*/
|
123
|
-
function openFileOutputStream(file, flags) {
|
124
|
-
var stream =
|
125
|
-
Components.classes["@mozilla.org/network/file-output-stream;1"].
|
126
|
-
createInstance(Components.interfaces.nsIFileOutputStream);
|
127
|
-
stream.init(file, flags, 0644, 0);
|
128
|
-
return stream;
|
129
|
-
}
|
130
|
-
|
131
|
-
//-----------------------------------------------------------------------------
|
132
|
-
|
133
|
-
const PREFIX_FILE = "File: ";
|
134
|
-
|
135
|
-
function InstallLogWriter() {
|
136
|
-
}
|
137
|
-
InstallLogWriter.prototype = {
|
138
|
-
_outputStream: null, // nsIOutputStream to the install wizard log file
|
139
|
-
|
140
|
-
/**
|
141
|
-
* Write a single line to the output stream.
|
142
|
-
*/
|
143
|
-
_writeLine: function(s) {
|
144
|
-
s = s + "\r\n";
|
145
|
-
this._outputStream.write(s, s.length);
|
146
|
-
},
|
147
|
-
|
148
|
-
/**
|
149
|
-
* This function creates an empty uninstall update log file if it doesn't
|
150
|
-
* exist and returns a reference to the resulting nsIFile.
|
151
|
-
*/
|
152
|
-
_getUninstallLogFile: function() {
|
153
|
-
var file = getFile(KEY_APPDIR);
|
154
|
-
file.append("uninstall");
|
155
|
-
if (!file.exists())
|
156
|
-
return null;
|
157
|
-
|
158
|
-
file.append("uninstall.log");
|
159
|
-
if (!file.exists())
|
160
|
-
file.create(Components.interfaces.nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
|
161
|
-
|
162
|
-
return file;
|
163
|
-
},
|
164
|
-
|
165
|
-
/**
|
166
|
-
* Return the update.log file. Use last-update.log file in case the
|
167
|
-
* updates/0 directory has already been cleaned out (see bug 311302).
|
168
|
-
*/
|
169
|
-
_getUpdateLogFile: function() {
|
170
|
-
function appendUpdateLogPath(root) {
|
171
|
-
var file = root.clone();
|
172
|
-
file.append("updates");
|
173
|
-
file.append("0");
|
174
|
-
file.append("update.log");
|
175
|
-
if (file.exists())
|
176
|
-
return file;
|
177
|
-
|
178
|
-
file = root;
|
179
|
-
file.append("updates");
|
180
|
-
file.append("last-update.log");
|
181
|
-
if (file.exists())
|
182
|
-
return file;
|
183
|
-
|
184
|
-
return null;
|
185
|
-
}
|
186
|
-
|
187
|
-
// See the local appdata first if app dir is under Program Files.
|
188
|
-
var file = null;
|
189
|
-
try {
|
190
|
-
file = appendUpdateLogPath(getFile(KEY_UPDROOT));
|
191
|
-
|
192
|
-
// When updating from Fx 2.0.0.1 to 2.0.0.3 (or later) on Vista,
|
193
|
-
// we will have to see also user app data (see bug 351949).
|
194
|
-
if (!file)
|
195
|
-
file = appendUpdateLogPath(getFile(KEY_UAPPDATA));
|
196
|
-
} catch (e) {
|
197
|
-
}
|
198
|
-
|
199
|
-
// See the app dir if not found or app dir is out of Program Files.
|
200
|
-
if (!file)
|
201
|
-
file = appendUpdateLogPath(getFile(KEY_APPDIR));
|
202
|
-
|
203
|
-
return file;
|
204
|
-
},
|
205
|
-
|
206
|
-
/**
|
207
|
-
* Read update.log to extract information about files that were
|
208
|
-
* newly added for this update.
|
209
|
-
*/
|
210
|
-
_readUpdateLog: function(logFile, entries) {
|
211
|
-
var stream;
|
212
|
-
try {
|
213
|
-
stream = openFileInputStream(logFile).
|
214
|
-
QueryInterface(Components.interfaces.nsILineInputStream);
|
215
|
-
|
216
|
-
var line = {};
|
217
|
-
while (stream.readLine(line)) {
|
218
|
-
var data = line.value.split(" ");
|
219
|
-
if (data[0] == "EXECUTE" && data[1] == "ADD") {
|
220
|
-
// The uninstaller requires the path separator to be "\" and
|
221
|
-
// relative paths to start with a "\".
|
222
|
-
var relPath = "\\" + data[2].replace(/\//g, "\\");
|
223
|
-
entries[relPath] = null;
|
224
|
-
}
|
225
|
-
}
|
226
|
-
} finally {
|
227
|
-
if (stream)
|
228
|
-
stream.close();
|
229
|
-
}
|
230
|
-
},
|
231
|
-
|
232
|
-
/**
|
233
|
-
* Read install_wizard log files to extract information about files that were
|
234
|
-
* previously added by the xpinstall installer and software update.
|
235
|
-
*/
|
236
|
-
_readXPInstallLog: function(logFile, entries) {
|
237
|
-
var stream;
|
238
|
-
try {
|
239
|
-
stream = openFileInputStream(logFile).
|
240
|
-
QueryInterface(Components.interfaces.nsILineInputStream);
|
241
|
-
|
242
|
-
function fixPath(path, offset) {
|
243
|
-
return path.substr(offset).replace(appDirPath, "");
|
244
|
-
}
|
245
|
-
|
246
|
-
var appDir = getFile(KEY_APPDIR);
|
247
|
-
var appDirPath = appDir.path;
|
248
|
-
var line = {};
|
249
|
-
while (stream.readLine(line)) {
|
250
|
-
var entry = line.value;
|
251
|
-
// This works with both the entries from xpinstall (e.g. Installing: )
|
252
|
-
// and from update (e.g. installing: )
|
253
|
-
var searchStr = "nstalling: ";
|
254
|
-
var index = entry.indexOf(searchStr);
|
255
|
-
if (index != -1) {
|
256
|
-
entries[fixPath(entry, index + searchStr.length)] = null;
|
257
|
-
continue;
|
258
|
-
}
|
259
|
-
|
260
|
-
searchStr = "Replacing: ";
|
261
|
-
index = entry.indexOf(searchStr);
|
262
|
-
if (index != -1) {
|
263
|
-
entries[fixPath(entry, index + searchStr.length)] = null;
|
264
|
-
continue;
|
265
|
-
}
|
266
|
-
|
267
|
-
searchStr = "Windows Shortcut: ";
|
268
|
-
index = entry.indexOf(searchStr);
|
269
|
-
if (index != -1) {
|
270
|
-
entries[fixPath(entry + ".lnk", index + searchStr.length)] = null;
|
271
|
-
continue;
|
272
|
-
}
|
273
|
-
}
|
274
|
-
} finally {
|
275
|
-
if (stream)
|
276
|
-
stream.close();
|
277
|
-
}
|
278
|
-
},
|
279
|
-
|
280
|
-
_readUninstallLog: function(logFile, entries) {
|
281
|
-
var stream;
|
282
|
-
try {
|
283
|
-
stream = openFileInputStream(logFile).
|
284
|
-
QueryInterface(Components.interfaces.nsILineInputStream);
|
285
|
-
|
286
|
-
var line = {};
|
287
|
-
var searchStr = "File: ";
|
288
|
-
while (stream.readLine(line)) {
|
289
|
-
var index = line.value.indexOf(searchStr);
|
290
|
-
if (index != -1) {
|
291
|
-
var str = line.value.substr(index + searchStr.length);
|
292
|
-
entries.push(str);
|
293
|
-
}
|
294
|
-
}
|
295
|
-
} finally {
|
296
|
-
if (stream)
|
297
|
-
stream.close();
|
298
|
-
}
|
299
|
-
},
|
300
|
-
|
301
|
-
/**
|
302
|
-
* This function initializes the log writer and is responsible for
|
303
|
-
* translating 'update.log' and the 'install_wizard' logs to the NSIS format.
|
304
|
-
*/
|
305
|
-
begin: function() {
|
306
|
-
var updateLog = this._getUpdateLogFile();
|
307
|
-
if (!updateLog)
|
308
|
-
return;
|
309
|
-
|
310
|
-
var newEntries = { };
|
311
|
-
this._readUpdateLog(updateLog, newEntries);
|
312
|
-
|
313
|
-
try {
|
314
|
-
const nsIDirectoryEnumerator = Components.interfaces.nsIDirectoryEnumerator;
|
315
|
-
const nsILocalFile = Components.interfaces.nsILocalFile;
|
316
|
-
var prefixWizLog = "install_wizard";
|
317
|
-
var uninstallDir = getFile(KEY_APPDIR);
|
318
|
-
uninstallDir.append("uninstall");
|
319
|
-
var entries = uninstallDir.directoryEntries.QueryInterface(nsIDirectoryEnumerator);
|
320
|
-
while (true) {
|
321
|
-
var wizLog = entries.nextFile;
|
322
|
-
if (!wizLog)
|
323
|
-
break;
|
324
|
-
if (wizLog instanceof nsILocalFile && !wizLog.isDirectory() &&
|
325
|
-
wizLog.leafName.indexOf(prefixWizLog) == 0) {
|
326
|
-
this._readXPInstallLog(wizLog, newEntries);
|
327
|
-
wizLog.remove(false);
|
328
|
-
}
|
329
|
-
}
|
330
|
-
}
|
331
|
-
catch (e) {}
|
332
|
-
if (entries)
|
333
|
-
entries.close();
|
334
|
-
|
335
|
-
var uninstallLog = this._getUninstallLogFile();
|
336
|
-
var oldEntries = [];
|
337
|
-
this._readUninstallLog(uninstallLog, oldEntries);
|
338
|
-
|
339
|
-
// Prevent writing duplicate entries in the log file
|
340
|
-
for (var relPath in newEntries) {
|
341
|
-
if (oldEntries.indexOf(relPath) != -1)
|
342
|
-
delete newEntries[relPath];
|
343
|
-
}
|
344
|
-
|
345
|
-
if (newEntries.length == 0)
|
346
|
-
return;
|
347
|
-
|
348
|
-
// since we are not running with elevated privs, we can't write out
|
349
|
-
// the log file (at least, not on Vista). So, write the output to
|
350
|
-
// temp, and then later, we'll pass the file (gCopiedLog) to
|
351
|
-
// the post update clean up process, which can copy it to
|
352
|
-
// the desired location (because it will have elevated privs)
|
353
|
-
gCopiedLog = getFile(KEY_TMPDIR);
|
354
|
-
gCopiedLog.append("uninstall");
|
355
|
-
gCopiedLog.createUnique(gCopiedLog.DIRECTORY_TYPE, PERMS_DIR);
|
356
|
-
if (uninstallLog)
|
357
|
-
uninstallLog.copyTo(gCopiedLog, "uninstall.log");
|
358
|
-
gCopiedLog.append("uninstall.log");
|
359
|
-
|
360
|
-
LOG("uninstallLog = " + uninstallLog.path);
|
361
|
-
LOG("copiedLog = " + gCopiedLog.path);
|
362
|
-
|
363
|
-
if (!gCopiedLog.exists())
|
364
|
-
gCopiedLog.create(Components.interfaces.nsILocalFile.NORMAL_FILE_TYPE,
|
365
|
-
PERMS_FILE);
|
366
|
-
|
367
|
-
this._outputStream =
|
368
|
-
openFileOutputStream(gCopiedLog, PR_WRONLY | PR_APPEND);
|
369
|
-
|
370
|
-
// The NSIS uninstaller deletes all directories where the installer has
|
371
|
-
// added a file if the directory is empty after the files have been removed
|
372
|
-
// so there is no need to log directories.
|
373
|
-
for (var relPath in newEntries)
|
374
|
-
this._writeLine(PREFIX_FILE + relPath);
|
375
|
-
},
|
376
|
-
|
377
|
-
end: function() {
|
378
|
-
if (!this._outputStream)
|
379
|
-
return;
|
380
|
-
this._outputStream.close();
|
381
|
-
this._outputStream = null;
|
382
|
-
}
|
383
|
-
};
|
384
|
-
|
385
|
-
var installLogWriter;
|
386
|
-
var gCopiedLog;
|
387
|
-
|
388
|
-
//-----------------------------------------------------------------------------
|
389
|
-
|
390
|
-
/**
|
391
|
-
* A thin wrapper around nsIWindowsRegKey
|
392
|
-
* note, only the "read" methods are exposed. If you want to write
|
393
|
-
* to the registry on Vista, you need to be a priveleged app.
|
394
|
-
* We've moved that code into the uninstaller.
|
395
|
-
*/
|
396
|
-
function RegKey() {
|
397
|
-
// Internally, we may pass parameters to this constructor.
|
398
|
-
if (arguments.length == 3) {
|
399
|
-
this._key = arguments[0];
|
400
|
-
this._root = arguments[1];
|
401
|
-
this._path = arguments[2];
|
402
|
-
} else {
|
403
|
-
this._key =
|
404
|
-
Components.classes["@mozilla.org/windows-registry-key;1"].
|
405
|
-
createInstance(nsIWindowsRegKey);
|
406
|
-
}
|
407
|
-
}
|
408
|
-
RegKey.prototype = {
|
409
|
-
_key: null,
|
410
|
-
_root: null,
|
411
|
-
_path: null,
|
412
|
-
|
413
|
-
ACCESS_READ: nsIWindowsRegKey.ACCESS_READ,
|
414
|
-
|
415
|
-
ROOT_KEY_CURRENT_USER: nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
416
|
-
ROOT_KEY_LOCAL_MACHINE: nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
|
417
|
-
ROOT_KEY_CLASSES_ROOT: nsIWindowsRegKey.ROOT_KEY_CLASSES_ROOT,
|
418
|
-
|
419
|
-
close: function() {
|
420
|
-
this._key.close();
|
421
|
-
this._root = null;
|
422
|
-
this._path = null;
|
423
|
-
},
|
424
|
-
|
425
|
-
open: function(rootKey, path, mode) {
|
426
|
-
this._key.open(rootKey, path, mode);
|
427
|
-
this._root = rootKey;
|
428
|
-
this._path = path;
|
429
|
-
},
|
430
|
-
|
431
|
-
openChild: function(path, mode) {
|
432
|
-
var child = this._key.openChild(path, mode);
|
433
|
-
return new RegKey(child, this._root, this._path + "\\" + path);
|
434
|
-
},
|
435
|
-
|
436
|
-
readStringValue: function(name) {
|
437
|
-
return this._key.readStringValue(name);
|
438
|
-
},
|
439
|
-
|
440
|
-
hasValue: function(name) {
|
441
|
-
return this._key.hasValue(name);
|
442
|
-
},
|
443
|
-
|
444
|
-
hasChild: function(name) {
|
445
|
-
return this._key.hasChild(name);
|
446
|
-
},
|
447
|
-
|
448
|
-
get childCount() {
|
449
|
-
return this._key.childCount;
|
450
|
-
},
|
451
|
-
|
452
|
-
getChildName: function(index) {
|
453
|
-
return this._key.getChildName(index);
|
454
|
-
},
|
455
|
-
|
456
|
-
toString: function() {
|
457
|
-
var root;
|
458
|
-
switch (this._root) {
|
459
|
-
case this.ROOT_KEY_CLASSES_ROOT:
|
460
|
-
root = "HKEY_KEY_CLASSES_ROOT";
|
461
|
-
break;
|
462
|
-
case this.ROOT_KEY_LOCAL_MACHINE:
|
463
|
-
root = "HKEY_LOCAL_MACHINE";
|
464
|
-
break;
|
465
|
-
case this.ROOT_KEY_CURRENT_USER:
|
466
|
-
root = "HKEY_CURRENT_USER";
|
467
|
-
break;
|
468
|
-
default:
|
469
|
-
LOG("unknown root key");
|
470
|
-
return "";
|
471
|
-
}
|
472
|
-
return root + "\\" + this._path;
|
473
|
-
}
|
474
|
-
};
|
475
|
-
|
476
|
-
/**
|
477
|
-
* This method walks the registry looking for the registry keys of
|
478
|
-
* the previous version of the application.
|
479
|
-
*/
|
480
|
-
function haveOldInstall(key, brandFullName, version) {
|
481
|
-
var ourInstallDir = getFile(KEY_APPDIR);
|
482
|
-
var result = false;
|
483
|
-
var childKey, productKey, mainKey;
|
484
|
-
try {
|
485
|
-
for (var i = 0; i < key.childCount; ++i) {
|
486
|
-
var childName = key.getChildName(i);
|
487
|
-
childKey = key.openChild(childName, key.ACCESS_READ);
|
488
|
-
if (childKey.hasValue("CurrentVersion")) {
|
489
|
-
for (var j = 0; j < childKey.childCount; ++j) {
|
490
|
-
var productVer = childKey.getChildName(j);
|
491
|
-
productKey = childKey.openChild(productVer, key.ACCESS_READ);
|
492
|
-
if (productKey.hasChild("Main")) {
|
493
|
-
mainKey = productKey.openChild("Main", key.ACCESS_READ);
|
494
|
-
var installDir = mainKey.readStringValue("Install Directory");
|
495
|
-
mainKey.close();
|
496
|
-
LOG("old install? " + installDir + " vs " + ourInstallDir.path);
|
497
|
-
LOG("old install? " + childName + " vs " + brandFullName);
|
498
|
-
LOG("old install? " + productVer.split(" ")[0] + " vs " + version);
|
499
|
-
if (newFile(installDir).equals(ourInstallDir) &&
|
500
|
-
(childName != brandFullName ||
|
501
|
-
productVer.split(" ")[0] != version)) {
|
502
|
-
result = true;
|
503
|
-
}
|
504
|
-
}
|
505
|
-
productKey.close();
|
506
|
-
if (result)
|
507
|
-
break;
|
508
|
-
}
|
509
|
-
}
|
510
|
-
childKey.close();
|
511
|
-
if (result)
|
512
|
-
break;
|
513
|
-
}
|
514
|
-
} catch (e) {
|
515
|
-
result = false;
|
516
|
-
if (childKey)
|
517
|
-
childKey.close();
|
518
|
-
if (productKey)
|
519
|
-
productKey.close();
|
520
|
-
if (mainKey)
|
521
|
-
mainKey.close();
|
522
|
-
}
|
523
|
-
return result;
|
524
|
-
}
|
525
|
-
|
526
|
-
function checkRegistry()
|
527
|
-
{
|
528
|
-
LOG("checkRegistry");
|
529
|
-
|
530
|
-
var result = false;
|
531
|
-
|
532
|
-
// Firefox is the only toolkit app that needs to do this.
|
533
|
-
// return false for other applications.
|
534
|
-
var app = Components.classes["@mozilla.org/xre/app-info;1"].
|
535
|
-
getService(Components.interfaces.nsIXULAppInfo);
|
536
|
-
if (app.name == "Firefox") {
|
537
|
-
try {
|
538
|
-
var key = new RegKey();
|
539
|
-
key.open(RegKey.prototype.ROOT_KEY_CLASSES_ROOT, "FirefoxHTML\\shell\\open\\command", key.ACCESS_READ);
|
540
|
-
var commandKey = key.readStringValue("");
|
541
|
-
LOG("commandKey = " + commandKey);
|
542
|
-
// if "-requestPending" is not found, we need to do the cleanup
|
543
|
-
result = (commandKey.indexOf("-requestPending") == -1);
|
544
|
-
} catch (e) {
|
545
|
-
LOG("failed to open command key for FirefoxHTML: " + e);
|
546
|
-
}
|
547
|
-
key.close();
|
548
|
-
}
|
549
|
-
return result;
|
550
|
-
}
|
551
|
-
|
552
|
-
function checkOldInstall(rootKey, vendorShortName, brandFullName, version)
|
553
|
-
{
|
554
|
-
var key = new RegKey();
|
555
|
-
var result = false;
|
556
|
-
|
557
|
-
try {
|
558
|
-
key.open(rootKey, "SOFTWARE\\" + vendorShortName, key.ACCESS_READ);
|
559
|
-
LOG("checkOldInstall: " + key + " " + brandFullName + " " + version);
|
560
|
-
result = haveOldInstall(key, brandFullName, version);
|
561
|
-
} catch (e) {
|
562
|
-
LOG("failed trying to find old install: " + e);
|
563
|
-
}
|
564
|
-
key.close();
|
565
|
-
return result;
|
566
|
-
}
|
567
|
-
|
568
|
-
//-----------------------------------------------------------------------------
|
569
|
-
|
570
|
-
function nsPostUpdateWin() {
|
571
|
-
gConsole = Components.classes["@mozilla.org/consoleservice;1"]
|
572
|
-
.getService(Components.interfaces.nsIConsoleService);
|
573
|
-
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
574
|
-
getService(Components.interfaces.nsIPrefBranch);
|
575
|
-
try {
|
576
|
-
gAppUpdateLogPostUpdate = prefs.getBoolPref("app.update.log.all");
|
577
|
-
}
|
578
|
-
catch (ex) {
|
579
|
-
}
|
580
|
-
try {
|
581
|
-
if (!gAppUpdateLogPostUpdate)
|
582
|
-
gAppUpdateLogPostUpdate = prefs.getBoolPref("app.update.log.PostUpdate");
|
583
|
-
}
|
584
|
-
catch (ex) {
|
585
|
-
}
|
586
|
-
}
|
587
|
-
|
588
|
-
nsPostUpdateWin.prototype = {
|
589
|
-
QueryInterface: function(iid) {
|
590
|
-
if (iid.equals(Components.interfaces.nsIRunnable) ||
|
591
|
-
iid.equals(Components.interfaces.nsISupports))
|
592
|
-
return this;
|
593
|
-
throw Components.results.NS_ERROR_NO_INTERFACE;
|
594
|
-
},
|
595
|
-
|
596
|
-
run: function() {
|
597
|
-
try {
|
598
|
-
installLogWriter = new InstallLogWriter();
|
599
|
-
try {
|
600
|
-
installLogWriter.begin();
|
601
|
-
} finally {
|
602
|
-
installLogWriter.end();
|
603
|
-
installLogWriter = null;
|
604
|
-
}
|
605
|
-
} catch (e) {
|
606
|
-
LOG(e);
|
607
|
-
}
|
608
|
-
|
609
|
-
var app =
|
610
|
-
Components.classes["@mozilla.org/xre/app-info;1"].
|
611
|
-
getService(Components.interfaces.nsIXULAppInfo).
|
612
|
-
QueryInterface(Components.interfaces.nsIXULRuntime);
|
613
|
-
|
614
|
-
var sbs =
|
615
|
-
Components.classes["@mozilla.org/intl/stringbundle;1"].
|
616
|
-
getService(Components.interfaces.nsIStringBundleService);
|
617
|
-
var brandBundle = sbs.createBundle(URI_BRAND_PROPERTIES);
|
618
|
-
|
619
|
-
var vendorShortName;
|
620
|
-
try {
|
621
|
-
// The Thunderbird vendorShortName is "Mozilla Thunderbird", but we
|
622
|
-
// just want "Thunderbird", so allow it to be overridden in prefs.
|
623
|
-
|
624
|
-
var prefs =
|
625
|
-
Components.classes["@mozilla.org/preferences-service;1"].
|
626
|
-
getService(Components.interfaces.nsIPrefBranch);
|
627
|
-
|
628
|
-
vendorShortName = prefs.getCharPref("app.update.vendorName.override");
|
629
|
-
}
|
630
|
-
catch (e) {
|
631
|
-
vendorShortName = brandBundle.GetStringFromName("vendorShortName");
|
632
|
-
}
|
633
|
-
var brandFullName = brandBundle.GetStringFromName("brandFullName");
|
634
|
-
|
635
|
-
if (!gCopiedLog &&
|
636
|
-
!checkRegistry() &&
|
637
|
-
!checkOldInstall(RegKey.prototype.ROOT_KEY_LOCAL_MACHINE,
|
638
|
-
vendorShortName, brandFullName, app.version) &&
|
639
|
-
!checkOldInstall(RegKey.prototype.ROOT_KEY_CURRENT_USER,
|
640
|
-
vendorShortName, brandFullName, app.version)) {
|
641
|
-
LOG("nothing to do, so don't launch the helper");
|
642
|
-
return;
|
643
|
-
}
|
644
|
-
|
645
|
-
try {
|
646
|
-
var winAppHelper =
|
647
|
-
app.QueryInterface(Components.interfaces.nsIWinAppHelper);
|
648
|
-
|
649
|
-
// note, gCopiedLog could be null
|
650
|
-
if (gCopiedLog)
|
651
|
-
LOG("calling postUpdate with: " + gCopiedLog.path);
|
652
|
-
else
|
653
|
-
LOG("calling postUpdate without a log");
|
654
|
-
|
655
|
-
winAppHelper.postUpdate(gCopiedLog);
|
656
|
-
} catch (e) {
|
657
|
-
LOG("failed to launch the helper to do the post update cleanup: " + e);
|
658
|
-
}
|
659
|
-
}
|
660
|
-
};
|
661
|
-
|
662
|
-
//-----------------------------------------------------------------------------
|
663
|
-
|
664
|
-
var gModule = {
|
665
|
-
registerSelf: function(compMgr, fileSpec, location, type) {
|
666
|
-
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
|
667
|
-
|
668
|
-
for (var key in this._objects) {
|
669
|
-
var obj = this._objects[key];
|
670
|
-
compMgr.registerFactoryLocation(obj.CID, obj.className, obj.contractID,
|
671
|
-
fileSpec, location, type);
|
672
|
-
}
|
673
|
-
},
|
674
|
-
|
675
|
-
getClassObject: function(compMgr, cid, iid) {
|
676
|
-
if (!iid.equals(Components.interfaces.nsIFactory))
|
677
|
-
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
678
|
-
|
679
|
-
for (var key in this._objects) {
|
680
|
-
if (cid.equals(this._objects[key].CID))
|
681
|
-
return this._objects[key].factory;
|
682
|
-
}
|
683
|
-
|
684
|
-
throw Components.results.NS_ERROR_NO_INTERFACE;
|
685
|
-
},
|
686
|
-
|
687
|
-
_makeFactory: #1= function(ctor) {
|
688
|
-
function ci(outer, iid) {
|
689
|
-
if (outer != null)
|
690
|
-
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
691
|
-
return (new ctor()).QueryInterface(iid);
|
692
|
-
}
|
693
|
-
return { createInstance: ci };
|
694
|
-
},
|
695
|
-
|
696
|
-
_objects: {
|
697
|
-
manager: { CID : Components.ID("{d15b970b-5472-40df-97e8-eb03a04baa82}"),
|
698
|
-
contractID : "@mozilla.org/updates/post-update;1",
|
699
|
-
className : "nsPostUpdateWin",
|
700
|
-
factory : #1#(nsPostUpdateWin)
|
701
|
-
},
|
702
|
-
},
|
703
|
-
|
704
|
-
canUnload: function(compMgr) {
|
705
|
-
return true;
|
706
|
-
}
|
707
|
-
};
|
708
|
-
|
709
|
-
function NSGetModule(compMgr, fileSpec) {
|
710
|
-
return gModule;
|
711
|
-
}
|