Skip navigation
Currently Being Moderated

Is there a way to include a native executable into extension package?

Feb 6, 2012 12:12 PM

Tags: #nativeprocess #extension

Hello,

 

I need to call some native code from the CS extension using the NativeProcess API.

Is there any way to distribute a native executable file inside the extension package?

 

It looks like there is a way to include an "ordinary" file into a hybrid extension, however the file has to be installed into one of pre-defined locations (such as "$applicationsupport").

 

The problem is that in order to create a NativeProcess object in the extension code, I need to know the exact path of the executable, and I can't seem to find a way to find out where exactly the executable was placed by the extension installer.

 

Is there a way to install an executable into the extension folder (which I can get using CSXSInterface.getInstance().getSystemPath(APPLICATION))?

 

Thank you,

Anatoly

 
Replies
  • Currently Being Moderated
    Mar 1, 2012 2:05 PM   in reply to Anatoly Paraev

    Is there a way to install an executable into the extension folder (which I can get using CSXSInterface.getInstance().getSystemPath(APPLICATION))?

     

    Yep, the answer depends on how you're packaging your extension.

     

    If you're using Extension Builder, you just need the executable to be automatically copied to the bin-debug folder during the build process. The simplest way to achieve this is to put the executable underneath the src/ folder. Another option is to make your own resources/ directory and add it to the project source path (see the section "Adding resource folders to the project source path" here: http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS6f97d7caa66ef 6eb1e63e3d11b6c4ce749-7fd8.html). Once you've got it copying to the bin-debug folder you're set, you can launch or export as usual and your executable will end up in the extension folder.

     

    If you're using ucf.jar, just make sure that your executable is in the extension folder you're packaging.

     

    You shouldn't need to create a hybrid extension in order to have a CS extension that uses NativeProcess.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points