打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Compile
This thread is continued at

:arrow: http://www.autohotke...pic.php?t=22975

THX, ladiko and good luck!




Update on 2007-06-24:
Removed buggy version check for /NoDecompile


Update on 2007-03-24:
Support for AHK's 1.0.46.10 new compiler parameter /NoDecompile


Update on 2007-02-17:
Fixed bug on paths containing spaces



This thread was originally posted in the German Forum at http://de.autohotkey...topic.php?t=771. AGU was so kind to translate it, so it can be posted in the mother of forums now:

When I started to use AHK and AU3 I chose AU3 as my primary scripting language because I liked the syntax, the SciTe integration and some additional integrated functions which make your life easier. Then I had an AU3 tool which barely ran on my own Athlon 2600+ but had a response time of several seconds on the Celeron600 PCs at work in my company. So I started the difficult task and ported it to AHK and guess what - it ran like a charm even on those old machines. Since that time I used AU3 very rarely.

My tools/programs are always distributed as compiled Exe. That's why I always missed the AU3 option 'Compile with Options'. Additionally I recently discovered Thalons AHK Icon Changer and thought, if you want to have it, write it on your own. So I asked Thalon for permission to use his code and wrote the 'Compile_AHK' script:





What is it good for?

Compile_AHK handles all compiler options and version information within the script's own directory in a file named Scriptname.ahk.ini. Set once, they will be read out on every run, displayed and can finally be change at wish. After settings are done once all that changes during compiling is the displaying of the GUI and the need to press 'Return' one more time.

What do you need?

Download the Compile_AHK_Setup.exe from http://www.autohotke...e_AHK_Setup.zip. The setup includes Compile_AHK.exe, GoRC.exe and ResHacker.exe. They will be installed into your 'Compiler' subfolder of your Autohotkey installation folder. I chose that way instead of copying the files somewhere else and checking the paths by reading the registry every time of execution. Additionally the action "Compile with Option" can be added to the AHK files context menu for calling Compile_AHK easy. If you want to have a look before, you can find the Compile_AHK_Setup.ahk script at http://www.autohotke...e_AHK_Setup.ahk.

If you prefer to do it on your own, download the script fom at http://www.autohotke...Compile_AHK.ahk. After this you need GoRC.exe and the ResHacker.exe from http://www.autohotke...7121.html#77121. ResHacker.exe can be packed with UPX.exe --best Reshacker.exe if you like. After that you have to compile Compile_AHK.ahk. Copy Compile_AHK.exe, GoRC.exe and ResHacker.exe in your 'Compiler' subfolder of your Autohotkey installation folder.

Finally you may switch the calling of Ahk2Exe from within the editors to Compile_AHK.exe. Please pay attention that only /in parameter and the full script path will be passed over.

How does it work?

At first start and on every version change, the file AutoHotkeySC.bin will be saved within the 'Compiler' subfolder as AutoHotkeySC.bin.org. In order to enter the version information it will be recreated from the backup copy. After compiling it will be restored again.

Compiler options will be passed to Ahk2Exe.exe as commandline parameters if possible. Compression will be achieved by setting the registry value HKCU\Software\AutoHotkey\Ahk2Exe\LastCompression. Because Ahk2Exe automatically uses the LastIcon entry for the icon, it will be deleted before and after calling the GUI.

If "Set Version Info" is selected, the version info values are added temporary to AutoHotkeySC.bin by calling GoRC.exe and ResHacker.exe before compilation.

For the Run Before/After calls you may use the placeholders %IF%, %OF%, %OD% and %ON%. Before execution they will be replaced as:
%IF% = script file's full path, %OF% = exe file's full path, %OD% = exe file's directory, %ON% = exe file's name.


So give it a try! I hope, you'll like it!
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
AutoHotkey脚本右键菜单关联工具V1.0.4 绿色版软件下载
Autohotkey实例分享
autoit入门教程小结第25页
AutoIT3 vs AutoHotkey
[转载]AutoHotkey显示中文字符_每天都在改变命运中
AutoHotkey SyntaxHighlight for Notepad++ (ahk notepad++语法高亮)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服