Jump to content

Aut2exe : Error copying source to destination file when compiling ?


Recommended Posts

Hi,

sometimes, after a faulty run (the autoit compiled, but there was an error at runtime), at next compilation, I have this Aut2exe  error "Error copying source to destination file name_of_the_exe_file"

I cannot even delete the exe file under windows 10 : it says the file is opened. But I do not see it in the task list...

To solve it, I have to reboot the computer.

It seems that in some case, the exe file is "locked"

Do you know how to solve this without reboot ?

Link to comment
Share on other sites

Have seen this behaviour in the past, in my case the AV was scanning the file for a long period of time and wouldn't allow me to delete until it had completed.  What was strange was that it occurred after I added a particular .ico file to the script, after changing the icon it worked.  Haven't seen the behaviour in a while now though.

My 2cents.

Link to comment
Share on other sites

16 hours ago, binbinhfr said:

cannot even delete the exe file under windows 10

I can't speak for windows 10 but for sure the exe is still running, that's why you can't delete it. I have a hotkey script running permanently in my PC. I often get this issue when I forget to terminate it when recompiling a change. Sometimes MsgBox() windows from AutoIt can get hidden behind foreground windows and you may not notice this has happened.

EDIT: In my script I have executed AutoItSetOption("TrayIconHide", 0) and so there is no trace of the running script in taskmgr. I have setup a hotkey;  HotKeySet("^!{F5}", "TerminateMyScript") ; and use this to terminate the script. CTRL-ALT-F5.
 

Edited by pseakins
Noted in text.

Phil Seakins

Link to comment
Share on other sites

17 hours ago, binbinhfr said:

But in my case, it should not be an AV problem, because the whole directory is set as an exception and never scanned...

Don't trust the AV, in my experience exceptions are wonky and are a hit-or-miss most of the time, I have had many of my files quarantined even after adding an exception. It has been many years since I have used an AV so don't know if things have improved.

Try turning it off entirely, and maybe uninstall it to be 100% sure. If the issue doesn't occur, you have your answer.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Link to comment
Share on other sites

  • Developers
On 10/29/2021 at 10:18 AM, binbinhfr said:

because the whole directory is set as an exception and never scanned

Which directory did you exclude? 
Did you also exclude this directory: %localappdata%\AutoIt v3\Aut2exe ?
Did you check your AV logs for any activities?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

31 minutes ago, Jos said:

Which directory did you exclude? 
Did you also exclude this directory: %localappdata%\AutoIt v3\Aut2exe ?
Did you check your AV logs for any activities?

 

You're right, I forgot the aut2exe dir....  I included it now.

But I checked the AV logs : nothing about autoit or my program... (BTW teh AV already screams in the past as soon as I compiled a autoit prog, that's why I add some exceptions that solved the problem.

Link to comment
Share on other sites

  • Developers

So does it work now? 
The %localappdata%\AutoIt v3\Aut2exe is used to store the tempfiles & binaries. The compiler has al kinds of PE header activities on these files, which is something AV software finds suspicious. 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

for the moment it works, but it's a rare bug.

It only happens if there is some kind of crash after compile/running.

Often when once runned, the program gives an error like "variable not yet defined" or something like that...

I'll tell you.

Thanks all for your help anyway.

Link to comment
Share on other sites

  • Developers
20 minutes ago, binbinhfr said:

the program gives an error like "variable not yet defined" or something like that.

That is not the same thing as an issue at compilation time! ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

4 minutes ago, Jos said:

That is not the same thing as an issue at compilation time! ;) 

The first issue is this one. And afterwards, I have a neverending issue at compilation time, about "cannot write EXE".

So the operation that "locks" the EXE is probably this first runtime error. It leaves something "hanging"... (maybe a driver, because I deal with opening MIDI drivers...)

Edited by binbinhfr
Link to comment
Share on other sites

  • Developers

It is correct that you can't create a new EXE when the original one is locked, but that is again another issue. 
Try separating the issues and tackle them one at a time. 

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

25 minutes ago, Jos said:

It is correct that you can't create a new EXE when the original one is locked, but that is again another issue. 
Try separating the issues and tackle them one at a time. 

 

read the top of my post : that is what I described : impossible to write the exe. Maybe I was not clear. Sorry english is not native to me.😉

And I don't know if it's really "locked". But I cannot delete it.

Edited by binbinhfr
Link to comment
Share on other sites

  • Developers

No worries...  I did read before answering. ;) 

So you need to figure out why your system is locking the file so you can delete/override it. Is it possible to rename the exe?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

7 hours ago, JockoDundee said:

Next time when it happens go into resource monitor CPU and search the handles:

then you can “whack the pid”, as they say…

It happens again yesterday. I did look at the handle using Process Explorer which is a quite precise tool from MS :

https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

I found 4 reference to my EXE running. But impossible to kill any of the 4 tasks with the "kill" button...

Do you have a trick to kill them "harder" ?

Edited by binbinhfr
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...