home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 March / Chip_2011.03_CD.iso / Tools / yabar.msi / fil3DD1AE30F0E519337F60FC9D3C19333A < prev    next >
Encoding:
Text File  |  2010-04-16  |  19.3 KB  |  549 lines

  1. var gYaInstaller = {
  2.   __installed: true,
  3.   __lastEmActionRequestedName: "",
  4.   
  5.   get isBarUninstalled() {
  6.     return this.__installed == false;
  7.   },
  8.   
  9.   APP_ACTION_QUIT_TOPIC: "quit-application",
  10.   EM_ACTION_REQUESTED_TOPIC: "em-action-requested",
  11.   
  12.   LASTVERSION_PREF_NAME: "yasearch.general.lastVersion",
  13.   
  14.   NEW_ADDONS_LIST_PREF_NAME: "extensions.newAddons",
  15.   CHECK_GLOBAL_INSTALL_PREF_NAME: "yasearch.general.checkGlobalInstall",
  16.   CHECK_GLOBAL_INSTALL_POST_CHECK: 1,
  17.   CHECK_GLOBAL_INSTALL_CHECKED: 2,
  18.   
  19.   CHECK_TOOLBAR_COLLAPSED_PREF_NAME: "yasearch.general.checkToolbarCollapsed",
  20.   
  21.   init: function() {
  22.     this._checkGlobalPostInstall();
  23.     
  24.     OBSERVER_SERVICE.addObserver(this, "Ya-GUID-Response", false);
  25.     OBSERVER_SERVICE.addObserver(this, this.EM_ACTION_REQUESTED_TOPIC, false);
  26.     OBSERVER_SERVICE.addObserver(this, this.APP_ACTION_QUIT_TOPIC, false);
  27.     this.proccessInstall();
  28.   },
  29.   
  30.   uninit: function() {
  31.     OBSERVER_SERVICE.removeObserver(this, "Ya-GUID-Response");
  32.     OBSERVER_SERVICE.removeObserver(this, this.APP_ACTION_QUIT_TOPIC);
  33.     OBSERVER_SERVICE.removeObserver(this, this.EM_ACTION_REQUESTED_TOPIC);
  34.     
  35.     if (this.isBarUninstalled)
  36.       this.proccessUninstall();
  37.     else
  38.       this._checkGlobalInstall();
  39.   },
  40.   
  41.   observe: function(aSubject, aTopic, aData) {
  42.     switch (aTopic) {
  43.       case "Ya-GUID-Response":
  44.         if (aData === "SENDED")
  45.           this.sttInstall = true;
  46.         
  47.         break;
  48.         
  49.       case this.EM_ACTION_REQUESTED_TOPIC:
  50.         aSubject.QueryInterface(Ci.nsIUpdateItem);
  51.  
  52.         if (aSubject.id === EXT_ID) {
  53.           switch (aData) {
  54.             case "item-uninstalled":
  55.             case "item-upgraded":
  56.               gYaSearchService.setIntPref(this.CHECK_TOOLBAR_COLLAPSED_PREF_NAME, 1);
  57.               break;
  58.             
  59.             case "item-cancel-action":
  60.               if (this.__lastEmActionRequestedName && this.__lastEmActionRequestedName == aData)
  61.                 gYaSearchService.resetPref(this.CHECK_TOOLBAR_COLLAPSED_PREF_NAME);
  62.               break;
  63.           }
  64.           
  65.           this.__installed = !(aData == "item-uninstalled");
  66.           this.__lastEmActionRequestedName = aData;
  67.         }
  68.         
  69.         break;
  70.       
  71.       case this.APP_ACTION_QUIT_TOPIC:
  72.         this.uninit();
  73.         break;
  74.       
  75.       default:
  76.         break;
  77.     }
  78.   },
  79.   
  80.   _checkGlobalInstall: function() {
  81.     let yaSearchService = gYaSearchService;
  82.     
  83.     try {
  84.       let installCheckValue = yaSearchService.getIntPref(this.CHECK_GLOBAL_INSTALL_PREF_NAME);
  85.       yaSearchService.setIntPref(this.CHECK_GLOBAL_INSTALL_PREF_NAME, this.CHECK_GLOBAL_INSTALL_CHECKED);
  86.       
  87.       if (installCheckValue)
  88.         return;
  89.       
  90.       if (!(yaSearchService.AppBarType == "barff" && yaSearchService.getCharPref("app.distributor") == "yandex"))
  91.         return;
  92.       
  93.       let extManager = Cc["@mozilla.org/extensions/manager;1"].getService(Ci.nsIExtensionManager);
  94.       let barExtItem = extManager.getItemForID(EXT_ID);
  95.       
  96.       if (barExtItem.installLocationKey !== "app-global")
  97.         return;
  98.       
  99.       let barInstallDir = yaSearchService.getInstallDir();
  100.       
  101.       let profileDir = Cc["@mozilla.org/file/directory_service;1"]
  102.                          .getService(Ci.nsIProperties)
  103.                          .get("ProfD", Ci.nsIFile);
  104.       
  105.       if (profileDir.contains(barInstallDir.parent, false))
  106.         return;
  107.       
  108.       let currentProcDir = Cc["@mozilla.org/file/directory_service;1"]
  109.                              .getService(Ci.nsIProperties)
  110.                              .get("CurProcD", Ci.nsIFile);
  111.       
  112.       if (!currentProcDir.contains(barInstallDir.parent, false))
  113.         return;
  114.       
  115.       profileDir.append("extensions");
  116.       
  117.       let barInstallProfileDir = profileDir.clone();
  118.       barInstallProfileDir.append(EXT_ID);
  119.       
  120.       if (barInstallProfileDir.exists() && barInstallProfileDir.isDirectory())
  121.         return;
  122.       
  123.       try {
  124.         barInstallDir.copyTo(profileDir, "");
  125.         //barInstallDir.permissions = 0755;
  126.       } catch (ex) {
  127.         // rollback
  128.         barInstallProfileDir.remove(true);
  129.         return;
  130.       }
  131.       
  132.       yaSearchService.setIntPref(this.CHECK_GLOBAL_INSTALL_PREF_NAME, this.CHECK_GLOBAL_INSTALL_POST_CHECK);
  133.       
  134.     } catch (e) {
  135.       yaSearchService.log(e);
  136.     }
  137.   },
  138.   
  139.   _checkGlobalPostInstall: function() {
  140.     if (gYaSearchService.getIntPref(this.CHECK_GLOBAL_INSTALL_PREF_NAME) == this.CHECK_GLOBAL_INSTALL_POST_CHECK) {
  141.       if (gYaSearchService.getCharPref(this.NEW_ADDONS_LIST_PREF_NAME) === EXT_ID)
  142.         gYaSearchService.resetPref(this.NEW_ADDONS_LIST_PREF_NAME);
  143.     }
  144.   },
  145.   
  146.   proccessInstall: function() {
  147.     var currentVersion = gYaSearchService.barExtensionMajorVersion;
  148.     var lastVersion = gYaSearchService.getCharPref(this.LASTVERSION_PREF_NAME);
  149.     
  150.     this._checkToolbarCollapsed(lastVersion, currentVersion);
  151.     
  152.     if (lastVersion == currentVersion)
  153.       return;
  154.     
  155.     gYaSearchService.setCharPref(this.LASTVERSION_PREF_NAME, currentVersion);
  156.     
  157.     //merge clids from vendor.xml
  158.     if ("vendorDataMergeClids" in gYaSearchService)
  159.       gYaSearchService.vendorDataMergeClids();
  160.     
  161.     if (lastVersion == "0") {
  162.       gYaSearchService.timeGuid = null;
  163.       gYaSearchService.checkNeedSendGuid();
  164.       
  165.       this._changePreferencesOnInstall();
  166.       
  167.       if (!gYaSearchService.checkKeywordURL)
  168.         gYaSearchService.checkKeywordURL = "check";
  169.       
  170.     } else {
  171.       this._migratePreferencesOnInstall(lastVersion);
  172.     }
  173.     
  174.     var versionComparator = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
  175.     if (versionComparator.compare(currentVersion, lastVersion) == 1) {//currentVersion > lastVersion
  176.       gYaSearchService.showLocalWelcomePage = true;
  177.       
  178.       var welcomepageVersion = gYaSearchService.getCharPref("yasearch.welcomepage.version");
  179.       var welcomepageVersionIntroduced = gYaSearchService.getCharPref("yasearch.welcomepage.version.introduced");
  180.       if (welcomepageVersionIntroduced == "0" && lastVersion == "4.0.0")//wrkrnd for 4.0.0
  181.         welcomepageVersionIntroduced = "4.0.0";
  182.       
  183.       if (gYaSearchService.getBoolPref("yasearch.welcomepage.dontshow")) {// preferences
  184.         //reset default_pref or delete user_pref
  185.         gYaSearchService.resetPref("yasearch.welcomepage.dontshow");
  186.         gYaSearchService.showLocalWelcomePage = false;
  187.       }
  188.       
  189.       // HKCU || HKLM
  190.       var regKeyPath = "Software\\Yandex\\Toolbar",
  191.           regKeyParam = "VersionIntroducedFx";
  192.       
  193.       var versionFromWinReg = gYaSearchService.WinReg.read("HKCU", regKeyPath, regKeyParam) || 
  194.                               gYaSearchService.WinReg.read("HKLM", regKeyPath, regKeyParam);
  195.       
  196.       //welcomepageVersionIntroduced < versionFromWinReg
  197.       if (versionFromWinReg && versionComparator.compare(welcomepageVersionIntroduced, versionFromWinReg) == -1)
  198.         welcomepageVersionIntroduced = versionFromWinReg;
  199.       
  200.       //welcomepageVersion <= welcomepageVersionIntroduced
  201.       if (welcomepageVersionIntroduced && versionComparator.compare(welcomepageVersion, welcomepageVersionIntroduced) < 1) {
  202.         gYaSearchService.showLocalWelcomePage = false;
  203.       } else {
  204.         welcomepageVersionIntroduced = welcomepageVersion;
  205.       }
  206.       
  207.       gYaSearchService.setCharPref("yasearch.welcomepage.version.introduced", welcomepageVersionIntroduced);
  208.     }
  209.     
  210.     if (lastVersion == "0") {
  211.       try {
  212.         this._addStartMenuLinks();
  213.       } catch(e) {}
  214.     }
  215.   },
  216.   
  217.   _checkToolbarCollapsed: function(aLastVersion, aCurrentVersion) {
  218.     let checkToolbarCollapsed = gYaSearchService.getIntPref(this.CHECK_TOOLBAR_COLLAPSED_PREF_NAME);
  219.     if (checkToolbarCollapsed) {
  220.       gYaSearchService.resetPref(this.CHECK_TOOLBAR_COLLAPSED_PREF_NAME);
  221.       
  222.       if (checkToolbarCollapsed == 1 && typeof(gYaOverlay) === "object" && "setToolbarCollapsedState" in gYaOverlay) {
  223.         if (aLastVersion == "0" || aLastVersion === aCurrentVersion) {
  224.           gYaOverlay.setToolbarCollapsedState(false);
  225.         }
  226.       }
  227.     }
  228.   },
  229.   
  230.   _changePreferencesOnInstall: function() {
  231.     var exportCheckedName = "yasearch.general.ui.bookmarks.prefs.yaruExportChecked";
  232.     if (!gYaSearchService.prefBranch.prefHasUserValue(exportCheckedName)) {
  233.       gYaSearchService.setBoolPref(exportCheckedName, true);
  234.     }
  235.     
  236.     this._checkFTabData();
  237.   },
  238.   
  239.   _migratePreferencesOnInstall: function(aLastVersion) {
  240.     var versionComparator = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
  241.     if (versionComparator.compare(aLastVersion, "4.2.2") < 1) {//aLastVersion <= 4.2.2
  242.       this.sttInstall = true;
  243.     }
  244.     
  245.     if (aLastVersion == "3.5.3") {
  246.       let oldPublicBookmarksPrefName = "yasearch.general.ui.bookmarks.prefs.yaruPublicValue",
  247.           newPublicBookmarksPrefName = "yasearch.general.ui.bookmarks.prefs.yaruPublicVal";
  248.       
  249.       let oldPublicBookmarksPrefValue = gYaSearchService.getIntPref(oldPublicBookmarksPrefName) || 10;
  250.       
  251.       if (oldPublicBookmarksPrefValue) {
  252.         gYaSearchService.setIntPref(newPublicBookmarksPrefName, oldPublicBookmarksPrefValue);
  253.       }
  254.       
  255.     } else if (aLastVersion == "4.0.0") {
  256.       let hpDefencePrefName = "yasearch.defence.homepage.changes";
  257.       let hpDefencePrefValues = (gYaSearchService.getCharPref(hpDefencePrefName) || "").split("|");
  258.       
  259.       if (hpDefencePrefValues.length == 3) {
  260.         hpDefencePrefValues.push("0");
  261.         gYaSearchService.setCharPref(hpDefencePrefName, hpDefencePrefValues.join("|"));
  262.       }
  263.       
  264.     }
  265.     
  266.     let oldBookmarksPrefName = "yasearch.general.ui.boomarks.open";
  267.     if (gYaSearchService.getBoolPref(oldBookmarksPrefName)) {
  268.       gYaSearchService.setIntPref("yasearch.general.ui.bookmarks.action", 0);
  269.     }
  270.     
  271.     this._checkFTabData();
  272.   },
  273.   
  274.   _checkFTabData: function() {
  275.     //ftab default data
  276.     try {
  277.       let yandexDir = gYaSearchService.getYandexDir();
  278.       if (!yandexDir)
  279.         return;
  280.       
  281.       let ftabFileName = "ftab.data.xml";
  282.       let ftabFile = yandexDir.clone();
  283.       ftabFile.append(ftabFileName);
  284.       
  285.       if (ftabFile.exists() && ftabFile.isFile())
  286.         return;
  287.       
  288.       let ftabDefaultFile = gYaSearchService.getContentDir();
  289.       ftabDefaultFile.append("ftab");
  290.       ftabDefaultFile.append("def." + ftabFileName);
  291.       
  292.       if (!(ftabDefaultFile.exists() && ftabDefaultFile.isFile()))
  293.         return;
  294.       
  295.       let ftabContent = gYaSearchService.readFile(ftabDefaultFile);
  296.       if (!ftabContent)
  297.         return;
  298.       
  299.       let clid = gYaSearchService.vendorData.clid7;
  300.       let yandexLink = "http://www.yandex." + gYaSearchService.localeTld + "/" + (clid ? "?clid=" + clid : "");
  301.       let mailLink = "http://mail.yandex." + gYaSearchService.localeTld + "/";
  302.       
  303.       ftabContent = ftabContent.replace(/%yandex%/g, yandexLink)
  304.                                .replace(/%mail%/g, mailLink);
  305.       
  306.       let ftabDoc = gYaSearchService.domParser.parseFromString(ftabContent, "text/xml");
  307.       let ftabXML = gYaSearchService.safeE4Xml(ftabDoc, null, "data");
  308.       if (ftabXML)
  309.         gYaSearchService.writeFile(ftabFile, ftabXML.toXMLString());
  310.       
  311.     } catch(e) {}
  312.   },
  313.   
  314.   //2do: library
  315.   _write1251File: function(aFile, aData) {
  316.     var uConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
  317.                           .createInstance(Ci.nsIScriptableUnicodeConverter);
  318.     uConverter.charset = "windows-1251";
  319.     var chunk = uConverter.ConvertFromUnicode(aData);
  320.     
  321.     var os = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
  322.     os.init(aFile, 0x02 | 0x08 | 0x20, 0755, 0);
  323.     var result = os.write(chunk, chunk.length);
  324.     os.close();
  325.   },
  326.   
  327.   _addStartMenuLinks: function() {
  328.     if (!gYaSearchService.windowsOS || gYaSearchService.AppBarType === "barffport")
  329.       return;
  330.     
  331.     this._removeStartMenuLinks();
  332.     
  333.     var iconFile = gYaSearchService.getChromeDir();
  334.     iconFile.append("skin");
  335.     iconFile.append("classic");
  336.     iconFile.append("images");
  337.     iconFile.append("bar-logo.ico");
  338.     
  339.     var iconFilePath = iconFile.path;
  340.     
  341.     var progsBarDir = this._getProgsBarDir();
  342.     if (!progsBarDir)
  343.       return;
  344.     
  345.     //get 'chrome://yasearch/locale/first-start/welcome.html' path
  346.     var welcomeLocalFilePath = function __welcomeLocalFilePath() {
  347.       try {
  348.         var reg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
  349.         var ioSvc = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
  350.         var chromeURL = ioSvc.newURI("chrome://yasearch/locale/first-start/welcome.html", null, null);
  351.         var fileURL = reg.convertChromeURL(chromeURL);
  352.         return decodeURIComponent(fileURL.path).replace(/\//g, '\\').replace(/\\/,'');
  353.       } catch(e) {}
  354.       
  355.       return gYaSearchService.getString("windowsStartMenuUrlWelcomePage");
  356.     }();
  357.     
  358.     ["OnlineHelp", "WelcomePage"].forEach(function(aLinkType) {
  359.       var shortcutURL = aLinkType == "WelcomePage" ? welcomeLocalFilePath :
  360.                                                      gYaSearchService.getString("windowsStartMenuUrl" + aLinkType);
  361.       
  362.       var linkFile = progsBarDir.clone();
  363.       linkFile.append(gYaSearchService.getString("windowsStartMenuName" + aLinkType) + ".url");
  364.       
  365.       if (!linkFile.exists() || !linkFile.isFile()) {
  366.         try {
  367.           linkFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0755);
  368.           
  369.           if (linkFile.exists() && linkFile.isFile()) {
  370.             var fileContent = "[InternetShortcut]" +
  371.                               "\r\nURL=" + shortcutURL +
  372.                               "\r\nIconFile=" + iconFilePath +
  373.                               "\r\nIconIndex=0" +
  374.                               "\r\n";
  375.             
  376.             this._write1251File(linkFile, fileContent);
  377.           }
  378.         } catch(e) {}
  379.       }
  380.     }, this);
  381.   },
  382.   
  383.   _removeStartMenuLinks: function() {
  384.     if (!gYaSearchService.windowsOS)
  385.       return;
  386.     
  387.     var progsBarDir = this._getProgsBarDir();
  388.     if (!progsBarDir)
  389.       return;
  390.     
  391.     ["OnlineHelp", "WelcomePage"].forEach(function(aLinkType) {
  392.       var linkFile = progsBarDir.clone();
  393.       linkFile.append(gYaSearchService.getString("windowsStartMenuName" + aLinkType) + ".url");
  394.       
  395.       if (linkFile.exists() && linkFile.isFile()) {
  396.         try { linkFile.remove(true); } catch(e) {}
  397.       }
  398.     }, this)
  399.     
  400.     if (!progsBarDir.directoryEntries.hasMoreElements()) {
  401.       var parentDir = progsBarDir.parent;
  402.       try {
  403.         progsBarDir.remove(true);
  404.         if (!parentDir.directoryEntries.hasMoreElements()) {
  405.           parentDir.remove(true);
  406.         }
  407.       } catch(e) {}
  408.     }
  409.     
  410.     //check "AllUsers" dir
  411.     try {
  412.       var cmPrgs = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("CmPrgs", Ci.nsIFile);
  413.       if (cmPrgs && cmPrgs.exists() && cmPrgs.isDirectory()) {
  414.         cmPrgs.append(this._YandexName);
  415.         if (cmPrgs.exists() && cmPrgs.isDirectory() && !cmPrgs.directoryEntries.hasMoreElements()) {
  416.           cmPrgs.remove(true);
  417.         }
  418.       }
  419.     } catch(e) {}
  420.   },
  421.   
  422.   _getProgsBarDir: function() {
  423.     try {
  424.       var programsDir = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("Progs", Ci.nsIFile);
  425.       
  426.       if (programsDir && programsDir.exists() && programsDir.isDirectory()) {
  427.         programsDir.append(this._YandexName);
  428.         
  429.         if (!programsDir.exists() || !programsDir.isDirectory()) {
  430.           try {
  431.             programsDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
  432.           } catch(e) {}
  433.         }
  434.         
  435.         if (programsDir.exists() && programsDir.isDirectory()) {
  436.           var barFolder = programsDir.clone();
  437.           barFolder.append(this._YandexBarName);
  438.           
  439.           if (!barFolder.exists() || !barFolder.isDirectory()) {
  440.             try {
  441.               barFolder.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
  442.             } catch(e) {}
  443.           }
  444.           
  445.           if (barFolder.exists() && barFolder.isDirectory())
  446.             return barFolder;
  447.         }
  448.       }
  449.     } catch(e){}
  450.     
  451.     return null;
  452.   },
  453.   
  454.   get _YandexName() {
  455.     return UConverter.ConvertToUnicode("╨»╨╜╨┤╨╡╨║╤ü");
  456.   },
  457.   
  458.   get _YandexBarName() {
  459.     return UConverter.ConvertToUnicode("╨»╨╜╨┤╨╡╨║╤ü.╨æ╨░╤Ç");
  460.   },
  461.   
  462.   STT_PREF_NAME: "yasearch.general.stt",
  463.   
  464.   get sttInstall() {
  465.     let stt = gYaSearchService.getCharPref(this.STT_PREF_NAME);
  466.     return stt !== '{"s":{"i":4}}';
  467.   },
  468.   
  469.   set sttInstall() {
  470.     gYaSearchService.setCharPref(this.STT_PREF_NAME, '{"s":{"i":4}}');
  471.   },
  472.   
  473.   proccessUninstall: function() {
  474.     gYaSearchService.resetPref(this.LASTVERSION_PREF_NAME);
  475.     gYaSearchService.resetPref("yasearch.license.accepted");
  476.     gYaSearchService.resetPref("yasearch.welcomepage.version.introduced");
  477.     gYaSearchService.resetPref(this.STT_PREF_NAME);
  478.     
  479.     let vendorFileName = gYaSearchService.vendorFileName;
  480.     gYaSearchService.resetPref("yasearch.general.app.bar.type");
  481.     
  482.     if (typeof(gYaStorage) === "object" && "shutdown" in gYaStorage)
  483.       gYaStorage.shutdown();//free "yasearch-storage.sqlite"
  484.     
  485.     gYaSearchService.passwordManager.removeAllUsersData();
  486.     
  487.     var yandexDir = gYaSearchService.getYandexDir();
  488.     if (yandexDir) {
  489.       ["cities.data.xml", "regions.data.xml", "services.mybar.xml", "maps.data.xml",
  490.        "services.data.xml", "ftab.data.xml", "yasearch-storage.sqlite"]
  491.       .forEach(function(aFileName) {
  492.         var fileToRemove = yandexDir.clone();
  493.         fileToRemove.append(aFileName);
  494.         if (fileToRemove.exists() && fileToRemove.isFile()) {
  495.           try {
  496.             fileToRemove.remove(true);
  497.           } catch(e) {}
  498.         }
  499.       }, this);
  500.       
  501.       if (!yandexDir.directoryEntries.hasMoreElements()) {
  502.         try {
  503.           yandexDir.remove(true);
  504.         } catch(e) {}
  505.       }
  506.     }
  507.     
  508.     var yaAppDir = gYaSearchService.getYaAppDir();
  509.     if (yaAppDir) {
  510.       ["r1-barff", vendorFileName]
  511.       .forEach(function(aFileName) {
  512.         if (aFileName) {
  513.           var fileToRemove = yaAppDir.clone();
  514.           fileToRemove.append(aFileName);
  515.           if (fileToRemove.exists() && fileToRemove.isFile()) {
  516.             try {
  517.               fileToRemove.remove(true);
  518.             } catch(e) {}
  519.           }
  520.         }
  521.       }, this);
  522.     }
  523.     
  524.     this._removeStartMenuLinks();
  525.     
  526.     this._sendUninstallRequest();
  527.   },
  528.   
  529.   _sendUninstallRequest: function() {
  530.     let url = gYaSearchService.generateGUIDStatusURL;
  531.     if (!url)
  532.       return;
  533.     
  534.     let versionData = gYaSearchService.versionData;
  535.     let data2Server = [];
  536.     
  537.     for each (var prop in ["yasoft", "ui", "ver", "os", "clid"])
  538.       if (versionData[prop])
  539.         data2Server.push(prop + "=" + encodeURIComponent(versionData[prop]));
  540.     
  541.     data2Server.push("stat=uninstall");
  542.     
  543.     url += data2Server.join("&");
  544.     
  545.     let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
  546.     req.open("GET", url, false);//synchronous
  547.     req.send(null);
  548.   }
  549. }