Page 2 of 2

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 27 Jul 2019, 15:34
by HotKeyIt
What do you mean by ALL compilation options and what error do you get otherwise?

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 27 Jul 2019, 16:51
by manehscripts
HotKeyIt wrote:
27 Jul 2019, 15:34
What do you mean by ALL compilation options and what error do you get otherwise?
Hi!
I only use the compiled x64w folder
But in order for it to be generated correctly, I need to check all options as below. If I uncheck Win32... for example, it does not work correctly.
The other files I do not use.
002.png
002.png (55.89 KiB) Viewed 2366 times
001.png
001.png (5.41 KiB) Viewed 2366 times

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 27 Jul 2019, 18:51
by HotKeyIt
What do you mean by it does not work correctly?

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 28 Jul 2019, 00:19
by manehscripts
HotKeyIt wrote:
27 Jul 2019, 18:51
What do you mean by it does not work correctly?
When I choose only x64, in the final folder it does not create the .exe correctly, something is missing:
Screenshot_7.png
Screenshot_7.png (57.46 KiB) Viewed 2197 times
Screenshot_8.png
Screenshot_8.png (12.5 KiB) Viewed 2197 times

But when I choose ALL options (with x32) as I showed in the post above, it creates .exe the right way:
Screenshot_9.png
Screenshot_9.png (61.24 KiB) Viewed 2197 times

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 28 Jul 2019, 03:33
by HotKeyIt
Make sure that AutoHotkey is the startup project (bold) and tick or select AutoHotkey|MT_Release|x64 only.

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 28 Jul 2019, 15:19
by manehscripts
HotKeyIt wrote:
28 Jul 2019, 03:33
Make sure that AutoHotkey is the startup project (bold) and tick or select AutoHotkey|MT_Release|x64 only.
Hi, yeah, I make AutoHotkey is the startup project and tried to compile the way you said (AutoHotkey|MT_Release|x64 only) and also just choosing Release, but even so in the final file it doesn't get the right size and it doesn't work. But if I select all the options, as I mentioned above, the final file gets 2,448kb
Screenshot_7.png
Screenshot_7.png (57.46 KiB) Viewed 2157 times
Selecting just what you indicated and also all x64:
Screenshot_1.png
Screenshot_1.png (9.7 KiB) Viewed 2157 times

Selecting All Formats:
Screenshot_11.png
Screenshot_11.png (9.27 KiB) Viewed 2157 times

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 28 Jul 2019, 15:45
by HotKeyIt
Are you also executing CleanUpAndPack.exe afterwards? If so then you will have to compile the dlls too!
So select MT_Release + MT_ReleaseDll + MT_ReleaseDllMini (not the mbcs!!!).

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 28 Jul 2019, 16:10
by manehscripts
HotKeyIt wrote:
28 Jul 2019, 15:45
Are you also executing CleanUpAndPack.exe afterwards? If so then you will have to compile the dlls too!
So select MT_Release + MT_ReleaseDll + MT_ReleaseDllMini (not the mbcs!!!).
Yes, I'm running the CleanUpAndPack.exe, but for me it only works when the final file gets 2.448kb, and it doesn't if I don't select ALL. I've tried several combinations and the final file is never the correct size.
Screenshot_2.png
Screenshot_2.png (26.2 KiB) Viewed 2142 times
Screenshot_3.png
Screenshot_3.png (6.12 KiB) Viewed 2142 times

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 31 Jul 2019, 18:50
by manehscripts
I found a solution. I compile by selecting all the options, then later I just mark the x64 and it works.

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 09 Dec 2019, 00:21
by guest3456
i just followed the steps for this right now, with the latest AHK_H commit on master v1 branch:
973709968f5698c1f95f95d28e94e897be1780ec
Nov 29, 2019
Fix bug for compressed scripts


here are my notes after following the first post in this thread:

1.1) i never got the Retarget Projects popup when opening the .sln file.. i guess maybe the latest AHK_H doesn't need it anymore?
but, that means that i dont have an SDK number to save for Step 1.3

1.3) in fact, i dont have any of these folders: 'C:\Program Files (x86)\Windows Kits\10\Include\HERE GOES THE VERSION\shared';
i dont have ..\Windows Kits\10\Include\... i only have '..\Windows Kits\10\ExtensionSDKs\...'
and i know i checked the correct boxes to install in step 1

1.4) $(LibraryPath); was already added so i didnt have to touch these

1.5) the OP only shows 4 configs to build: Release, ReleaseDll, ReleaseDllMini, SelfContained. BUT, really you also have to build the corresponding (mbcs) for all of them too (which is the config for Win32a ansi), and then you ALSO need to build all of the MT_ variants too. otherwise, in the next step 1.6, CleanUpAndPack will complain when it can't find the ansi or MT files. (actually, i think you can skip x64 configs for mbcs, because i believe the x64 builds only support unicode)

everything builds successfully for me despite not adding the SDK lib dirs above.

2.1) i'm seeing 8 references for g_default_pwd now, not 6
2.5) similarly, its now the 8th (last) reference (not 6th) where you change the pw and can change the index offsets


thanks @kyuuuri for the guide




Ahk2Exe:

important: when you want to compile your ahk script, you must Run the Ahk2exe script with the same AHK executable type as you plan on compiling with the base file. for example, if you run Ahk2exe with Ansi version of AHK, but then you choose win32w (unicode) for your base file, the resulting .exe won't open with error "the variable name contains an invalid char". its likely because it needs the pw as a unicode string not ansi. and vice versa

Re: [Guide] Compiling Ahk_h's source step by step

Posted: 15 Jan 2020, 19:16
by kyuuuri
Hello people!, I'm planning on updating this guide but I'm a little busy. I will need to setup a fresh win10 installation in the near future so I will try then. @HotKeyIt is there any possibility to make the cleanUpAndPack.ahk work without the need to compile all versions? (Right now if you do not compile all versions [x64w, x86w, x86A] it will complain and fail).