2010-06-29 60 views
2

我已經構建了一個使用nativeProcess打開exe的應用程序。AIR 2.0 NativeProcess不受支持問題

進入Flex Builder 3的應用程序運行whitout錯誤。

然後,當我在.air中導出aplicaction AIR並將applicationaction安裝在開發人員pc或其他pc中時,問題就出現了。

當我按下按鈕打開.exe時,出現消息「本機進程不受支持」。

在我使用main.mxml代碼:

if (NativeProcess.isSupported) 
      { 
       var file:File = new File("app:/config/AbrirAplicacion.exe"); 
       var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo(); 
       nativeProcessStartupInfo.executable = file; 

       process = new NativeProcess(); 
       process.start(nativeProcessStartupInfo); 
       process.standardInput.writeUTFBytes(textReceived.text+"\n"); 
       process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData); 
       process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener); 
      } 
      else 
      { 
       textReceived.text = "NativeProcess not supported."; 
      } 

什麼我做錯了任何想法?

回答

3

NativeProcess僅在應用程序編譯爲本機二進制文件而非.air安裝程序時可用。

0

NativeProcess可以使用Air2進行編譯,這只是非常棘手。問題是你必須COMPLETLEY覆蓋你的Flex SDK和新的Air2。令人驚訝的是,根據this link,你不能通過發現者來完成,而應該通過終端來完成。在Mac:

  1. 下載從Air SDK的SDK,並把它在文件夾1.
  2. 讓您的Flex SDK的副本,並把它放在文件夾2(在Flex Builder中的SDK文件夾)
  3. ditto -V folder1 folder2在終端覆蓋它們。

現在轉到您的項目的首選項並選擇folder2作爲sdk(現在它與folder1疊加)。

此外,您可能需要說明更改爲:

http://ns.adobe.com/air/application/2.0 

上有Installing the Adobe AIR 2 SDK in Eclipse很好的說明(檢查部分3)。

希望有所幫助。

1

您必須設置supportedProfiles標籤爲「extendedDesktop」,以便與機進程的工作。

認沽/取消註釋這條線之下在app.xml中:

<supportedProfiles>extendedDesktop</supportedProfiles> 
0

解決了

出口與當地簽訂了不風象星座