I was going to make an AIR application but I need to execute an external application and because of the security restrictions in Adobe AIR... I was thinking why not try and bypass it by writing some C code that does something like System("file to execute"); and then use Alchemy to change it into a swc and us that in my application... Anyone tried this sort, or think it could work?
What you need to understand about Alchemy is that it compiles C into the same bytecode as actionscript, and it runs under the same virtual machine (AVM2) as flash/flex as3 applications.
The reason Alchemy is able to be faster for some operations is that the compiled C (compiled to bytecode) is given access to raw "memory" (ApplicationDomain.domainMemory) via some optimised AVM2 instructions that were added in flash 10.
What I'm trying to get at is that because Alchemy simply runs on top of the AVM2, it is restricted in the same way as any other application. Alchemy in an AIR application can do more than Alchemy in the browser sandbox, but it is still restricted by that sandbox.
If you really need to execute an external application, you'll need to look into something like Shu or Zinc.
Sorry I couldn't be any more help.
This will not work - Alchemy is not really / really not suited for programs that interact with the outside world. I don't think it will support doing a system call, and even if Alchemy would support it the flash/air runtime will most certainly still block it.
If you don't need cross platform behavior you can look into creating an oldfashioned 'projector'. It is possible to launch programs from a projector exe using fscommand- just be aware the executable you want to launch has to be located in a folder named fscommand next to the binary. If that is not sufficient you could try a third party commercial tool like http://www.northcode.com/.
No, Richard Szalay's correct: Alchemy compiles C code into ActionScript bytecode, so the resulting SWF is still subject to the same sandbox restrictions as any other; the AIR restrictions may be looser, but using Alchemy provides no benefit in that respect.
However, you can still "call out" of the sandbox using a socket connection, provided you have an app listening for the connection; check out Merapi -- it might be able to help as a simple solution, if you were open to using Java, although you could certainly roll your own with something else, like C#.