Page 1 of 1

ahk2exe v1.1.30.01 bug

Posted: 18 Jan 2019, 03:27
by pidgay
The problem occurs under the following circumstances:

[main folder]\src\inc1.ahk
[main folder]\src\inc2.ahk
and, [main folder]\main.ahk includes two files above.

Code: Select all

#Include %A_LineFile%\..\src\inc1.ahk
#Include %A_LineFile%\..\src\inc2.ahk
compile main.ahk
ahk2exe v1.1.29.01 : no problem!! :D
ahk2exe v1.1.30.01 : problem!! :shock:

Thank you for reading this. ;)

Re: ahk2exe v1.1.30.01 bug

Posted: 18 Jan 2019, 08:54
by kczx3
Does it through an error? Screenshot please?

Re: ahk2exe v1.1.30.01 bug

Posted: 18 Jan 2019, 17:47
by pidgay
#include file "X:\test\src\src\inc2.ahk" cannot be opened.
real path is "X:\test\src\inc2.ahk"
but ahk2exe v1.1.30.01 assumes "X:\test\src\src\inc2.ahk"

plus,
first include, "X:\test\src\inc1.ahk" is no problem! :o
only second, third, ...

Re: ahk2exe v1.1.30.01 bug  Topic is solved

Posted: 21 Jan 2019, 18:19
by TAC109
In the absence of Lexikos, I have made a small change to AHK2EXE 1.1.30.01 to fix this bug.

The new version can be downloaded from here and should be copied to overwrite the old version.
(Default location is C:\Program Files\AutoHotkey\Compiler).

Note to Lexikos:-
The changes I made were to ScriptParser.ahk.

Replace line 20 with:-

Code: Select all

	oldLineFile := DerefIncludeVars.A_LineFile             ; New line
	DerefIncludeVars.A_LineFile := AhkScript               ; Existing line
Replace about line 164 with:-

Code: Select all

	DerefIncludeVars.A_LineFile :=	oldLineFile      ; New line
	if OldWorkingDir                                 ; Existing lines
		SetWorkingDir, %OldWorkingDir%
Edit:- fixed link.

Re: ahk2exe v1.1.30.01 bug

Posted: 22 Jan 2019, 04:37
by Ragnar
Additionally, you can edit ScriptParser.ahk in the official GitHub repository of Ahk2Exe to have your change included in the next release.

BTW the download link you provided doesn't work.

Re: ahk2exe v1.1.30.01 bug

Posted: 22 Jan 2019, 14:56
by TAC109
Oops! The correct link is here
I've corrected the link in my post above, also.

Re: ahk2exe v1.1.30.01 bug

Posted: 12 Aug 2020, 15:30
by jballi
Preface: I apologize if I am behind the times. I can't keep up with everything that is going on.

I haven't compiled in a while but I was recently trying to compile a script using v1.1.33+ and it generated an error. I did a quick Google search and found this version. Thought I'd give it try it and it worked without an error! Question: Does the latest AHK release have the latest version of ahk2exe version or is it behind? Is this the latest version or is there something even more recent? Thank you for your assistance.

Re: ahk2exe v1.1.30.01 bug

Posted: 12 Aug 2020, 16:19
by TAC109
No, the version posted in this thread is very old. The version of Ahk2Exe included with the latest version of AutoHotkey has had numerous enhancements and bug fixes since then.

The new version does check for some situations that were silently ignored in previous versions, and now gives a warning message for these conditions. Pressing 'ok' from the warning message will finish the compilation, subject to the details shown in the warning message.

For more specific information, it would be best to start a new thread with details of the problem you encountered.

Cheers