• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

transition from my firefox extension to a Flash Builder desktop app

New Here ,
May 11, 2011 May 11, 2011

Copy link to clipboard

Copied

Trying to make a slow transistion from my firefox extension to a Flash Builder desktop app.

Okay i'm not familiar on how to go about this I have js code that lets my app sync it self with the lates build it looks for a new version number which is in a txt file. Inside the txt file I have 0.0.0 so evertime I change the version number to 0.0.1. The app checks for new updates and sees the txt file has a new version number and start to pull in the zip file and extrudes the zip into the directory.

I can't get my head around on how to modify this code ["@mozilla.org/extensions/manager;1"].getService
to look in the root directory of my Flash Builder app.

function Xcalibur_Sync(){
    document.documentElement.getButton("accept").disabled = true;
    var Cc = Components.classes;
    var Ci = Components.interfaces;
    var url = xcaliburGetUnicharPref("extensions.xcalibur.downloadurl");
    var Step1 = document.getElementById("xcalStep1");
    var Step1done = document.getElementById("xcalStep1Done");
    var Step2 = document.getElementById("xcalStep2");
    var Step2done = document.getElementById("xcalStep2Done");
    var Step3 = document.getElementById("xcalStep3");
    var Step3done = document.getElementById("xcalStep3Done");
    var Step4 = document.getElementById("xcalStep4");
    var Step4done = document.getElementById("xcalStep4Done");
    var xcalSyncDone = document.getElementById("xcalSyncDone");

    var progressMeter = document.getElementById("xcalProgressMeter");
    var progressPct = document.getElementById("xcalProgressPct");
   
  // Get Xcalibur version and location
    var GUID = "xcalibur@ish.com"
    var gExtensionManager = Cc["@mozilla.org/extensions/manager;1"].getService(Ci.nsIExtensionManager);
  //var currentVersion = gExtensionManager.getItemForID(GUID).version;
    var currentVersion = xcaliburPrefs.getCharPref("extensions.xcalibur.installedversion");
    var xcaliburdir = gExtensionManager.getInstallLocation(GUID).getItemLocation(GUID);
    var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
    file.initWithPath(xcaliburdir.path);
   
    //Step 1 - See if an update is available
    Step1.setAttribute("hidden", "false");
    var req = new XMLHttpRequest();
    req.open('GET', url+"CRV.txt", false);
    try{
        req.send(null);
    }catch(e){
        alert("Cannot get update information from "+url+"CRV.txt\n"+e.toString()+"\n\nSync aborted ...");
        window.close();
        return false;
    }//try
    if(req.status == 200){
        var CRV = req.responseText;

Any Ideas?

Thanks,

Ish

Views

426

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 17, 2011 May 17, 2011

Copy link to clipboard

Copied

Have you taken a look at the documentation on updating AIR applications?

http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff2.html

Or is it something else you wish to do? You can access the directory where your app is installed by looking at File.applicationDirectory and you can hit a URL by using URLRequest.

-Anirudh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2011 May 31, 2011

Copy link to clipboard

Copied

LATEST

Thanks for pointing me to the right directions Anirudh. I will begin developement.

Thanks a million !

-Ish

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines