Upcoming Ahk2Exe Changes (2024)

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Upcoming Ahk2Exe Changes (2022)

Post by Drugwash » 07 May 2022, 20:21

An Edit field can react to changes through its g-label so theoretically the checks can be performed automatically when text is pasted - or typed - into the field.
It would be a pity not to have this functionality especially where navigating to certain paths can be somewhat difficult. But it's your call.
Part of my AHK work can be found here.

User avatar
RaptorX
Posts: 368
Joined: 06 Dec 2014, 14:27
Contact:

Re: Upcoming Ahk2Exe Changes (2022)

Post by RaptorX » 10 May 2022, 20:11

Hi guys,

I just want to report on something that is happening with the latest version of Ahk2Exe and vscode extensions that use the compile funcitonality.

When using version Ahk2Exe v1.1.34.00_Beta_9c I was able to use Ctrl+Shift+F9 with vscode to compile a script without any prompts.
After Ahk2Exe v1.1.34.00a When using the above hotkey, I get the AHK2Exe window.

I took a quick look at the code and I dont see any obvious changes that might relate to that. Any info on why this might be happening?

Both Ahk2Exe v1.1.34.00a and Ahk2Exe v1.1.34.01 have the same issue, but reinstalling Ahk2Exe v1.1.34.00_Beta_9c fixes it.
Projects:
AHK-ToolKit

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 10 May 2022, 21:17

@RaptorX Thanks for letting us know. This appears to be a bug in AutoHotkey v1.1.34+ and I have raised a bug report.

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

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 12 May 2022, 18:13

@RaptorX This problem should be fixed in AutoHotkey v1.1.34.02.

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

User avatar
RaptorX
Posts: 368
Joined: 06 Dec 2014, 14:27
Contact:

Re: Upcoming Ahk2Exe Changes (2022)

Post by RaptorX » 13 May 2022, 09:14

Saw the update, will be testing soon. Thanks!
Projects:
AHK-ToolKit

User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2022)

Post by JoeWinograd » 16 May 2022, 10:41

Hi @TAC109,

I've been using ScriptGuard2 successfully with my 32-bit compiles for quite a while. I hadn't compiled in the last couple of weeks and when I tried today with 1.1.34.02, I received the following:

ScriptGuard2 failure.png
ScriptGuard2 failure.png (5.87 KiB) Viewed 3861 times

Nothing in my BinMod.exe /ScriptGuard2 statement has changed recently, so I decided to try with 1.1.34.01, which produced the same error, and then 1.1.34.00, which also produced the same error. I then tried 1.1.33.11, which worked perfectly (with no change to the BinMod.exe /ScriptGuard2 statement). So, the summary is that ScriptGuard2 fails in all 1.1.34 releases and works in 1.1.33.11, and probably all 1.1.33 releases, as I don't recall any prior failures. Please let me know if you can reproduce this problem and/or if I can do anything to help you troubleshoot it. Cheers, Joe

Edit: Another data point for you. The 1.1.33.11 compiler works with 1.1.34.02 AHK. To be clear, in a standard install, with 1.1.34.02 in the root of c:\Program Files\AutoHotkey\ and 1.1.33.11 in the subfolder c:\Program Files\AutoHotkey\Compiler\, I do not get the /ScriptGuard2 error. Regards, Joe

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 16 May 2022, 18:37

Hi @JoeWinograd

Unfortunately ScriptGuard is not totally compatible with AutoHotkey v1.1.34+. I’ve some plans to upgrade ScriptGuard to cater for the new facilities in v1.1.34 but these are not ready yet.

You can still use the current version of ScriptGuard with the latest AutoHotkey and Ahk2Exe, but you will need to use v1.1.33.11 of the appropriate *.bin file as the Base file for the compile. This should not cause a problem unless your script uses new or fixed facilities in the later versions of AutoHotkey.

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

User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2022)

Post by JoeWinograd » 16 May 2022, 20:05

Hi @TAC109,
Unfortunately ScriptGuard is not totally compatible with AutoHotkey v1.1.34+.
Thanks for confirming that.
I’ve some plans to upgrade ScriptGuard to cater for the new facilities in v1.1.34 but these are not ready yet.
When the upgrade is ready, I'll be happy to beta test it for you if you'd like.
You can still use the current version of ScriptGuard with the latest AutoHotkey and Ahk2Exe, but you will need to use v1.1.33.11 of the appropriate *.bin file as the Base file for the compile.
Thanks for letting me know that. Just tested on a 32-bit compile...worked perfectly!

Regards, Joe

aaffe
Posts: 192
Joined: 16 Jan 2014, 04:23

Re: Upcoming Ahk2Exe Changes (2022)

Post by aaffe » 30 May 2022, 04:48

hy Tac109, could you please have a look here?

viewtopic.php?f=6&t=16061&p=464996&hilit=ahk2exe#p464996

I would need to perform a post-build-step after the compiled exe really exists. Is this possible?

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 03 Jul 2022, 18:29

Update - 1.1.34.03a, 04 July 2022
  • AutoHotkey Version Info is removed from compiled .exe.
  • Apparently invalid Base files may optionally be used.
