PDA

View Full Version : [AS3] fscommand projector issues


rgpottinger
06-08-2010, 03:03 PM
I am trying to do a simple menu to give people the option of a few different programs to install from a CD, so I have created an autorun bat that runs a flash menu (projector exe) and then use buttons in it to choose the programs to install.

Problem is only one seems to work so can anyone see what I am doing wrong?
//
pressit_btn.addEventListener(MouseEvent.CLICK, pressitClick);
function pressitClick(event:MouseEvent):void {
fscommand("exec", "expressit_setup.msi");
// fscommand("quit");
}
inkrite_btn.addEventListener(MouseEvent.CLICK, inkriteClick);
function inkriteClick(event:MouseEvent):void {
fscommand("exec", "inkrite_photobook_installation.exe");
// fscommand("quit");
}
irfan_btn.addEventListener(MouseEvent.CLICK, irfanClick);
function irfanClick(event:MouseEvent):void {
fscommand("exec", "iview427_setup.exe");
// fscommand("quit");
}

Flash really isn't my thing so forgive the incompetence :)

northcode
06-08-2010, 06:14 PM
The EXE files have to be in a folder called fscommand that is in the same folder as your EXE file, otherwise Flash won't let you launch them.

rgpottinger
06-09-2010, 10:21 AM
Unfortunately they are in that fscommand folder, that is the bit that is confusing me. One program will load when I click the button, but the other 2 don't.

northcode
06-09-2010, 01:35 PM
You can't use EXEC with an MSI file (you'll have to use a BAT file to launch that one) but the EXE files should be fine. The only thing that I can think of is that the EXE files need to know the current directory they are started from and that isn't being set properly for some reason.

If you want to see if the EXE files are being launched (but just failing to start) you can try this little app I wrote whoami.exe (www.northcode.com/misc/whoami.exe). All it does is display its own name and where it was started from. Just create a couple of copies of whoami.exe and rename them to match your EXE files and replace them in the fscommand folder. That should give us a little more information.

rgpottinger
06-10-2010, 07:53 AM
thanks, I will have a look into it :)

northcode
06-10-2010, 02:11 PM
There is also this bug http://www.northcode.com/blog.php/2007/08/14/FSCommand-EXEC-is-Broken-in-Flash-CS3 to consider. If the EXE file you're trying to launch doesn't know how to handle a UNC path then it won't work properly.