Skip to main content
Steve Howard, ACP
Inspiring
November 22, 2009
Question

Launching exe - swf fscommand?

  • November 22, 2009
  • 2 replies
  • 8325 views

When I use the "open file or url" option to launch an exe, I get a download file dialogue. This is in Windows 7. Is that normal on xp and Vista too?

So in an attempt to bypass that, I built a Flash button that uses fscommand("exec", "myfile.exe") to launch an exe. When published as exe, the Flash file launches the exe as expected, but when I embed the flash swf into Captivate and publish *that* as exe, the fscommand dowsn't work.

So I'm looking for suggestions for a cleaner way to launch an exe from Captivate - I'd prefer not to see a download file dialogue.

TIA

Steve

This topic has been closed for replies.

2 replies

Legend
November 23, 2009

When you tell C4 to open a file, the logic in the code jumps to the "open" case in the EvaluateExternalStatement function (scroll below).

var _l2 = "open C:\\windows\\system32\\cmd.exe _self\nrdcmndResume = 1 ";

var _18 gets set to false in the EvaluateExteralStatement function.

_18 gets passed as the ForceFS parameter to the ExecuteExternalCmnd function.  The logic in that function uses _18 to decide whether or not an fscommand is done.  If _18 was set to "true", I believe you could rig this thing to open a file because the fscommand would be used instead of getURL.  This is probably by design for security reasons.  Same behavior on xp as well :-)

*** class captivate.Veela_AS2.rdScriptEval ***

function ExecuteExternalCmnd(fsCmd, fsArg, guArg1, guArg2, ForceFS)
    {
        this.mytrace("ExecuteExternalCmnd 1");
        if (ForceFS)
        {
            if (int(rdIsPreview) == 1 || FlashPlayer)
            {
                fscommand(fsCmd, fsArg);
                return(undefined);
            } // end if
        } // end if
        getURL(guArg1, guArg2);
    } // End of the function
    function EvaluateExternalStatement(stmnt)
    {
        var _l8 = true;
        var _l11 = this.Trim(stmnt);
        var _l3 = this.mySplit(_l11);
        var _l7;
        var _l6;
        var _l10;
        var _l4;
        var _l9;
        var _l2;
        _l10 = this.Trim(_l3.pop());
        _l9 = _l3.shift();
        _l2 = _l3[0];
        if (_l9 == "email" && (_l2 == undefined || _l2 == null || _l2 == ""))
        {
            _l2 = _l10;
        } // end if
        var _l5 = _l2.split("\"");
        if (_l5.length == 3)
        {
            _l2 = _l5[1];
        }
        else
        {
            _l2 = _l5[0];
        } // end if
        _l3[0] = _l2;
        switch (_l9)
        {
            case "open":
            {
                _l8 = false; JBL: *** This Should be set to true so fscommand executes ***
            }
            case "openmovie":
            {
                _l7 = "jumpmovie";
                _l4 = this.Trim(_l3.join(" "));
                _l6 = _l4;
                break;
            }
            case "email":
            {
                _l7 = "execfile";
                _l4 = "mailto:" + this.Trim(_l3.join(" "));
                _l6 = _l4;
                break;
            }
            case "javascript":
            {
                _l7 = "javascript";
                _l4 = this.Trim(_l3.join(" "));
                _l6 = "javascript:" + _l4;
                if (swfCommenting)
                {
                    m_movie_mc.executeJavascriptInAIR(_l4);
                    return(undefined);
                } // end if
                break;
            }
            default:
            {
                return(undefined);
            }
        } // End of switch
        this.ExecuteExternalCmnd(_l7, _l4, _l6, _l10, _l8);
    } // End of the function

C3 does the same thing in a simpler way using getURL:

    var _l1 = "C:\\windows\\notepad.exe";
    getURL(_l1, "_self");

HTH,

Jim Leichliter

Steve Howard, ACP
Inspiring
November 23, 2009

Thanks - you leapt on a little ahead of me. What file did you get this from ? I think I found the equivalent AS3 functionality in CaptivateMaintimeline.as, but I have not yet found the AS 2 file that you quoted.

Since I published as AS3, I expect that CaptivateMaintimeline.as has the functionality I need, and to my less-than-stellar Flash knowledge the code looks 'right' :-)

Steve

Legend
November 23, 2009
Legend
November 23, 2009

Steve,

What's your end goal?  Will the final published C4 swf file be hosted in a browser or published as an .exe?

Steve Howard, ACP
Inspiring
November 23, 2009

Captivate is published as exe - it will not ever run in the browser.