Is there some official BIN ver.2.0 that can be used with Ahk2Exe ?
OR
Guide me How To make BIN from AutoHotkey.exe ?
Thanks.
AHKv2.0 Ahk2Exe Topic is solved
AHKv2.0 Ahk2Exe
AHKv2.0 alpha forever.
Re: AHKv2.0 Ahk2Exe
There is no Util_ library, the only Util_ functions used are Util_Error() defined in Ahk2Exe.ahk and Util_GetFullPath() defined in Compiler.ahk.
You will need AHK_H v2 executable to run compiler (Ahk2Exe.ahk):
1. extract all content to a folder
2. copy AutoHotkey.exe to compiler folder
3. rename AutoHotkey.exe to Ahk2Exe.exe
4. run Ahk2Exe.exe
You will need AHK_H v2 executable to run compiler (Ahk2Exe.ahk):
1. extract all content to a folder
2. copy AutoHotkey.exe to compiler folder
3. rename AutoHotkey.exe to Ahk2Exe.exe
4. run Ahk2Exe.exe
Re: AHKv2.0 Ahk2Exe
I do exactly steps
in addition I copy standard ahk scripts from Lib folder to Compiler\Lib
AutoHotkey.exe (2.0-a056-33fe326 / Unicode / x86) default AutoHotkey.exe
Ahk2Exe.ahk line 439I correct it to:
Now
IconChanger.ahk line 28Ill keep tracing the code - till it run
in addition I copy standard ahk scripts from Lib folder to Compiler\Lib
AutoHotkey.exe (2.0-a056-33fe326 / Unicode / x86) default AutoHotkey.exe
Ahk2Exe.ahk line 439
Code: Select all
#DllImport,HtmlHelp,hhctrl.ocx\HtmlHelp,PTR,,Str,,UInt,,PTR,
VarSetCapacity(ak, ak_size := 8+5*A_PtrSize+4, 0) ; HH_AKLINK struct
,NumPut(ak_size, ak, 0, "UInt"),name := "Ahk2Exe",NumPut(&name, ak, 8)
,HtmlHelp(GuiHwnd, helpfile, 0x000D, &ak) ; 0x000D: HH_KEYWORD_LOOKUP
Code: Select all
DllImport,HtmlHelp,hhctrl.ocx\HtmlHelp,PTR,,Str,,UInt,,PTR ;<< remove # (begin) and coma(end)
,VarSetCapacity(ak, ak_size := 8+5*A_PtrSize+4, 0) ; HH_AKLINK struct << add leading coma
,NumPut(ak_size, ak, 0, "UInt"),name := "Ahk2Exe",NumPut(&name, ak, 8)
,HtmlHelp(GuiHwnd, helpfile, 0x000D, &ak) ; 0x000D: HH_KEYWORD_LOOKUP
IconChanger.ahk line 28
Code: Select all
UpdateResource(re, 3, ids[A_Index], 0x409) ;<< function missing
AHKv2.0 alpha forever.
Re: AHKv2.0 Ahk2Exe
You are using wrong AutoHotkey.exe, you need to use AHK_H v2 (download), version should be showing 2.0.0.0.
Re: AHKv2.0 Ahk2Exe
In ahkdll-v2-release-master.zip function UpdateResource missing too
Only call of the function and no definition in any ahk file.
Only call of the function and no definition in any ahk file.
AHKv2.0 alpha forever.
Re: AHKv2.0 Ahk2Exe
It is included in exe, see WinApi
Create AutoHotkey.ahk in Win32w folder and double click AutoHotkey.exe, no error
Create AutoHotkey.ahk in Win32w folder and double click AutoHotkey.exe, no error
Code: Select all
UpdateResource()
Re: AHKv2.0 Ahk2Exe
Thanks - now It started.
I copy Autohotkey.exe from .\Win32w to .\Compiler and rename it to Ahk2Exe.exe also copy AutoHotkeySC.bin to .\Compiler
Still not tested but when started it will work.
Thanks again.
I copy Autohotkey.exe from .\Win32w to .\Compiler and rename it to Ahk2Exe.exe also copy AutoHotkeySC.bin to .\Compiler
Still not tested but when started it will work.
Thanks again.
AHKv2.0 alpha forever.
Re: AHKv2.0 Ahk2Exe
I've been experimenting with this method to compile AHKv2 scripts. It has worked for some simple scripts. However, I am running into an issue with a script that uses the following code:
This script runs fine uncompiled (as an .ahk script) using both the AHKv2 and the AutoHotkey_H executables. However, when I compile this script using the method described above (renaming the AutoHotkey_H executable to Ahk2Exe.exe) the compiled script does not work. WinGetClass and WinGetTitle both fail to work and return empty strings in the compiled version (WinGetID still works).
Any idea what would cause this issue in the compiled executable, or if there's a way to fix it?
Code: Select all
thisClass := WinGetClass("A")
thisWindowTitle := WinGetTitle("A")
thisWindowID := WinGetID("A")
Dbg.Out("winClass=%thisClass% winTitle=%thisWindowTitle% winID=%thisWindowID%")
Any idea what would cause this issue in the compiled executable, or if there's a way to fix it?
Re: AHKv2.0 Ahk2Exe
Anyone have any thoughts about this, or suggestions for how I can compile my script? Do I need to provide more information?
I did a completely fresh reinstall of AutoHotkey_H to make sure I wasn't mixing any resources from other versions of AHK, and I am still not able to compile my scripts. The scripts run fine when I run them as .ahk through the AutoHotkey_H executable, but when I compile them they don't work anymore, usually because various kinds of functions are returning empty strings, even though they worked fine before compilation.
Otherwise, does anyone know how I can compile AHKv2 scripts another way? Perhaps by creating a BIN for AHKv2? I don't know how to do that, but I'm willing to do the heavy lifting if someone can point me in the right direction. I'm hoping this isn't a dead end.. I could refactor the entire script to work in AHK version 1 so that it's compilable, but that's a lot of work and will make the code a lot uglier just so it can compile
I did a completely fresh reinstall of AutoHotkey_H to make sure I wasn't mixing any resources from other versions of AHK, and I am still not able to compile my scripts. The scripts run fine when I run them as .ahk through the AutoHotkey_H executable, but when I compile them they don't work anymore, usually because various kinds of functions are returning empty strings, even though they worked fine before compilation.
Otherwise, does anyone know how I can compile AHKv2 scripts another way? Perhaps by creating a BIN for AHKv2? I don't know how to do that, but I'm willing to do the heavy lifting if someone can point me in the right direction. I'm hoping this isn't a dead end.. I could refactor the entire script to work in AHK version 1 so that it's compilable, but that's a lot of work and will make the code a lot uglier just so it can compile
Re: AHKv2.0 Ahk2Exe
I can confirm this is a bug but I have not found a solution yet.
You can compile your scripts using AutoHotkey.exe with included compiler, only AutoHotkeySC.bin has got that bug as far as I know.
You can compile your scripts using AutoHotkey.exe with included compiler, only AutoHotkeySC.bin has got that bug as far as I know.
Re: AHKv2.0 Ahk2Exe
This should be fixed now, download AutoHotkey_H v2 alpha and try again
Re: AHKv2.0 Ahk2Exe
Nice! It works.
Thanks for helping to fix it - that's going to be extremely useful.
Thanks for helping to fix it - that's going to be extremely useful.
Re: AHKv2.0 Ahk2Exe
I have implemented a proper fix after explanation from Lexikos, I would reccomend to redownload AutoHotkey_H v2 alpha.
Re: AHKv2.0 Ahk2Exe
I ran into another issue with this compiler recently (at least, I think it's the compiler - perhaps it could be a v2 bug?).
The new function version of FileInstall does not work correctly. It ends up creating a 0KB file in the destination path.
However, the old command version of FileInstall still works as expected - I fixed the bug by going back to the old command syntax, and things now work as expected.
Code that does not work (generates an empty 0KB bmp file at the destination when the program is run):
Code that works as expected:
The new function version of FileInstall does not work correctly. It ends up creating a 0KB file in the destination path.
However, the old command version of FileInstall still works as expected - I fixed the bug by going back to the old command syntax, and things now work as expected.
Code that does not work (generates an empty 0KB bmp file at the destination when the program is run):
Code: Select all
FileInstall("binoc.bmp", "%A_AppData%\TT\binoc.bmp", 1)
Code: Select all
FileInstall, binoc.bmp, %A_AppData%\TT\binoc.bmp, 1
Re: AHKv2.0 Ahk2Exe
I have adapted Ahk2Exe for v2 and AutoHotkey v2\Compiler to accept FileInstall("...", "...").
Re: AHKv2.0 Ahk2Exe
Hey HotKeyIt,
Can you please explain how to set up the compiler again? I'm trying to update to the newest version you've put out, but I can't get it to work. This is what I tried:
1. Download the package https://github.com/HotKeyIt/ahkdll-v2-r ... master.zip
2. Copy AutoHotkey.exe from the Win32w directory into the Compiler directory, and renamed it Ahk2Exe.exe
* I also tried copying AutoHotkey.exe from the 64 bit directory when this one didn't work.
3. Tried to compile script. There doesn't appear to be a BIN included in the package anymore, so I tried selecting all the other options from the Base File (.bin) dropdown menu instead (I tried the 32 & 64 bit AutoHotkey.exe and also the Autohotkey.dll files. When those didn't work, I also tried copying over my old AutoHotkeySC.bin and using that as a .bin file, but that doesn't seem to work either when I try to compile a script)
I can still compile with my old version of Ahk2Exe and AutoHotkeySC.bin, so I'm not sure what I'm doing wrong trying to set up the newer files. Any help is appreciated. Thanks!
Can you please explain how to set up the compiler again? I'm trying to update to the newest version you've put out, but I can't get it to work. This is what I tried:
1. Download the package https://github.com/HotKeyIt/ahkdll-v2-r ... master.zip
2. Copy AutoHotkey.exe from the Win32w directory into the Compiler directory, and renamed it Ahk2Exe.exe
* I also tried copying AutoHotkey.exe from the 64 bit directory when this one didn't work.
3. Tried to compile script. There doesn't appear to be a BIN included in the package anymore, so I tried selecting all the other options from the Base File (.bin) dropdown menu instead (I tried the 32 & 64 bit AutoHotkey.exe and also the Autohotkey.dll files. When those didn't work, I also tried copying over my old AutoHotkeySC.bin and using that as a .bin file, but that doesn't seem to work either when I try to compile a script)
I can still compile with my old version of Ahk2Exe and AutoHotkeySC.bin, so I'm not sure what I'm doing wrong trying to set up the newer files. Any help is appreciated. Thanks!
Re: AHKv2.0 Ahk2Exe
What do you mean by 'that doesn't seems to work'.
AutoHotkey_H v2 has not got a ..SC.bin file anymore because some features do not work here and I don't see the need for it.
AutoHotkey_H v2 has not got a ..SC.bin file anymore because some features do not work here and I don't see the need for it.
- What script do you try to compile?
- Is the exe created?
- Do you get any errors?
- Did you try to compile a simple script?
Re: AHKv2.0 Ahk2Exe
Hmm. I'm going to need to investigate a bit, I guess. I got it to work with a simple script.
The script I was trying to compile is several thousand lines long, so I'm not sure what the source of the issue is. The main hotkeys for that script don't appear to be working at all when I compile the script with the most recent version of your compiler. It works fine when I compile with the old .bin file and old version of AHK_H from 2015, though. I'll let you know if I can pin down the problem.
The script I was trying to compile is several thousand lines long, so I'm not sure what the source of the issue is. The main hotkeys for that script don't appear to be working at all when I compile the script with the most recent version of your compiler. It works fine when I compile with the old .bin file and old version of AHK_H from 2015, though. I'll let you know if I can pin down the problem.