Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#415 closed Bug (Fixed)

CUI compiled scripts won't execute batch files properly

Reported by: ResNullius Owned by: Valik
Milestone: 3.2.13.6 Component: AutoIt
Version: 3.2.12.1 Severity: None
Keywords: Cc:

Description

The following script when run uncompiled behaves as expected, you are greeted with the "Press any key to continue" message and the batch file waits for a key press.
But when compiled and run, it displays the message and immediately returns from the batch file without waiting for the key press.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

$tmpBatFile = FileOpen("tmpBatFile.cmd",2)
FileWriteLine($tmpBatFile,"@Pause")
FileClose($tmpBatFile)
ConsoleWrite(@CRLF & "Are you Ready?" & @CRLF & @CRLF)
RunWait("tmpBatFile.cmd")
ConsoleWrite("Done" & @CRLF)

Tested on Win2000/XP 32-bit with all service packs. Also with AutoIt beta 3.2.13.3.
The problem does not exist when compiled under v3.2.10.0 (with a compatible version of AutoIt3Wrapper).

Don't think it's a problem with the keyboard buffer, because on a different script that waits for user input via a batch file, I get an error like there was no input, whereas run on its own (from a cmd prompt) the batch file doesn't error even if you just hit return without any input.

Attachments (0)

Change History (5)

in reply to:  description comment:1 by Valik, 18 years ago

Replying to ResNullius:

The following script when run uncompiled behaves as expected, you are greeted with the "Press any key to continue" message and the batch file waits for a key press.

That's because when running non-compiled, you are not running as a console application at all. So, this is irrelevant.

Tested on Win2000/XP 32-bit with all service packs. Also with AutoIt beta 3.2.13.3.
The problem does not exist when compiled under v3.2.10.0 (with a compatible version of AutoIt3Wrapper).

The first version to officially support CUI compilation is 3.2.12.0. Any other version is irrelevant.

That being said, I know what the issue is and how to fix it but I'm debating on whether or not fixing it is right.

comment:2 by Valik, 18 years ago

Owner: set to Valik
Status: newassigned

in reply to:  2 comment:3 by ResNullius, 18 years ago

Replying to Valik:

That's because when running non-compiled, you are not running as a console application at all. So, this is irrelevant.

Just background info, didn't want to be accused of insufficient testing :-)

That being said, I know what the issue is and how to fix it but I'm debating on whether or not fixing it is right.

Of course, that is up to you.
If you decide not to fix, will you explain why it isn't right to?
Just seems to me that if a compiled GUI script can execute batch files like this OK then a CUI compiled one should be able to also.
Thanks Valik, I'll leave you alone now.

comment:4 by Valik, 18 years ago

Milestone: 3.2.13.6
Resolution: Fixed
Status: assignedclosed

Fixed in version: 3.2.13.6

comment:5 by Valik, 18 years ago

There is a new flag (Inherit Parent Handles) which you must use in order for this to work how you expect.

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.