3 Replies Latest reply on Dec 14, 2010 1:06 AM by izzusan

    problem with .exe

    izzusan

      hello,

       

      I have to call  a. exe
      this. exe is a flash game and exported.  air.
      when I install the. air, it creates a. exe
      now I have to call my own. exe and use
      var file: File =  File.applicationDirectory.resolvePath (mansioni_sq1.exe ");
      file.openWithDefaultApplication ();
      but it gives me error:
      Error: Error # 3000: Illegal path name.
      at Error $ / throwError ()
      at  flash.filesystem:: File / openWithDefaultApplication ()
      at Menu_principale/onClickStart1 () [C: \ Documents and  Settings \ User \ My Documents \ Cs-group-game \ Classes \  Menu_principale.as: 29]

      Why?
      I use flsah cs5 all updated.
      I  do not know how ... help

        • 1. Re: problem with .exe
          commadelimited Level 2

          It looks like you might have your quotes wrong:

           

          var file: File =  File.applicationDirectory.resolvePath (mansioni_sq1.exe ");

           

          should be this?

           

          var file:File =  File.applicationDirectory.resolvePath('mansioni_sq1.exe');

          • 2. Re: problem with .exe
            izzusan Level 1

            no sorry is wrog the paste from my pc

             

            now from flash cs5 is ok with native process with this code:

             

            public var  process:NativeProcess;
                    public var  output:String  = "waiting...";
                    public function Menu_principale()
                    {
                        Mouse.show();
                        Squadra1.addEventListener( MouseEvent.CLICK, onClickStart1 );
                        Squadra2.addEventListener( MouseEvent.CLICK, onClickStart2 );
                       
                    }
                   
                    public function onClickStart1( event:MouseEvent ):void
                    {
                       
            var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
                    var file:File = File.applicationDirectory.resolvePath("squadra1_menu/squadra1_menu.exe");
                    npsi.executable = file;
                 fscommand("quit");
                    process = new NativeProcess();
                    process.start( npsi );
                
                    process.addEventListener( ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData );
                    process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
                
                    process.addEventListener(NativeProcessExitEvent.EXIT, onExit);
                    process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
                    process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);

             

                    }
                   
            private function  onClosing():void
                {
                    if( process )
                        process.exit(true);
                }
                
                private function onOutputData( event:ProgressEvent ):void
                {
                    output = process.standardOutput.readUTFBytes( process.standardOutput.bytesAvailable );
                }
                
                private function onErrorData(event:ProgressEvent):void
                {
                    output = "ERROR -" + process.standardError.readUTFBytes(process.standardError.bytesAvailable);
            }
                
                private function onExit(event:NativeProcessExitEvent):void
                {
                    output = "Process exited with " + event.exitCode;
                }
                
                private function onIOError(event:IOErrorEvent):void
                {
                    output = event.toString();
                }  

             


            now when i export the file in .air, i install my game and the link don't' work!!! why???? uff is crazy!

            I changed the file xml why this code :

             

            <supportedProfiles>extendedDesktop desktop</supportedProfiles>

             

            but nothing . . . why what is the problem....

            • 3. Re: problem with .exe
              izzusan Level 1

              i try whit this code:

               

                var file:File = File.applicationDirectory.resolvePath("squadra1_menu/squadra1_menu.exe");

               

               

               

              File.openWithDefaultApplication()

              but the system tell me illegal path