memomemo

asしかやった事ない私がつまずいたとこメモです。なんか間違ってたらコメントください。

AIR から.shを実行

やーー asもまだまだやった事ないものあるなーー
今回色々はまったので めもめも。

function init()
{
	var file:File = File.applicationDirectory.resolvePath("hoge.sh");
	var processArgs:Vector.<String> = new Vector.<String>; 

	processArgs.push('chmod -x "'+file2.nativePath+'"');
			
	var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
	nativeProcessStartupInfo.arguments = processArgs;
	nativeProcessStartupInfo.executable = file2;
	nativeProcessStartupInfo.workingDirectory = File.userDirectory;
					
	_process = new NativeProcess();
	_process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA,onError);
	_process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, outputHandler);
	_process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, progressHandler);
	_process.start(nativeProcessStartupInfo); 
}

それぞれのハンドラー書いてあげる

そしてエラー
Error: Error #3219: The NativeProcess could not be started. 'Not supported in current profile.'

これは app.xml に

<supportedProfiles>extendedDesktop desktop</supportedProfiles>

追加しろと

で、この.shを一緒にパッケージ化したいのにされなかった。。
(´;ω;`)ブワ

原因はプロパティのこやつ!!
f:id:knuckle32:20140912182524j:plain
非埋め込みファイルを出力フォルダーにコピー
したら、でたーーーーーーーーーー!!!
f:id:knuckle32:20140912182530j:plain


flash builderからだと実行されるのに、AIRコンパイルしたら実行されないとううううううううぅぅぅううぅ


logの出し方もわからず、
やってもらったのでそれもブログにまとめましたがー

AIRのlogみる - memomemo


で結局
Error: Error #3219: The NativeProcess could not be started. 'Not supported in current profile.'
って前と同じエラーがでてましてーー
なんでだー とぐぐりましたら

書き出しが 
証明済みAIRパッケージ ではなく×
証明済みネイティブインストラー にすればいいと○

こやつです↓
f:id:knuckle32:20140912185505j:plain


ε=( ̄。 ̄;)フゥ