Adobe AIR to execute program

后端 未结 10 2165
陌清茗
陌清茗 2020-12-01 00:28

I would like to press a button from an Adobe AIR application and execute some installed program. For example, I would have a button named \"Start Winamp\". When this is pres

10条回答
  •  隐瞒了意图╮
    2020-12-01 00:55

    The answer comes in two parts. One, if you really MUST run a .exe file, the only way to go is to use a command proxy. Personally, using one in .Net/Mono is a bit overblown. I don't know Mono, but asking your users to install .Net and AIR would scare just about all of them away. Plus, if I was going to ask users to install Mono, why not just write the UI in Mono and be done with it...?

    You could write a simple command proxy in Ruby which really would be cross-platform and low hassle in about 5 minutes (I just did it, if you want the code comment me here and I'll post it). If you want control of the process after it's launched, it's a more serious endeavor. For distribution, etc., I believe that Ruby would be easier.

    On the other hand, check this idea out. Jeff suggests using a URL request from AIR. Basically, if your browser would interpret it correctly, you're ready to go. The code looks like this

    var request : URLRequest = new URLRequest('C:\\playlists\\test.m3u');
    

    I think that, with a bit of creativity (with Mime types, particularly), this second solution might even work for Winamp (e.g.., a playlist or something).

    Good luck and thank you for the question, which is probably a dupe but Google only found this one so you've won :)

提交回复
热议问题