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

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.