Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Compile_AHK II - for those who compile!


  • Please log in to reply
467 replies to this topic
DeWild1
  • Members
  • 369 posts
  • Last active: Feb 28 2014 08:15 PM
  • Joined: 30 Apr 2006
Got a new Vista laptop for xmas, (all our other Vista's have been molested), so with fresh Vista, default UAC, permissions, etc, I only got this, Posted Image durring install, I reinstalled using recomended, then all seems well, compiled, ran, no problem. I am not sure what they are talking about but if you need me to test something, I can.

bmcclure
  • Members
  • 774 posts
  • Last active: Jan 04 2014 10:44 PM
  • Joined: 24 Nov 2007
The problem I have with UAC enabled on my Vista machine (not positive yet whether the problem exists without UAC) is that my standard library functions from My Documents\AutoHotKey\Lib are not included in the compiled Exe as required, like they are with the standard compiler. I just get missing function errors for all stdlib functions that I call.

Other than that it works fine. But since I use a lot of library functions, this is a problem for me.

Clash
  • Members
  • 182 posts
  • Last active: Oct 26 2009 08:31 PM
  • Joined: 27 Jun 2006
It's been working ok for me but today my antivirus complained about it and now i get a message saying windows can't access the file.

Obviously it doesn't contain a virus but maybe a virus was written to infect this program?

I just tried to download it again and it looks like the uploaded version has possibly got a virus..

I ran the source and it says it can't write the the compiler folder. It's been made read only.

Hope my pc doesn't f up because of this :(

Edit: Eek you've shouted at people for bringing this up without searching. But anyway, The compiler that comes with ahk works, it's just this one that my av complains about.

Edit: I've turned my av off, uninstalled ahk, installed it and tried to install this compiler but it still won't work. So it's not my av.
Posted Image Posted Image

Trubbleguy
  • Members
  • 122 posts
  • Last active: Jan 15 2017 10:50 AM
  • Joined: 20 Jan 2007
Superbly done program, it is used easily up to 100 times a day, but needed auto increment setting in File Version boxes so my next post has the modded code.

I also notice that only the File Version Number lists when mouse hovers over a compiled file, shouldn't the number be actually a merge of :

%Product Version%.%File Version%

I'm not too up on what sized field the File Version is and it might not be possible anyway, just a thought and possible time saver.

Trubbleguy
  • Members
  • 122 posts
  • Last active: Jan 15 2017 10:50 AM
  • Joined: 20 Jan 2007
modded SUB code to Auto Increment Version
_SET_GUI_VERS()
{
	Global
	Local aVersion0
	If (!VERSION_INFO) {
		Return
	}
	StringSplit, aVersion, FILE_VER, `., %A_Space%
	Loop, %aVersion0%
	{
		GUI_FV%A_Index% := aVersion%A_Index%
	}
	StringSplit, aVersion, PRODUCT_VER, `., %A_Space%
	Loop, %aVersion0%
	{
		GUI_PV%A_Index% := aVersion%A_Index%
	}
	newver1 .= GUI_FV1 GUI_FV2 GUI_FV3 GUI_FV4    ;mod start
	newver1++
	newver1 := SubStr("0000" . newver1, -3) 
	loop 4
	GUI_FV%A_Index%:=SubStr(newver1,A_Index,1) ;mod finish
	Return
}



ladiko
  • Members
  • 290 posts
  • Last active: Jan 16 2012 11:46 PM
  • Joined: 13 Jul 2006
seems like i have to reed a little bit here. i'm confused cause i "watch" this topic but cant remember that i got a notification mail :?

here was an aditionall question about relative pathes:

<!-- m -->http://www.autohotke... ... 879#181879<!-- m -->

and here is the answer:
could you explain what you want to do exactly?

in the original post were some hints at the end and in the screenshots:
<!-- m -->http://www.autohotke...pic.php?t=14379<!-- m -->

thinks like %A_ScriptDir% could also work *untested*

ladiko
  • Members
  • 290 posts
  • Last active: Jan 16 2012 11:46 PM
  • Joined: 13 Jul 2006

Got a new Vista laptop for xmas, (all our other Vista's have been molested), so with fresh Vista, default UAC, permissions, etc, I only got this
Posted Image
durring install, I reinstalled using recomended, then all seems well, compiled, ran, no problem. I am not sure what they are talking about but if you need me to test something, I can.


i know this window, about 1/4 or 1/3 of all programs i installed on my vista notebook showed this window after installation. maybe it cause of the return value of the installer, normally it should be zero, dont ask me what the installer of compile_ahk return. you could test it:
start the installer from a command line window and after it finished, you execute: echo %errorlevel%
it should be different from zero, cause vista think something went wrong... but atm: ignore it, i had no case where this dialog pops up and the install fails. when an install fails, the installer itself told me whats wrong. for me this vista dialog is useless crap.

about the virus problem:
Compile_AHK_Setup.exe on <!-- w -->www.virustotal.com<!-- w -->:
Posted Image
like you see, one of the 5 antivirus programs call it a "autohotkey trojan" ... yes of course it is an autohotkey program and autohotkey programs can do everything that you code ... three other antivirus programs call it an autorun virus ... i cant find anything in my autoruns, but ok ... the name tells me that it is a really really bad virus - the "autorun virus" ... ^^ if you compile compile_ahk with the latest version of ahk, everything will be fine. i'm going to work a little bit on it the next 2 or 4 weeks and in this process it will be compiled with the newest autohotkey version. by the way; if you would create an ahk-file with only the work: return - it would be a virus in this cases above.

OrelseIamfired
  • Members
  • 65 posts
  • Last active: Jan 10 2013 01:18 AM
  • Joined: 13 Mar 2006
Hi ladico,

I should like to know if Compile_AHK handles relative paths for file names, i.e., relative to the script's directory.
Let us say that I have a script called wolf.ahk in this directory.
f:\thePathToGrandmothers\House\
Let us say that I have my icons in a subdirectory of the above, say icons\ (or even in the same directory as the script's).
f:\thePathToGrandmothers\House\icons
If one of my icons is bigEyes.ico, I should like to be able to specify a path relative to the script's, perhaps like this.
icons\bigEyes.ico
If the icon is in the same directory as the script's, then it might be something like this.
bigEyes.ico

I am in an environment where f:\thePathToGrandmothers varies. Does Compile_AHK currently handle relative paths?

/ Louis

ladiko
  • Members
  • 290 posts
  • Last active: Jan 16 2012 11:46 PM
  • Joined: 13 Jul 2006
i set it on the todo list. it follows right after an option for autoincrementing the version number. i think it will be done in 2 weeks in the worst case.

ladiko
  • Members
  • 290 posts
  • Last active: Jan 16 2012 11:46 PM
  • Joined: 13 Jul 2006
added auto incrementation as an option and compiled compile_ahk with autohotkey 1.0.47.5 and hoped there will be no virus alert for the next time, but there are still 3 programs claiming a virus and a new one claming a corrupt archive:

Posted Image

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

I have Vista Ultimate 64-bit, and am experiencing an issue with this. It doesn't seem to compile in the functions from my user lib directory which I use. They work in the uncompiled version, and if I compile with the AHK compiler, but I get errors when trying to use any lib function from an exe compiled with this script (because function doesn't exist). Any ideas?

"Wonderful" how you said "Vista" and everyone immediately assumed that was the problem. In fact, the problem is this:

The script compiler (ahk2exe) also supports library functions. However, it requires that a copy of AutoHotkey.exe exist in the directory above the compiler directory (which is normally the case). If AutoHotkey.exe is absent, the compiler still works but library functions are not automatically included.

Since Compile_AHK copies Ahk2Exe to some other directory, it can no longer find AutoHotkey.exe. Copying AutoHotkey.exe to the directory above Ahk2Exe would help. If the function library is located in Program Files (rather than My Documents), it must also be copied to Compile_AHK's data directory.

I would like to see a solution that does not require copying these files and does not require write access to the Compiler directory. Unfortunately, it seems necessary to add some new features to Ahk2Exe, such as a /bin option to use a custom AutoHotkeySC.bin file. I might do this myself next time I feel like working with C++... (Ahk2Exe is, of course, open source.)

ladiko
  • Members
  • 290 posts
  • Last active: Jan 16 2012 11:46 PM
  • Joined: 13 Jul 2006
in relation to this documentation: <!-- m -->http://www.autohotke...nctions.htm#lib<!-- m -->

i understand that the \lib folder has to be next to the used ahk2exe compiler but why do i also need the autohotkey.exe? oO

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Actually, the lib folder does not need to be next to the used Ahk2Exe compiler; it needs to be next to AutoHotkey.exe, which should be in the directory above Ahk2Exe. (For instance, "C:\Program Files\AutoHotkey\AutoHotkey.exe" versus "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe".) Ahk2Exe has no concept of functions, so it asks ..\AutoHotkey.exe to build it a list of auto-includes.

Alternatively, I suppose you could invoke AutoHotkey and manually add the includes to the script before passing it to the compiler.
RunWait, "%A_AhkPath%" /iLib "%temp_file%" "%script_file%"
/iLib "%temp_file%" tells AutoHotkey to write a list of #includes to %temp_file% and immediately exit.

ladiko
  • Members
  • 290 posts
  • Last active: Jan 16 2012 11:46 PM
  • Joined: 13 Jul 2006
thank you for the correction. :-)
the list is an option, but i dont want to change the user's scripts.

mandiom
  • Members
  • 34 posts
  • Last active: May 25 2008 05:12 PM
  • Joined: 03 Mar 2008
Hello and congratulations for the awesome script.

However, I have a small problem that I can really solve...

I have AutoHotKey installed in D:\Programs\Autohotkey

When I fired up your setup file, no files appeared in the D:\Programs\Autohotkey\Compiler folder. Nevertheless, the script seems to work with right-click... Moreover, a search for "AHK Compiler" did not return any results besides the original installation script.
So, my question is, what files should I remove - and where can I find them?

Thanks in advance for your support :)