Help with compiling a V2 script.

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Barnaby Ray
Posts: 45
Joined: 09 Nov 2021, 07:48

Help with compiling a V2 script.

18 Mar 2022, 16:21

Hi, I'm sorry if this has been covered somewhere else, but I've been searching for hours and I'm not getting anywhere.

I can't figure out how to compile a V2 script?

I've basically made a big script in the latest V1, and it is all working perfectly. I've been sharing this script with a few people at work, and up until now, I've been telling them to download the image files needed for the gui buttons, and telling them where to install them etc.
To make sharing it easier, I started making an installer script with V1, using FileCreateDir to include the images in the compiled exe file, I found that the script worked fine until I compiled it, and that the images were not included in the compiled script.
After reading about it all day, it seems that this is a known issue, and that the only way to do it, would be to make the installer script with V2.

I've downloaded the latest v2 zip file, and managed to get a simple test script to work in v2.. this is my test script...

Code: Select all

#SingleInstance Force

DirCreate("C:\MyDocuments\AutoBarn 1.9.6\Images")

FileInstall("01. Red.png", "C:\MyDocuments\AutoBarn 1.9.6\Images\01. Red.png", 1)

ESC::ExitApp()
So, it works.. I can open and run it in V2, but I can't find anywhere how to compile it? I've found various links to download this file, https://github.com/AutoHotkey/Ahk2Exe/releases/tag/Ahk2Exe1.1.34.00_Beta_9b , but my computer keeps blocking the download for virus protection. I turned off all my protection to download it, but I'm still not sure what to do with it :/

Would anyone be able to tell me what I need to download, and then what to do with the files please?
TAC109
Posts: 1121
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Help with compiling a V2 script.

18 Mar 2022, 17:37

Ahk2Exe v1.1.34.00_beta_9b is the correct version to use. Just follow the instructions here to install it.

When you compile your v2 script select a version 2 base file (AutoHotkey32.exe or AutoHotkey64.exe) and this will give you the appropriate compiled .exe.

It would also be helpful to other users if you could report the false positive to your antivirus vendor.

Edit: The same beta 9b version of Ahk2Exe also compiles version 1 scripts and fixes a few bugs in the version distributed with AutoHotkey 1.1.33.10. This includes fixing a FileInstall bug, so it may not be necessary to convert your script to version 2 unless you particularly want to. (See the fixes described at the above link.)
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Help with compiling a V2 script.

20 Mar 2022, 12:57

Hi Tac, VirusTotal shows:
"39 security vendors and no sandboxes flagged this file as malicious"
I have never seen so many false positives on VirusTotal before.
Please check if the download "Ahk2Exe v1.1.34.00_Beta_9b" is corrupted.
TAC109
Posts: 1121
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Help with compiling a V2 script.

20 Mar 2022, 20:01

I have checked the download of Ahk2Exe v1.1.34.00_Beta_9b and there is no corruption in the download. It is identical to the version I uploaded originally.

I have submitted a 'false positive' report to Microsoft so that this can be corrected. We will see what happens.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Giresharu, Noitalommi_2 and 55 guests