Skip to main content
Known Participant
April 2, 2014
Answered

launching an exe from a swf

  • April 2, 2014
  • 1 reply
  • 4307 views

It has been a long time since I played with anything in FLASH so there may not be a solution.

We have some exe files with training content that we want to host on our database.  We would like to have them play from a swf that opens a completion button on a new slide when the exe file finishes playing.  We usually use Captivate but I'm not having any luck having Captivate launch the exe files so I thought I'd see what you all might come up with.

Thank you,

Susan

This topic has been closed for replies.
Correct answer sinious

We have a Cold Fusion database that we normally host and track completions for courses built in Captivate (SWF). We have some external courses that are .exe type that the powers that be want hosted on our database. I was hoping to make a Captivate project that would call the .exe course then after the exe was done playing it would then open a survey for the student to complete and get credit for the training.

So far I’ve had no luck with that then I thought maybe there would be a Flash solution but I haven’t played in Flash forever. Then I think you mentioned using Adobe Air but I’m not familiar with Air.

I have no idea why the originators decided to put this in an exe format.

Thanks for your time.

Susan


That makes more sense.

Unfortunately something as simple as setting the end action to open an URL or file will do nothing more than what Flash would do with navigateToURL(). If you specify the .exe of the course to run it will attempt to load that .exe in a browser which will probably just ask you to save the .exe (like Chrome does). To my limited knowledge of Captivate, there's no simple built in interaction capable of launching an .exe, especially not from a SWF as it's still limited to the SWFs capabilities. Launching executables is not a capability of a SWF, regardless if Flash or Captivate made it. And you couldn't watch the EXE's process from a SWF to know when it ends regardless.

Are the executables you need to run simply other Captivate projectors or Flash projectors and if so do you have access to the source files for them? If you can simply get those to publish into SWF then you won't need to launch an executable at all. That is the ideal route.

If not then I think you're up a creek without a paddle without invoking an advanced solution. This goes against what seems like your desire however, which is not to use executables, but only an executable with the permission to run a process is able to start one of those .exes.

For example you could publish your course to SWF from Captivate. You could import that SWF into a Flash project and then leverage the capabilities of Flash/AIR. You would need to find a way to detect the end of the course in Flash from Captivate by getting it to emit something Flash/AIR could detect (perhaps it's the last frame of the SWF or something else easy, or you might need an advanced action). Once you alert Flash/AIR that the quiz has completed, AIR would have the ability to launch an executable.

Outside this I don't see what you want as being possible with Flash. Executables are OS-level security and SWF simply isn't capable.

1 reply

sinious
Legend
April 2, 2014

If you use Adobe AIR you can launch an .exe but Flash's strict sandbox will prevent any SWF or projector from running an executable. It would be a huge security concern if executables could be invoked by SWF content. 

For AIR to launch it, consult NativeProcess:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcess.html

Known Participant
April 2, 2014

I haven’t used Adobe Air yet. Thanks though for responding.

sinious
Legend
April 2, 2014

Please outline the flow you forsee, including the application and technology. For example:

For example:

"I have a Microsoft PowerPoint presentation with many slides. When I get to slide 5 I want to embed a Flash SWF. The SWF will contain a button that I would like to launch an executable program from..." etc

How you're wording it now doesn't make sense.

"We have some exe files with training content that we want to host on our database. We would like to have them play from a swf"

Does this mean you are extracting content from whatever these "exe"s are, plan to put the content in a database and retrieve that content from a SWF to display instead?

that opens a completion button on a new slide when the exe file finishes playing

I assume this means the SWF should present a button when the content is finished playing however I don't know where "slide" came from. What is hosting this? Microsoft PowerPoint?

If these assumptions are correct then what I said applies about Flash. A SWF itself cannot run an executable file, let alone ever do something like detect "when the exe file finishes playing". Flash is highly restricted so it is secure.

You can think of AIR as "Flash with more features" without getting into the nuances. It's similar to a SWF or Projector but with more features and functionality. It's exported from Flash Pro the same way anything else is. You simply change the output target from Flash Player to AIR For [Platform] (Windows, Mac, etc).

This does not generate a SWF however so if you plan on embedding it into something with slides (like Microsoft PowerPoint), this will not work.