Jump to content

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

Upcoming Ahk2Exe changes


  • This topic is locked This topic is locked
78 replies to this topic
evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

So there could be a bug that only manifests in a compiled version?

The only branch in my code that differs from compile to ahk version is the bit that strips the suffix from the file name to generate the INI name.

Everyone can run the ahk version just fine.

 

 

 

I am 99% sure that your psychic powers are accurate - I had a hunch that it was something to do with UAC, and the game concerned does indeed run as admin. Some users also reported they could get the app to type keys in notepad, but not in game, which would corroborate this theory.

 

 

I will take a look at the link you posted, but I do not think it is appropriate in this case.



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
What OS are you on? If you have XP or earlier this issue does not happen because XP has a lot less security than Vista+.

It is very unlikely that the problem lies in the compiling process (that is, issues would show up when the script is compiled).

sumon
  • Moderators
  • 1317 posts
  • Last active: Dec 05 2016 10:14 PM
  • Joined: 18 May 2010

I am amazed, great changes! Will try out the resource include option, it might prove to be the by far least obtrusive (to the user) and easiest (to me) way to include resources in a compiled script.



AnAHKUser
  • Members
  • 32 posts
  • Last active: Aug 12 2013 10:12 PM
  • Joined: 05 Feb 2007

This is just great! Thank you fincs grin.png



joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Nov 02 2019 08:38 PM
  • Joined: 20 May 2012
Yay add a Help into Ahk2Exe! That would be great! Or the Help file?! :D
Why ahkscript.org? - autohotkey.com is outdated

gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Awesome additions, thanks!
Version info is great
Adding resources is great
any possibility of either directive or command line param for other SC.bin file?
In my Compile() function (which just runs ahk2exe) i copy and replace the SC.bin but would prefer to let that file stay untouched, but compile with a specific .bin

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
gwarble, the /bin command line switch has been around since before fincs rewrote the compiler. It's shown in the manual.

gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Thanks, never saw that with basic and dont think i ever realized additions were made (i dont usually run the ui)
Perfect... should be easier to compile 32/64 combos...
There's an mpress option too :)

gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
So minor request would be a -DeleteResource or Replace directive... clearly not as necessary but sometimes i remove extra icons or all resources

More importantly, the other half of being able to add resources is to use them, ideally in memory, or just extract to disk. This isn't a request, and while i'm not smart enough to figure out most of it, i just got using a wav resource working with help from Skan (which after figuring out fileinstall tricks led me to this thread, glad to be able to add resources to types!)

i then, searching around, found out he basically gave the solution years ago... so to help people utilize these directives, this old thread has lots of info (hope it doesnt go missing like other old threads seem to):
http://www.autohotke...e-2#entry139406

And much of this general info applies, including Skan's last reply to my question which explains the way to load from the already loaded module, thus allowing compression (mpress, upx):
http://www.autohotke...ummies-36l-v07/

ResRead() can easily be expanded to read from different resource types, write to disk or memory for use as skan demonstrates...

emmanuel d
  • Members
  • 519 posts
  • Last active: Jul 15 2017 12:04 PM
  • Joined: 29 Jan 2009

Is it possible to implement variables, at least the build in ones?

This is how you can do it:

