@joedf @JoeWinograd
It’s possible that the extra icons can be replaced using the existing facilities in the beta (using 'AddResource'). That will simplify everything. If it works I will document this facility in the help.
I’ll look into it tomorrow NZ time!
Upcoming Ahk2Exe Changes (2024)
Re: Upcoming Ahk2Exe Changes (2019)
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
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
Re: Upcoming Ahk2Exe Changes (2019)
@@joedf @@JoeWinograd
Ok, here are the compiler directive details to replace the other icons in the generated .exe:This will work using the current beta.
As I said before, I'll document this facility in the help.
Ok, here are the compiler directive details to replace the other icons in the generated .exe:
Code: Select all
;@Ahk2Exe-AddResource Icon.ico, 160 ; Replaces 'H' on blue
;@Ahk2Exe-AddResource Icon.ico, 206 ; Replaces 'S' on green
;@Ahk2Exe-AddResource Icon.ico, 207 ; Replaces 'H' on red
;@Ahk2Exe-AddResource Icon.ico, 208 ; Replaces 'S' on red
As I said before, I'll document this facility in the help.
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
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
Re: Upcoming Ahk2Exe Changes (2019)
Very nice!
Maybe go one step further and have something like a macro
AhkIcon0 AhkIcon...
Or maybe thats too much... :b
Maybe go one step further and have something like a macro
AhkIcon0 AhkIcon...
Or maybe thats too much... :b
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]
Re: Upcoming Ahk2Exe Changes (2019)
Macro? Not sure what you’re getting at here?
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
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
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Perfect! I don't need anything more than that...works a charm! Thanks for figuring that out.here are the compiler directive details to replace the other icons in the generated .exe
However, there's a problem when selecting UPX compression. It works fine with no compression and with MPRESS. But with UPX, ResourceHacker shows only Group 159 in the EXE, and after creating a shortcut to the EXE and doing Properties>Change Icon on the shortcut, it displays a Change Icon dialog box that says this:
The file FileName.exe contains no icons.
Choose an icon from the list or specify a different file.
But I don't think that this is a bug in your code...I think it is a bug in UPX, because the same thing happens after compiling with no compression and then doing the UPX compression manually. Btw, I'm using the latest UPX (v3.95, 26-Aug-2018). Regards, Joe
Re: Upcoming Ahk2Exe Changes (2019)
I would think that's a feature, not a bug, assuming the resources can be loaded by the program itself. The main icon wouldn't be compressed because explorer needs to be able to load it. There's probably a command line switch to prevent compression of resources, but unless it applies specifically to icons, it would also prevent compression of the script text.
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Interesting point, but if the main icon is not compressed, why doesn't Properties>Change Icon on the shortcut file find it?I would think that's a feature, not a bug...
Re: Upcoming Ahk2Exe Changes (2019)
I’ll look into this tomorrow, @JoeWinograd
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
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
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Thanks, TAC! Cheers, Joe
Re: Upcoming Ahk2Exe Changes (2019)
My bad, I was thinking "C Preprocessor -> Macros"-like... but I realize it was out of context ahah
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]
Re: Upcoming Ahk2Exe Changes (2019)
@JoeWinograd
You could try adding the switch --compress-icons=0 to your externally run UPX job. (You may also use the switches -q --all-methods which are used by Ahk2Exe.)
Let me know how it works out.
Cheers
You could try adding the switch --compress-icons=0 to your externally run UPX job. (You may also use the switches -q --all-methods which are used by Ahk2Exe.)
Let me know how it works out.
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
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
Re: Upcoming Ahk2Exe Changes (2019)
Note:
With UPX (unlike Mpress) it is trivial to decompress a UPX packed executable; simply run UPX on it with the -d switch.
With UPX (unlike Mpress) it is trivial to decompress a UPX packed executable; simply run UPX on it with the -d switch.
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
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
Re: Upcoming Ahk2Exe Changes (2019)
Compression is not necessarily used for code/resources obfuscation - it saves bandwidth and/or storage space, especially when there are many files to transfer/store and bandwidth is limited or free space is scarce.
What compression level is being used by the compiler for UPX? There are five levels available AFAIK. Dunno the difference between them but it may (or may not) have something to do with the compression of icons discussed above.
In my tests compressed executables (both UPX and MPRESS) appear as corrupted under my Linux Mint so I can't perform any related checks.
What compression level is being used by the compiler for UPX? There are five levels available AFAIK. Dunno the difference between them but it may (or may not) have something to do with the compression of icons discussed above.
In my tests compressed executables (both UPX and MPRESS) appear as corrupted under my Linux Mint so I can't perform any related checks.
Part of my AHK work can be found here.
Re: Upcoming Ahk2Exe Changes (2019)
@Drugwash
UPX parameters are -q --all-methods as mentioned above. No level is used. I have found that the parameters I have used give the best compression for only a little extra elapsed time.
UPX parameters are -q --all-methods as mentioned above. No level is used. I have found that the parameters I have used give the best compression for only a little extra elapsed time.
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
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
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Thanks for the explanation of the UPX switches (especially -d, which I was not aware of), but I haven't tried them, as I decided to stick with MPRESS, which I've been using for a long time and is working well with AddResource (for the icons) in Beta_7.TAC109 wrote:Let me know how it works out.
Speaking of MPRESS and UPX, I'll make one more pitch for changing the UI to a drop-down, although I realize you said that the checkbox is your preferred method of implementing this feature. In my case, I clicked the box expecting an on-off check mark with the text showing what was on or off, i.e., MPRESS, UPX, or no compression. But I (admittedly, soon) figured out that the UI is a check mark in the box when the text is MPRESS (if present), a blue square in the box when the text is UPX (if present), and nothing in the box when the text is (none). I believe that the far more conventional (and obvious) approach is a drop-down, exactly like the Base File drop-down above it. Of course, the choice is yours, and whichever way you go, I truly appreciate your effort on these enhancements.
True enough, although my primary purpose is code obfuscation, limited though it be, as I know that there are MPRESS crackers out there, so it isn't going to stop all the bad actors, but it's better than nothing.Drugwash wrote:Compression is not necessarily used for code/resources obfuscation - it saves bandwidth and/or storage space, especially when there are many files to transfer/store and bandwidth is limited or free space is scarce.
Regards, Joe
Re: Upcoming Ahk2Exe Changes (2019)
Ah, OK, thank you.
Obviously compression can be used for any available purpose, including mixed ones.JoeWinograd wrote: ↑22 Oct 2019, 11:09True enough, although my primary purpose is code obfuscation [...]
The checkbox type you're mentioning is a special tri-state one. Technically it's a nice gimmick but indeed it can be less intuitive for those unaccustomed to it. Additionally I noticed that in my Linux Mint, when theming is enabled in Wine, the tri-state checkbox does not properly show the third state - only the changed text offers a hint of its state. So from this point of view I could agree with your request to have it changed to a dropdown list. But I guess the developer also has the right to stick to his choice. So in the end we all may either accept developer's choice(s) or fork the script locally and modify it to our own liking. That's the beauty of open-source, and then we could all be happy.
Part of my AHK work can be found here.
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Hi Drugwash,
Thanks for the "tri-state checkbox" terminology...hadn't heard that one. I don't recollect ever seeing any in programs that I use, but I guess it's possible, because you don't know that it's a tri-state checkbox unless you click on it...or the doc discusses it...and, in the latter case, you've read it. I see that as a big advantage of the drop-down...you immediately know that other choices are available (and, of course, radio buttons, where all the choices are always exposed). Regards, Joe
Thanks for the "tri-state checkbox" terminology...hadn't heard that one. I don't recollect ever seeing any in programs that I use, but I guess it's possible, because you don't know that it's a tri-state checkbox unless you click on it...or the doc discusses it...and, in the latter case, you've read it. I see that as a big advantage of the drop-down...you immediately know that other choices are available (and, of course, radio buttons, where all the choices are always exposed). Regards, Joe
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Hi TAC,
I don't know if these are bugs, but here are two issues that I ran into today:
(1) If you compile the same file twice with the Beta_7 GUI while specifying a custom icon, the EXEs created are not identical. With the released Ahk2Exe GUI, they are indentical. Two interesting points on this: (a) with the Beta_7 CLI, they are indentical; (b) with the default icon, they are identical with the GUI. I would normally provide a script that shows the issue, but I'm sure you can reproduce it there, as it happens with a one-line MsgBox script and any custom icon.
(2) The Browse-to files (Source, Destination, Custom Icon) are not sticky in the Beta_7 GUI. They are in the released Ahk2Exe GUI. Again, I'm sure you can reproduce it there easily.
Regards, Joe
I don't know if these are bugs, but here are two issues that I ran into today:
(1) If you compile the same file twice with the Beta_7 GUI while specifying a custom icon, the EXEs created are not identical. With the released Ahk2Exe GUI, they are indentical. Two interesting points on this: (a) with the Beta_7 CLI, they are indentical; (b) with the default icon, they are identical with the GUI. I would normally provide a script that shows the issue, but I'm sure you can reproduce it there, as it happens with a one-line MsgBox script and any custom icon.
(2) The Browse-to files (Source, Destination, Custom Icon) are not sticky in the Beta_7 GUI. They are in the released Ahk2Exe GUI. Again, I'm sure you can reproduce it there easily.
Regards, Joe
Re: Upcoming Ahk2Exe Changes (2019)
@JoeWinograd
Thanks, I’ll check it out.
Thanks, I’ll check it out.
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
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
Re: Upcoming Ahk2Exe Changes (2019)
@JoeWinograd
Joe, I cannot reproduce your point 1. Compiling using the GUI without reloading between compiles gives identical .exe's here. I used the same icon both times.
Your point 2. The path and name of the custom icon sticks here, between successive loads of the GUI and also successive runs of the GUI.
With the source parameter, only the path should remembered between successive loads, and my tests confirm that this happens.
I’ll need to look further at the destination parameter as it doesn’t seem to stick in an expected way. (I noticed this problem with the standard Ahk2Exe also.) Additionally, I think this needs a 'Default' button.
Could you double-check your results, please. If there are still problems I’ll need more detail.
Thanks
Joe, I cannot reproduce your point 1. Compiling using the GUI without reloading between compiles gives identical .exe's here. I used the same icon both times.
Your point 2. The path and name of the custom icon sticks here, between successive loads of the GUI and also successive runs of the GUI.
With the source parameter, only the path should remembered between successive loads, and my tests confirm that this happens.
I’ll need to look further at the destination parameter as it doesn’t seem to stick in an expected way. (I noticed this problem with the standard Ahk2Exe also.) Additionally, I think this needs a 'Default' button.
Could you double-check your results, please. If there are still problems I’ll need more detail.
Thanks
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
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 “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 202 guests