Opened on Aug 18, 2015 at 7:06:53 PM
Closed on Sep 2, 2015 at 10:49:25 AM
Last modified on Mar 7, 2017 at 1:59:49 PM
#3109 closed Bug (No Bug)
2x FileInstall in same line (in if statement) not working compiled
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | Aut2Exe | |
| Version: | 3.3.14.0 | Severity: | None |
| Keywords: | Cc: |
Description
Hello,
the following code works fine:
If Not (FileInstall("a.txt", "a2.txt") And FileInstall("b.txt", "b2.txt")) Then MsgBox(0, "", "Error")
But in the compiled version the second file could not be installed.. Maybe the Aut2Exe dont include the second file??
Try it yourself, it wont work
Attachments (0)
Change History (13)
follow-up: 3 comment:2 by , on Aug 18, 2015 at 7:15:23 PM
It is a real bug.. See #3107
@AutoIt Support (or whatever): Please read the tickets in future carefully and not simply stamping a request as no bug. Thank you
follow-up: 4 comment:3 by , on Aug 18, 2015 at 11:17:18 PM
comment:4 by , on Aug 19, 2015 at 10:44:31 AM
Replying to Jos:
Replying to anonymous:
It is a real bug.. See #3107
@AutoIt Support (or whatever): Please read the tickets in future carefully and not simply stamping a request as no bug. Thank you
Trying to make friends or something?
Jos
Seriously not! I just wanna help to improve AutoIt and get answers like that..
follow-up: 6 comment:5 by , on Sep 2, 2015 at 4:20:31 AM
My guess is that the compiler looks at the first fileinstall and ignores the second because it's on the same line.
You should probably just not use this line in any script, there's nothing saying that it should work this way, so when it doesn't it's not really a bug but a design decision.
There's better ways of determining if the files exist than trying to see if the fileinstall failed. After all, the way you wrote it if the out file already exists it will give you an error message which is probably not what you're looking for in the script in the first place. One liner coding just makes things easier for the coder, not for the poor people that have to read this dreck later.
comment:6 by , on Sep 2, 2015 at 8:33:33 AM
Replying to b:
My guess is that the compiler looks at the first fileinstall and ignores the second because it's on the same line.
You should probably just not use this line in any script, there's nothing saying that it should work this way, so when it doesn't it's not really a bug but a design decision.
There's better ways of determining if the files exist than trying to see if the fileinstall failed. After all, the way you wrote it if the out file already exists it will give you an error message which is probably not what you're looking for in the script in the first place. One liner coding just makes things easier for the coder, not for the poor people that have to read this dreck later.
follow-up: 10 comment:7 by , on Sep 2, 2015 at 10:49:25 AM
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
This is due to boolean evaluation short-circuit. Look at Help > Language Reference > Operators and read at the bottom of the page.
No bug. And please guys, don't use Trac to chat about "issues", the help forum is the suitable place for that.
comment:8 by , on Sep 17, 2015 at 8:29:36 AM
Sorry but you did not try it, right? This is a bug.. See the evidence.. It has to work..
comment:9 by , on Sep 17, 2015 at 9:33:24 PM
Stop spamming this ticket and instead try to understand the hint given.
comment:10 by , on Dec 9, 2015 at 9:29:49 AM
Replying to jchd18:
This is due to boolean evaluation short-circuit. Look at Help > Language Reference > Operators and read at the bottom of the page.
No bug. And please guys, don't use Trac to chat about "issues", the help forum is the suitable place for that.
I tried the same. It does not work... The first function returns true so is your argument not correct. Did anybody tried this by self??
comment:11 by , on Dec 9, 2015 at 9:34:06 AM
In comment 1 is the evidence. Why you say this is no bug. Explain me this..
comment:12 by , on Dec 9, 2015 at 10:25:32 PM
Place to ask and learn is here:
https://www.autoitscript.com/forum/
comment:13 by , on Mar 7, 2017 at 1:59:49 PM
I spent a long time debugging my script and tearing my hair out before uncovering this ticket. Please at least update the documentation to reflect that there can only be 1 FileInstall per line.

Here I got the evidence:
Version 1 not working:
If Not (FileInstall("a.txt", "a2.txt") And FileInstall("b.txt", "b2.txt")) Then MsgBox(0, "", "error") ExitVersion 2 working:
If Not (FileInstall("a.txt", "a2.txt") And FileInstall("b.txt", "b2.txt")) Then MsgBox(0, "", "error") Exit FileInstall("b.txt", "b2.txt")I added the third FileInstall. This line will not be excecuted but the Aut2Exe recognize the second file and the installation works!