Page 1 of 1

Compile issue v1.1.30.00 and v1.1.30.01

Posted: 09 Dec 2018, 19:13
by PuzzledGreatly
When compiling I keep seeing this error message:
Error: Could not copy final compiled binary file to destination
Note, this happens when the compiling succeeds. It doesn't happen every time but always after my computer has rebooted. I seem to remember this problem from several years ago.

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 10 Dec 2018, 03:22
by jmeneses
Hi PuzzledGreatly,
Try When this happens to you or before compiling make sure, with the task manager, that the name you give to your executable is not running.
I use a BAT to compile my scripts, which I did a TASKKILL
Each BAT is different but here is an example

Code: Select all

taskkill /F /IM EMULHootL* /T
DEL X:\PortableApps\Auto\Scripts\AUTOHOT\MisScripts\EMULHootL*.exe
X:\PortableApps\Auto\AutohotKey_L\Compiler\Ahk2Exe.exe /in X:\PortableApps\Auto\Scripts\AUTOHOT\MisScripts\EMULHootL_v5.ahk /out X:\PortableApps\Auto\Scripts\AUTOHOT\MisScripts\EMULHootL_v5.exe /icon X:\PortableApps\Auto\Scripts\Icons\2387.ico
I Hope this can help you
regards

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 10 Dec 2018, 09:58
by PuzzledGreatly
Thanks, I use process, close rather than taskkill. I've confirmed using task manger that the executable is not running and that the message appears when the executable is compiled.

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 11 Dec 2018, 02:06
by jmeneses
Hello PuzzledGreatly
I doubt it's a BUG of AHK, I'm compiling daily with v1.1.30.00 and W10 64b, It's evident that AhK2Exe can not record the output file in the destination directory for some reason. It's probably a Windows permissions or privileges issue, with this if I have had very several problems whit old scripts that worked correctly and they stopped doing it without compiling them and and everything was for permissions issue.
When it happens to you and before you answering the message, try to copy a file or generate a TXT in the destination directory of the * .EXE

Regards

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 11 Dec 2018, 02:41
by jmeneses

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 04 Jan 2019, 18:23
by PuzzledGreatly
Thanks for the replies. I had no trouble compiling with version AHK 1.1.29.01. I don't think it is a permissions issue as this occurs in different folders on different hard drives and yes I can carry out regular activities in those folders. I think it is a memory issue as the issue is not consistent.

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 16 Mar 2019, 22:04
by lexikos
The error message in question is raised by this:

Code: Select all

	try FileCopy, %ExeFileTmp%, %ExeFile%, 1
	catch
		Util_Error("Error: Could not copy final compiled binary file to destination.")
So you see, a simple FileCopy is failing. You might get more information by getting the Ahk2Exe source and adding A_LastError to the message shown by Util_Error. Error 5 would be "access denied".

When I see a "permissions" error for a file which I clearly have write permission to (and is not read-only), I think of two possibilities:
  • The file is locked/in use.
  • The antivirus is interfering.

Re: Compile issue v1.1.30.00 and v1.1.30.01

Posted: 17 Jan 2020, 15:57
by robertnixon
I have had this error and found that the it was cured by NOT having the source code in the AutoHotKey folder under Program Files (or presumably any other folders that Windows "manages"). Putting the source on Desktop works, but I opted for a folder not under Program Files with all my AHK sources etc. in it.