A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: fscommand "exec" not opening .app

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    5

    fscommand "exec" not opening .app

    Hi guys,

    Hoping you can help, as I have searched via google and have not found any definitive answers!

    I am creating an intro page where users are able to click on a button and it launches either a .exe file or .app file. Ideally these will be in a sub-folder 'fscommand'.

    I have successfully launched the .exe file (via a .bat file in the fscommand folder) and I am not having any luck at all launching the .app!!

    I am using Flash CS5 and the code as following:

    on (release) {
    fscommand ("exec", "launcher.app")
    }

    I've checked and there is no syntax error, especially since I just used the same code for the exe example - as mentioned before, this works beautifully for the .exe file, but I cannot for the life of me get the .app file launching... HELP PLEASE!!!

    Thank you in advance!

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    .app is a mac file extension or Microsoft Visual FoxPro

  3. #3
    Registered User
    Join Date
    Jun 2012
    Posts
    5
    Hi fruitbeard, thank you for that

    What I am trying to do is to actually be able to launch a .app file via the fscommand. My script works perfectly for a .exe file but I also need the launch the .app version (for Mac) of the same file.

    Hoping you can help?

    Thank you in advance!

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    What you can try is this

    make a textfield and call it operate

    on your timeline place this

    Actionscript Code:
    operate.text = System.capabilities.os;

    on your button use
    Actionscript Code:
    on (release) {
        if (operate.text.indexOf("Win") >= 0)
        {
            fscommand("exec", "launcher.exe");
        }
        else
        {
            fscommand("exec", "launcher.app");
        }
    }

    this will only work using the swf as exe files do not run on macs, unless mac users do a virtual pc.let me know

  5. #5
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    fruitbeard, he can export the swf to a MAC Projector instead a windows executable. Mac projector extension is .app

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    As far as I am aware a projector file is not being created, just the swf, so that code will give him what he needs.

    Flash does of course create the hqx file, which itself does not open on a mac as it is.

    I have used this code before on a web page to decipher which css style to use on text fields, one for mac, one for pc, as macs tend to display text differently.

    Fruit

  7. #7
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I don't know if i am misunderstanding what you are trying to do, but since I remember, you can specify the format in which you want to preview your flash: HTML (.html), FLASH (.swf), Windows Projector(Executable, .exe), or Mac Projector (.app). When you choose the format in which you want to preview your flash, it creates the file in the same directory as your .FLA, you will see the .app, the .exe, the .html and the .swf.

    What he has to do is create an HTML page with 2 buttons in which the user selects his operating system, (mac or windows) and then it redirects to the .app or the .exe depending of the user selection.

    Then in the .app flash movie, he use the fscommand("exec", "launcher.app");

    and in the .exe flash movie he use fscommand("exec", "launcher.exe");

    Hope this helps.

  8. #8
    Registered User
    Join Date
    Jun 2012
    Posts
    5
    Hi Guys!

    Thank you soooo much for all your responses, you've given me much to think about and to try out!! I never thought of using an if statement - I was just planning on having 2 separate files for a Mac and PC and then add an auto-run (I may have forgot to mention we'll be burning this to a CD).

    Anyhow, much to my dismay, my problem is a much simpler one that what we are all talking about.... I simply cannot get the .app file to launch via the fscommand. So angelhdz answer is exactly what I was trying to do - have separate links/files for Mac or PC.

    The code works for launcher.exe, but when I substitute it for launcher.app it simply won't work! I've tried placing the launcher in the same folder as the flash file (I'm exporting as a flash projector) and also within an fscommand folder but it won't work - I am simply pulling my hair out!

    I found a thread where they said there was a bug in CS3 (from 2007), but I'm in CS5.. surely this can't be the issue?!

    Once more, thanks for all the help guys!

  9. #9
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I'm don't have a MAC. But i'm trying to run Snow leopard in Virtual Box, Windows 7 to test MAC stuff. So i can't help you further by now.

    But, i'm pretty sure, if you do what i said, it should work. Make an autorun.inf, and put this:

    PHP Code:
    [autorun]
    OPEN=YourWinProjector'sName.exe
    OPEN=YourMACProjector'
    sName.app 
    You make that with Notepad and when you hit Save As, put autorun.inf as file name. Then, you burn the autorun.inf, the windowprojector.exe and the macprojector.app together in the same CD root, not into folders.

    In the windows projector use fscommand("exec", "launcher.exe");
    And in the mac projector use fscommand("exec", "launcher.app");

    Hope that helps.

  10. #10
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Me again, Mac does not allow or use autorun feature since long back

  11. #11
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Mmmm i didn't know that fruitbeard...i'm a windows user. But maybe another way to achieve something like autorun in mac? So he has the autorun.inf with the [autorun]
    OPEN=YourWinProjector'sName.exe

    and then he has the mac autorun function whatever it be, with the
    [whatever method of auto run CD]
    OPEN/RUN/EXECUTE/WHATEVER=YourMACProjector'sName.app


    I don't know! There has to be a workarround in MAC to auto run CD!

  12. #12
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Having had to do a windows/mac comptabile cd-rom before it was frustrating, there is software to do it, obviously you publish the exe and mac projectors and use the software to make a hybrid disc, its not just as simple as burning it to a disc.

    i will try to remeber what the software I used was called (plenty out there), other pc is down is over used psu, so I dont have access to it

  13. #13
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Huh...confirmed.

    Mac AUTOSTART(Autorun) feature is disabled on many Mac versions. So...

    tamakutchi, my friend, i think the only option here is put only the AutoRun for windows, and add a TEXT FILE with instructions for MAC Users. So, the mac users will open the main MacProjector.app manually and that mac projector will have the fscommand("exec", "launcher.app");

    The main Windows Projector will have the fscommand("exec", "launcher.exe");

  14. #14
    Registered User
    Join Date
    Jun 2012
    Posts
    5
    Thanks again guys!

    I was planning on making a hybrid CD disc and found this article:
    http://jordan.broughs.net/archives/2...installer-cds# ... If I couldn't get this working, then as a back-up I had a separate text file just for us mac people! (Client is only really concerned about the PC version, which I have working - I just thought I would try and go the extra step)

    As angelhdz mentioned about the mac projecter version using the fscommand("exec", "launcher.app"); THIS is where it won't work? I use this EXACT command and it won't launch the launcher.app? Something that I thought was so simple?!! but it won't work for some reason.

    I might just have to re-try on another computer in case the one I'm working on has a bug??

    Thanks for all your help guys! you've all been GREAT!

  15. #15
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Because we are talking about 2 MAC projectors!

    The first mac projector is the Main projector that the MAC users will open in the CD. The second mac projector is the launcher.app.

    You can't use fscommand("exec", "launcher.app"); if you are in the Windows Projector!!!

    Are you testing this on a mac? I'm on windows and it gives me a folder named untitled.app. Obviously, i can't run mac projectors on windows.

    1- Mac users browse the CD.

    2-mac users open MainMacProjector.app manually.
    3-MainMacProjector.app calls the 2nd mac projector named launcher.app: fscommand("exec", "launcher.app");


    1-windows users get the MainWindowsProjector.exe opened automatically with the autorun.inf
    2-MainWindowsProjector.exe calls the 2nd windows projector named launcher.exe: fscommand("exec", "launcher.exe");

    One last thing, in order for the fscommand to work, the called projector (launcher.exe or launcher.app) has to be in a folder named exactly fscommand , small letters and together, beside the Main projector.





    I can't help you further my friend. As i'm in windows, i can't test if the fscommand will open the launcher.app or not.

  16. #16
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    And remember, fscommand only works with the projector, not with the swf when you TEST MOVIE or DEBUG MOVIE...just in case. ^_^

  17. #17
    Registered User
    Join Date
    Jun 2012
    Posts
    5
    Thank you so much angelhdz for all your help, I really appreciate it!!

    I am indeed a Mac user and have done all the things you said - but the answer still eludes me!

    I am going to put it down as possibly a bug on my machine? I haven't had a chance to try on another machine as yet but am hoping this is just the case as I cannot see anything wrong with my code or file structure. If this does work on another computer I will let all of you know!

    Thank you all once again!!!

  18. #18
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    No problem man!

    1- in the root windows of the CD you going to burn, you put the autorun.inf and two folders, one named MAC and one named WINDOWS.
    the autorun.inf will have this:
    PHP Code:
    [autorun]
    OPEN="Windows/your main windows projector.exe" 
    2-Inside windows folder, will go your Main windows projector.exe and a folder named fscommand (smallletters)
    inside the fscommand folder, will go your launcher.exe projector

    3-Inside Mac folder, will go your main MAC projector.app and a folder named fscommand (smallletters)
    inside the fscommand folder, will go your launcher.app projector

    Obviously, the Main windows projector will auto play on CD inserted. The main Mac projector will be opened manually by the mac user in the MAC folder.

    Both the Main windows projector and the Main mac projector, will have the code fscommand("exec", "launcher.???") with corresponding extensions.

    If the fscommand exec function, doesn't work in your Main mac projector, there must be a problem with your flash application or something. The fscommand exec function SHOULD WORK in mac and windows because i reed it.

    Hoping this help, at last!



    Here is an image showing how you have to put your folders and files in the CD for burning
    http://www.mediafire.com/?5dunecp47d58d18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center