See this post for download details.
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

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 04 Jul 2022, 20:12

Update - 1.1.34.03b, 05 July 2022
  • Skip duplicate Base files by default.
See this post for download details.
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
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2022)

Post by JoeWinograd » 04 Jul 2022, 21:05

TAC109 wrote:Update - 1.1.34.03b, 05 July 2022
Hi TAC,
Will this release solve the problem of using ScriptGuard with AHK 1.1.34? Thanks, Joe

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 04 Jul 2022, 21:22

@JoeWinograd
No, sorry. The ScriptGuard enhancement will happen in BinMod, but it is still a way off yet.

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

User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2022)

Post by JoeWinograd » 05 Jul 2022, 01:10

OK, no worries, the work-around you provided is fine. Cheers, Joe

toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Upcoming Ahk2Exe Changes (2022)

Post by toralf » 21 Jul 2022, 01:11

I'm having problems to set the mainicon.
I tried the "custom Icon" option in the AHK2EXE GUI and the ;@Ahk2Exe-SetMainIcon directive.
In both cases the file still has the "green H" icon in the windows browser.
If I use Menu, Tray, Icon with the same ico file, the tray icon and the guis have the changed icon. Hence, the ico file works in general.
the ico file contains several different sized versions of the icon.

Are there any special requirements for the ico file for the mainicon?
Or
what am I doing wrong?

EDIT:
I tried it with a ahk file that only contains the ;@Ahk2Exe-SetMainIcon directive, and the resulting exe has the new icon in the windows explorer. Hence it should work in general.
I then checked the icons ind the exe with an old script of mine (IconViewer Light), and it shows that the exe has the new icons as their first group. In the file selection dialog of the IconViewer Light the exe also shows the new icon. But the exe still shows the "green H" in the windows Explorer. Is there a way to "refresh" the windows explorer?
When I change the destination file name to be a previously not existing file name the exe now has the new icon. :)
Hence, it seems to me that the icon is cached somewhere (registry?). Is there a way to reset/refesh this cache?
ciao
toralf

TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2022)

Post by TAC109 » 21 Jul 2022, 01:47

Yes, Windows caches the file icons when they are first read, and doesn’t detect when a file's icon has changed. If you reboot your computer, or log off then log on again the icons will be refreshed and the new icon will be shown. (I am not aware of any quicker method, sorry.)

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

User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Upcoming Ahk2Exe Changes (2022)

Post by jNizM » 21 Jul 2022, 06:25

toralf wrote:
21 Jul 2022, 01:11
it seems to me that the icon is cached somewhere (registry?). Is there a way to reset/refesh this cache?
TAC109 wrote:
21 Jul 2022, 01:47
I am not aware of any quicker method

Code: Select all

EnvGet, LocalAppData, LocalAppData                                       ; get the %localappdata% path
RunWait taskkill /F /IM explorer.exe                                     ; stop all explorer.exe instances
FileDelete % LocalAppData "\Microsoft\Windows\Explorer\iconcache*.db"    ; delete the user's hidden IconCache.db files
RunWait Explorer.exe                                                     ; restart explorer
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile

toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Upcoming Ahk2Exe Changes (2022)

Post by toralf » 21 Jul 2022, 07:02

Thanks ya'll,
May I suggest to add this info to the manual for ;@Ahk2Exe-SetMainIcon [IcoFile]. e.g.
Overrides the custom EXE icon used for compilation. (To change the other icons, see the AddResource example.) This directive may be overridden by an icon file specified in the GUI or CLI. The new icon might not be immediatly visible in the windows explorer if the compiled file existed before with a different icon. After a restart of the computer the new icon will be shown.
Another question: Would it be possible to add a ;@Ahk2Exe-Compress directive, to set the Compression if mpress or upx are available?
ciao
toralf

toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Upcoming Ahk2Exe Changes (2022)

Post by toralf » 21 Jul 2022, 07:06

In the compressed (mpress) file the manifest has the text name="AutoHotkey" is there a way to change this with BinAHK?
ciao
toralf

User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2022)

Post by joedf » 21 Jul 2022, 09:25

jNizM wrote:
21 Jul 2022, 06:25
toralf wrote:
21 Jul 2022, 01:11
it seems to me that the icon is cached somewhere (registry?). Is there a way to reset/refesh this cache?
TAC109 wrote:
21 Jul 2022, 01:47
I am not aware of any quicker method

Code: Select all

EnvGet, LocalAppData, LocalAppData                                       ; get the %localappdata% path
RunWait taskkill /F /IM explorer.exe                                     ; stop all explorer.exe instances
FileDelete % LocalAppData "\Microsoft\Windows\Explorer\iconcache*.db"    ; delete the user's hidden IconCache.db files
RunWait Explorer.exe                                                     ; restart explorer
+1

Other options to try as well:
https://superuser.com/a/499079/122864
ie4uinit.exe -show or ie4uinit.exe -ClearIconCache
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Post Reply

Return to “Scripts and Functions (v1)”