#SingleInstance Force ;[force|ignore|off]
BuildInVariables:="A_AhkPath|A_AhkVersion|A_AppData|A_AppDataCommon|A_AutoTrim|A_BatchLines|A_CaretX|A_CaretY|A_ComputerName|A_ControlDelay|A_Cursor|A_DD|A_DDD|A_DDDD|A_DefaultMouseSpeed|A_Desktop|A_DesktopCommon|A_DetectHiddenText|A_DetectHiddenWindows|A_EndChar|A_EventInfo|A_ExitReason|A_FormatFloat|A_FormatInteger|A_Gui|A_GuiControl|A_GuiControlEvent|A_GuiEvent|A_GuiHeight|A_GuiWidth|A_GuiX|A_GuiY|A_Hour|A_IconFile|A_IconHidden|A_IconNumber|A_IconTip|A_Index|A_IPAddress1|A_IPAddress2|A_IPAddress3|A_IPAddress4|A_ISAdmin|A_IsCompiled|A_IsCritical|A_IsPaused|A_IsSuspended|A_KeyDelay|A_Language|A_LastError|A_LineFile|A_LineNumber|A_LoopField|A_LoopFileAttrib|A_LoopFileDir|A_LoopFileExt|A_LoopFileFullPath|A_LoopFileLongPath|A_LoopFileName|A_LoopFileShortName|A_LoopFileShortPath|A_LoopFileSize|A_LoopFileSizeKB|A_LoopFileSizeMB|A_LoopFileTimeAccessed|A_LoopFileTimeCreated|A_LoopFileTimeModified|A_LoopReadLine|A_LoopRegKey|A_LoopRegName|A_LoopRegSubkey|A_LoopRegTimeModified|A_LoopRegType|A_MDAY|A_Min|A_MM|A_MMM|A_MMMM|A_Mon|A_MouseDelay|A_MSec|A_MyDocuments|A_Now|A_NowUTC|A_NumBatchLines|A_OSType|A_OSVersion|A_PriorHotkey|A_ProgramFiles|A_Programs|A_ProgramsCommon|A_ScreenHeight|A_ScreenWidth|A_ScriptDir|A_ScriptFullPath|A_ScriptName|A_Sec|A_Space|A_StartMenu|A_StartMenuCommon|A_Startup|A_StartupCommon|A_StringCaseSense|A_Tab|A_Temp|A_ThisFunc|A_ThisHotkey|A_ThisLabel|A_ThisMenu|A_ThisMenuItem|A_ThisMenuItemPos|A_TickCount|A_TimeIdle|A_TimeIdlePhysical|A_TimeSincePriorHotkey|A_TimeSinceThisHotkey|A_TitleMatchMode|A_TitleMatchModeSpeed|A_UserName|A_WDay|A_WinDelay|A_WinDir|A_WorkingDir|A_YDay|A_YEAR|A_YWeek|A_YYYY|Clipboard|ClipboardAll|ComSpec|ErrorLevel|False|ProgramFiles|True"
command:=";@Ahk2Exe-SetCopyright © %A_YYYY%`, Emmanuel D" ; the example
msgbox,%command%
Loop,Parse,BuildInVariables,|
	StringReplace,command,command,`%%A_LoopField%`%,% %A_LoopField%,1 ;Dynamicaly resolve builtin variables
msgbox,%command%

You may use it if it helps you


Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license

http://www.ahkscript.org/ the new forum


Hamlet
  • Members
  • 302 posts
  • Last active: Mar 23 2014 03:37 PM
  • Joined: 22 Jan 2009

Thanks !!

감사합니다 !!

 

 

 

Especially I like this part.

>Ability to remove code sections from the compiled script

 

 

The size of one of my script is 1MB.

 

The final exe file was more than 1MB.

But, Now I can make it just 793KB.

 

B.r.i.l.l.i.a.n.t.e....



ocifant
  • Members
  • 4 posts
  • Last active: Sep 11 2015 01:19 PM
  • Joined: 20 Sep 2013

I'm slightly confused. 

 

The version of AHK2EXE that I received with my original download a couple of weeks ago is reported as 1.1.13.00 - this version seems to ignore the compiler directives for setting Version, Descritpion etc. 

 

The version downloaded from this thread is reported as 1.1.11.01, which suggests it's older. But this does obey the directives. 

 

Is 1.1.13.00 broken, or are the version numbers out of sync? Can someone explain please? I'm happy to use the 11.01 version for now, it meets my simple needs wink.png



SAPlayer
  • Members
  • 403 posts
  • Last active: Apr 11 2014 04:45 PM
  • Joined: 06 Nov 2012

The compiler isn't yet part of the official AHK version.

It is version 1.1.11.01, because it was compiled with it, and it should work with every AHK version since 1.1, so there is no need to recompile it every time a new version is released.



ocifant
  • Members
  • 4 posts
  • Last active: Sep 11 2015 01:19 PM
  • Joined: 20 Sep 2013

Great, thanks for the explanation, I hoped it was something like that...



joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Nov 02 2019 08:38 PM
  • Joined: 20 May 2012

Is it possible to implement variables, at least the build in ones?
This is how you can do it:

#SingleInstance Force ;[force|ignore|off]
BuildInVariables:="A_AhkPath|A_AhkVersion|A_AppData|A_AppDataCommon|A_AutoTrim|A_BatchLines|A_CaretX|A_CaretY|A_ComputerName|A_ControlDelay|A_Cursor|A_DD|A_DDD|A_DDDD|A_DefaultMouseSpeed|A_Desktop|A_DesktopCommon|A_DetectHiddenText|A_DetectHiddenWindows|A_EndChar|A_EventInfo|A_ExitReason|A_FormatFloat|A_FormatInteger|A_Gui|A_GuiControl|A_GuiControlEvent|A_GuiEvent|A_GuiHeight|A_GuiWidth|A_GuiX|A_GuiY|A_Hour|A_IconFile|A_IconHidden|A_IconNumber|A_IconTip|A_Index|A_IPAddress1|A_IPAddress2|A_IPAddress3|A_IPAddress4|A_ISAdmin|A_IsCompiled|A_IsCritical|A_IsPaused|A_IsSuspended|A_KeyDelay|A_Language|A_LastError|A_LineFile|A_LineNumber|A_LoopField|A_LoopFileAttrib|A_LoopFileDir|A_LoopFileExt|A_LoopFileFullPath|A_LoopFileLongPath|A_LoopFileName|A_LoopFileShortName|A_LoopFileShortPath|A_LoopFileSize|A_LoopFileSizeKB|A_LoopFileSizeMB|A_LoopFileTimeAccessed|A_LoopFileTimeCreated|A_LoopFileTimeModified|A_LoopReadLine|A_LoopRegKey|A_LoopRegName|A_LoopRegSubkey|A_LoopRegTimeModified|A_LoopRegType|A_MDAY|A_Min|A_MM|A_MMM|A_MMMM|A_Mon|A_MouseDelay|A_MSec|A_MyDocuments|A_Now|A_NowUTC|A_NumBatchLines|A_OSType|A_OSVersion|A_PriorHotkey|A_ProgramFiles|A_Programs|A_ProgramsCommon|A_ScreenHeight|A_ScreenWidth|A_ScriptDir|A_ScriptFullPath|A_ScriptName|A_Sec|A_Space|A_StartMenu|A_StartMenuCommon|A_Startup|A_StartupCommon|A_StringCaseSense|A_Tab|A_Temp|A_ThisFunc|A_ThisHotkey|A_ThisLabel|A_ThisMenu|A_ThisMenuItem|A_ThisMenuItemPos|A_TickCount|A_TimeIdle|A_TimeIdlePhysical|A_TimeSincePriorHotkey|A_TimeSinceThisHotkey|A_TitleMatchMode|A_TitleMatchModeSpeed|A_UserName|A_WDay|A_WinDelay|A_WinDir|A_WorkingDir|A_YDay|A_YEAR|A_YWeek|A_YYYY|Clipboard|ClipboardAll|ComSpec|ErrorLevel|False|ProgramFiles|True"
command:=";@Ahk2Exe-SetCopyright © %A_YYYY%`, Emmanuel D" ; the example
msgbox,%command%
Loop,Parse,BuildInVariables,|
	StringReplace,command,command,`%%A_LoopField%`%,% %A_LoopField%,1 ;Dynamicaly resolve builtin variables
msgbox,%command%

You may use it if it helps you

 

 
i like that suggestion.
 
Also, would it be possible to add a "compile as console appilcation"
Here is a script by Lexikos, that does that.

Spoiler

 

Thank you. ;)


Why ahkscript.org? - autohotkey.com is outdated