Upcoming Ahk2Exe Changes (2019)

Post your working scripts, libraries and tools
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

19 Aug 2019, 18:35

New version available:-

Beta_3, 20 August 2019 -
  • Fix 'Set FileVersion' and 'Set ProductVersion'.
  • Implement 'Save Script Settings as' on File menu.
  • Implement new directives 'Bin', 'ExeName' and 'Obey'.
  • Handle unloading and reloading for the generated .exe.
See the updated documentation in the .zip for more information.
Last edited by TAC109 on 28 Sep 2019, 22:30, edited 2 times in total.
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

20 Aug 2019, 16:29

Thanks. Unfortunately the StdOut-StdIn trick doesn't work under Wine. :(
Screenshot from 2019-08-20 14-45-15a.png
Screenshot from 2019-08-20 14-45-15a.png (176.95 KiB) Viewed 1458 times
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

20 Aug 2019, 18:15

Looks like a Wine problem. I’ve seen references in google to updating Wine and Winetricks. Also apparently the version of Windows specified has a bearing. Good luck!
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

21 Aug 2019, 01:25

Yeah, most likely a Wine problem, and not the only one (see broken transparency in the logo image). Even the File Open/Save dialog won't work in some scripts (such as myCompiler), they'd crash due to an unimplemented shell32 API (ordinal 755: PathIsEqualOrSubFolder() ). Can you imagine a 14+ years longstanding issue not being looked into although code exists and was proposed to both Wine and ReactOS?!
(Actually the crash happens because I tried to override comdlg32.dll with the native XP one, but still it shouldn't happen)

Anyway, I've tried setting different Windows versions to no avail. I'm already on Wine v4.0.1 and the only update would be to the unstable/development version (currently at v4.14), which I'm kinda reluctant to do at the moment.

The only thing I haven't tried - if allowed - would be to use native libraries, but I don't know which one(s) would be related to StdOut/StdIn. :?

On another note, locally I have modified the script a bit, adding SetFileVersion and SetProductVersion natively, for completeness sake, and left SetVersion in just as a shortcut in case user doesn't need separate version numbers. The latter would of course overwrite any of the former two but that's not a problem if the documentation warns about that.

Also added SetInternalName and SetProductName on the same basis and with same effect as above: SetName would overwrite any of them if used together.

This would allow enough flexibility while keeping all official fields on the same syntax. Call it nitpicking if you want. :)
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

21 Aug 2019, 02:10

The 'set fileversion', 'set productversion' and 'set internalname', 'set productname (i.e. separate 'set') will work correctly in the official beta version. I’ll produce an amendment for the Stdin problem. Cheers
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

21 Aug 2019, 14:55

They do work, it's just a cosmethic thing - if you like - to have all officially recognized fields available in the same syntax, while the custom fields have a separate one. Not a big deal, just some polish. ;)

Thank you for all your work so far, and for looking into the StdOut/StdIn issue - I know it's not something common and may require extra work. Corner cases are never easy but then again anybody could do the easy things, so where's the fun... :roll:
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

21 Aug 2019, 23:48

New version available:-

Beta_4, 22 August 2019 -
  • Changed 'Obey' internals to use work files.
  • 'Obey'ing an invalid command will now show an error message.
  • Added 'SetFileVersion', 'SetInternalName', 'SetProductName', and 'SetProductVersion' directives.
See the updated documentation in the .zip for more information.
Last edited by TAC109 on 28 Sep 2019, 22:30, edited 2 times in total.
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

22 Aug 2019, 07:47

Well, everything works fine now as far as I checked. Great job my friend, thank you so much! :bravo: :thumbup:

For what it's worth - which is probably nothing, ha ha :lol: - I'm almost done converting my old compiler front-end to Unicode and maybe x64 compatibility. If anything, it could be used to check if all resources have been added/removed/replaced correctly upon compilation without the need for ResHacker or other similar tools. But it still needs a litle bit of work on the Unicode side.

This may be overkill but I gotta ask just for the sake of it: could there be some kind of a continuation section for the directives? Say a directive string is waaaaay too long and gets hard to read/modify - could we get something like ;@Ahk2Exe-Cont so that all text/code on such lines would get concatenated to the latest valid directive above them? Example:

Code: Select all

;@Ahk2Exe-Set Comments, These are comments for the current executable
;@Ahk2Exe-Cont and they are too long for a single line
;@Ahk2Exe-Cont so we break them into little parts easily readable.
I put Comments as an example but that could well be a long line of code yielding a variable (or more if that ability would be added sometime).
Anyway, it's just a thought. Things look fine as they are now and if nobody comes up with some nasty bug this beta could probably make it to release.
If anything, some extremely minor cosmethic adjustments to Ahk2Exe.ahk could be made to the code to justify the jump to Release:
- the newly added menu item lines begin with lowercase m instead of M (menu instead of Menu)
- the call to loading gdiplus misses the return type as Ptr
- two DllCalls to the end of the file miss the enclosing double quotes for the Ptr data types

Well done, thank you again! :thumbup:
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

23 Aug 2019, 01:06

@Drugwash
I can implement 'Cont' without too much trouble.

With 'Obey', I’ve just realised that the recent change to use work files allows me to implement multiple results! I’m going to add an optional parameter 'Extra' which can be a number 1-9. Setting this to 2, for example will generate the standard plus 2 extra results ('U_name', 'U_name1', and 'U_name2'). The obeyed command/expression will have to first set values to 'name', 'name1', and 'name2'.

I’m also making the cosmetic changes you suggested.
Cheers
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

23 Aug 2019, 01:49

Ah, that's all great! :dance:

Later edit:
Been playing with the GUI a little bit, thought it may use some tweaking. What do you think?
Screenshot from 2019-08-23 20-02-50.png
Screenshot from 2019-08-23 20-02-50.png (45.71 KiB) Viewed 1067 times
Code for the changes ( goes to Ahk2Exe.ahk):

Code: Select all

; just a demo, not complete code

LastUseMPRESS := -1, BinNames := "Default|ANSI 32-bit|Unicode 32-bit|Unicode 64-bit", BinFileId := 1
;===============================>
nu := LastUseMPRESS < 0 ? 0 : 1
CompressDescr := {-1:" U&PX", 0:"your mind &power :-)", 1:" M&PRESS"}
RegRead, upx, HKCU, Software\AutoHotkey\Ahk2Exe, LastCompression
upx+=1

h := 22	; common height for controls, easily adjustable if/when needed
bw := 53	; common width for buttons
h1 := 21	; height for compression row
gh1 := h+33, gh2 := 3*h+h1+15+28, h2 := gh1+5, h3 := gh2+8
Gui, +LastFound
GuiHwnd := WinExist("")
Gui, Margin, 10, 3
Gui, Add, Link, x287 y20,
(
©2004-2009 Chris Mallet
©2008-2011 Steve Gray (Lexikos)
©2011-2016 fincs
©2017-2019 Steve Gray, TAC109
<a href="https://www.autohotkey.com">https://www.autohotkey.com</a>
)
Gui, Add, Text, xm y+15 w570 h2 +0x1007
Gui, Add, GroupBox, xm y+7 w570 h%gh1% Section cBlue, Required Parameter
Gui, Add, Text, xm+6 ys+20 h%h% +0x200, &Source (script file)
Gui, Add, Edit, x137 yp w315 hp +Disabled vAhkFile, %AhkFile%
Gui, Add, Button, x+5 yp w%bw% hp gBrowseAhk, &Browse
Gui, Add, GroupBox, xm ys+%h2% w570 h%gh2% Section cBlue, Optional Parameters
Gui, Add, Text, xm+6 ys+20 h%h% +0x200, &Destination (.exe file)
Gui, Add, Edit, x137 yp w315 hp +Disabled vExeFile, %Exefile%
Gui, Add, Button, x459 yp w%bw% hp gBrowseExe, B&rowse
Gui, Add, Button, x+5 yp w%bw% hp gDefaultExe, De&fault
Gui, Add, Text, xm+6 y+5 h%h% +0x200, Custom &Icon (.ico file)
Gui, Add, Edit, x137 yp w315 hp +Disabled vIcoFile, %IcoFile%
Gui, Add, Button, x459 yp w%bw% hp gBrowseIco, Br&owse
Gui, Add, Button, x+5 yp w%bw% hp gDefaultIco, D&efault
Gui, Add, Text, xm+6 y+5 h%h% +0x200, Base File (.bin)
Gui, Add, DDL, x137 yp w315 h50 R10 AltSubmit vBinFileId Choose%BinFileId%, %BinNames%
Gui, Add, Text, xm+6 y+5 h%h1% +0x200, Compress exe with
Gui, Add, CheckBox, x137 yp w120 hp Check3 vUseMpress gcompress Checked%LastUseMPRESS%
	, % CompressDescr[LastUseMPRESS]
Gui, Add, DDL, x258 yp w75 h50 R6 E0x402000 Hidden%nu% vupx Choose%upx%
	, Lowest|Low|Normal|High|Highest
Gui, Add, Text, x+2 yp hp +0x200 Hidden%nu% vupxlevel, compression level
Gui, Add, Text, x258 yp w195 hp +0x200 Hidden Disabled vmissing,
Gui, Add, Button, x258 ys+%h3% w75 h28 Default gConvert, > &Convert <
Gui, Add, Text, xm yp-5 w245 Disabled, 
	(LTrim
	NOTE: In-script compiler directives, if any, will
	override their correspondent optional parameters
	set above, except for compression.
	)
Gui, Add, Text, x+90 yp w235 Disabled,
	(LTrim
	NOTE 2: Compiling can NOT and does NOT
	`t guarantee source code protection.
	)
Gui, Add, StatusBar,, Ready
;@Ahk2Exe-IgnoreBegin
Gui, Add, Pic, x29 y16 w240 h78, %A_ScriptDir%\logo.png
;@Ahk2Exe-IgnoreEnd
/*@Ahk2Exe-Keep
gosub AddPicture
*/
GuiControl, Focus, Button1
Gui, Show, AutoSize, Ahk2Exe for AutoHotkey v%A_AhkVersion% -- Script to EXE Converter

compress:
Gui, Submit, NoHide
compressor := UseMpress < 0 ? "upx.exe" : UseMpress > 0 ? "mpress.exe" : "your trust"
if m := (!UseMpress OR FileExist(A_ScriptDir "\" compressor)) ? "" : " [missing]"
	{
	GuiControl Text, missing, * Put %compressor% in compiler's folder
	SetTimer, chkComp, 1500
	}
GuiControl Text, UseMpress, % CompressDescr[UseMPRESS] m
GuiControl, % (UseMpress && m ? "Show" : "Hide"), missing
GuiControl, % (UseMpress=-1 && !m ? "Show" : "Hide"), upx
GuiControl, % (UseMpress=-1 && !m ? "Show" : "Hide"), upxlevel
return

GuiClose:
Gui, Submit
gosub SaveSettings
ExitApp

DefaultExe:
ExeFile := ""
GuiControl,, ExeFile, %ExeFile%
return

chkComp:
if !FileExist(A_ScriptDir "\" compressor)
	return
SetTimer,, Off
goto compress

Convert:
SetTimer, chkComp, Off
; upx--
;if UseMpress=-1
;	RegWrite, DWORD, HKCU, Software\AutoHotkey\Ahk2Exe, LastCompression, %upx%
;... all the rest
;============ DUMMY LABELS ============<
BrowseAhk:
BrowseExe:
BrowseIco:
DefaultIco:
AddPicture:
SaveSettings:
return
Oh and could you please share some details on the /cp switch? Maybe we could squeeze that too somewhere in the GUI (and in directives).
Also, could compression type (and level, for UPX) be made a directive, just to have a complete set of optional GUI settings that can be overridden by directives?
Say ;@Ahk2Exe-Compress A32U1 U32U4 U64M meaning: ANSI 32bit use UPX level 1, Unicode 32bit use UPX level 4, Unicode 64bit use MPRESS.
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

26 Aug 2019, 08:24

New GUI code, a litle improved (added codepage selection). ComboBoxes can now be resized vertically according to the other elements (using the h variable).
(BTW, that black background in the logo is a Linux Wine issue, in Windows it should look correctly - I just don't have a working Windows at hand).
Screenshot from 2019-08-26 16-16-56.png
Screenshot from 2019-08-26 16-16-56.png (48.19 KiB) Viewed 1000 times
GUI code (only), needs to be connected with the main Ahk2Exe script:

Code: Select all

; just a demo, not complete code
; to do: disable fields that are overridden by directives

LastUseMPRESS := -1, BinNames := "Default|ANSI 32-bit|Unicode 32-bit|Unicode 64-bit"
BinFileId := 1
;===============================>
nu := LastUseMPRESS < 0 ? 0 : 1, AW := A_IsUnicode ? "W" : "A"
CompressDescr := {-1:" U&PX", 0:"your mind &power :-)", 1:" M&PRESS"}
RegRead, upx, HKCU, Software\AutoHotkey\Ahk2Exe, LastUPXlevel
upx+=1
RegRead, cp, HKCU, Software\AutoHotkey\Ahk2Exe, LastUseCodepage
cp+=0, ncp := !cp
RegRead, cpnum, HKCU, Software\AutoHotkey\Ahk2Exe, LastCodepage
cpnum+=0
gosub listCP
h := 20		; common height for controls, easily adjustable if/when needed
bw := 53		; common width for buttons
h1 := h+5	; height for binary, codepage, compression rows plus spacing
gh1 := h+33, gh2 := 5*h+20+28, h2 := gh1+5, h3 := gh2+8
Gui, +LastFound
GuiHwnd := WinExist("")
Gui, Margin, 10, 3
;Gui, Color, White, White
Gui, Add, Link, x287 y20,
(
©2004-2009 Chris Mallet
©2008-2011 Steve Gray (Lexikos)
©2011-2016 fincs
©2017-2019 Steve Gray, TAC109
<a href="https://www.autohotkey.com">https://www.autohotkey.com</a>
)
Gui, Add, Text, xm y+15 w570 h2 +0x1007
Gui, Add, GroupBox, xm y+7 w570 h%gh1% Section cBlue, Required Parameter
Gui, Add, Text, xm+6 ys+20 h%h% +0x200, &Source (script file)
Gui, Add, Edit, x137 yp w315 hp +Disabled vAhkFile, %AhkFile%
Gui, Add, Button, x+5 yp w%bw% hp gBrowseAhk, &Browse
Gui, Add, GroupBox, xm ys+%h2% w570 h%gh2% Section cBlue, Optional Parameters
Gui, Add, Text, xm+6 ys+20 h%h% +0x200, &Destination (.exe file)
Gui, Add, Edit, x137 yp w315 hp +Disabled vExeFile, %Exefile%
Gui, Add, Button, x459 yp w%bw% hp gBrowseExe, B&rowse
Gui, Add, Button, x+5 yp w%bw% hp gDefaultExe, De&fault
Gui, Add, Text, xm+6 y+5 h%h% +0x200, Custom &Icon (.ico file)
Gui, Add, Edit, x137 yp w315 hp +Disabled vIcoFile, %IcoFile%
Gui, Add, Button, x459 yp w%bw% hp gBrowseIco, Br&owse
Gui, Add, Button, x+5 yp w%bw% hp gDefaultIco, D&efault
Gui, Add, Text, xm+6 y+5 h%h% +0x200, Base File (.bin)
Gui, Add, DDL, x137 yp w315 h50 R10 AltSubmit vBinFileId Choose%BinFileId% hwndhDDL1
	, %BinNames%
SendMessage, 0x153, -1, h-5,, ahk_id %hDDL1%
Gui, Add, CheckBox, xm+6 yp+%h1% w120 h%h% vcp gsetcp Checked%cp%, Codepage: %cpnum%
Gui, Add, DDL, x137 yp w315 h50 R20 vcodepage gchoosecp Choose%curCP% hwndhDDL2
	, %cpSlist%
SendMessage, 0x153, -1, h-5,, ahk_id %hDDL2%
Gui, Add, Text, xm+6 yp+%h1% h%h% +0x200, Compress exe with
Gui, Add, CheckBox, x137 yp w120 hp Check3 vUseMpress gcompress Checked%LastUseMPRESS%
	, % CompressDescr[LastUseMPRESS]
Gui, Add, DDL, x258 yp w75 h50 R6 E0x402000 Hidden%nu% vupx Choose%upx% hwndhDDL3
	, Lowest|Low|Normal|High|Highest
SendMessage, 0x153, -1, h-5,, ahk_id %hDDL3%
Gui, Add, Text, x+2 yp h%h% +0x200 Hidden%nu% vupxlevel, compression level
Gui, Add, Text, x258 yp w195 hp +0x200 Hidden Disabled vmissing,
Gui, Add, Button, x258 ys+%h3% w75 h28 Default gConvert, > &Convert <
Gui, Add, Text, xm yp-5 w245 Disabled, 
	(LTrim
	NOTE: In-script compiler directives, if any, will
	override their correspondent optional parameters
	set above, except for compression.
	)
Gui, Add, Text, x+90 yp w235 Disabled,
	(LTrim
	NOTE 2: Compiling can NOT and does NOT
	`t guarantee source code protection.
	)
Gui, Add, StatusBar,, Ready
;@Ahk2Exe-IgnoreBegin
;Gui, Add, Pic, x29 y16 w240 h78, %A_ScriptDir%\logo.png
Gui, Add, Picture, x29 y16 w240 h78 -AltSubmit -BackgroundTrans +0xE, %A_ScriptDir%\logo.bmp
;@Ahk2Exe-IgnoreEnd
/*@Ahk2Exe-Keep
gosub AddPicture
*/
GuiControl, Focus, Button1
Gui, Show, AutoSize, Ahk2Exe for AutoHotkey v%A_AhkVersion% -- Script to EXE Converter

compress:
Gui, Submit, NoHide
compressor := UseMpress < 0 ? "upx.exe" : UseMpress > 0 ? "mpress.exe" : "your trust"
if m := (!UseMpress OR FileExist(A_ScriptDir "\" compressor)) ? "" : " [missing]"
	{
	GuiControl Text, missing, * Put %compressor% in compiler's folder
	SetTimer, chkComp, 1500
	}
GuiControl Text, UseMpress, % CompressDescr[UseMPRESS] m
GuiControl, % (UseMpress && m ? "Show" : "Hide"), missing
GuiControl, % (UseMpress=-1 && !m ? "Show" : "Hide"), upx
GuiControl, % (UseMpress=-1 && !m ? "Show" : "Hide"), upxlevel
return

GuiClose:
Gui, Submit
gosub SaveSettings
ExitApp

DefaultExe:
ExeFile := ""
GuiControl,, ExeFile, %ExeFile%
return

chkComp:
if !FileExist(A_ScriptDir "\" compressor)
	return
SetTimer,, Off
goto compress

Convert:
SetTimer, chkComp, Off
Gui, Submit, NoHide
; upx--
;if UseMpress=-1
;	RegWrite, DWORD, HKCU, Software\AutoHotkey\Ahk2Exe, LastUPXlevel, %upx%
;RegWrite, DWORD, HKCU, Software\AutoHotkey\Ahk2Exe, LastUseCodepage, %cp%
;if cp
;	RegWrite, DWORD, HKCU, Software\AutoHotkey\Ahk2Exe, LastCodepage, %cpnum%
;... all the rest
return

setcp:
Gui, Submit, NoHide
GuiControl, % (cp ? "Show" : "Hide"), codepage
;return

chooseCP:
Gui, Submit, NoHide
GuiControl,, cpnum, % cpnum := cpS[codepage]
GuiControl,, cp, % "Codepage: " (cp ? cpnum : "default")
return

listCP:
codepage := GetCPName(cpnum), defACP := GetCPName(0), curCP := 1, cpS := {}
DllCall("EnumSystemCodePages" AW
	, "Ptr", ECP := RegisterCallback("EnumCodePagesProc", "F", 1, 0)
	, "UInt", 2)	; 1=Installed, 2=Supported
cpS["<default Windows ANSI>"] := 0, cpS["UTF-8"] := 65001, cpS["UTF-16"] := 1200
For k, v in cpS
	cpSlist .= k "|"
StringTrimRight, cpSlist, cpSlist, 1
Sort, cpSlist, U CL D| F SortN
For k, v in cpSlist
	if (v=cpnum)
		{
		curCP := A_Index
		break
		}
return

EnumCodePagesProc(in)
{
Global cpS
if cp := in ? StrGet(in) : 0
	cpS[GetCPName(cp)] := cp
return !!cp
}

GetCPName(cp)
{
Global AW
Static CPIX, sz := 24+260*(A_IsUnicode ? 2 : 1)
VarSetCapacity(CPIX, sz, 0)	; CPINFOEXA/W struct
if DllCall("GetCPInfoEx" AW, "UInt", cp+0, "UInt", 0, "Ptr", &CPIX)
	return StrGet(&CPIX+24)
}

SortN(s1, s2)
{
if !A_IsUnicode
	Loop, 2
		MB2WC(s%A_Index%)
return DllCall("shlwapi\StrCmpLogicalW", "Str", s1, "Str", s2, "Int")
}

MB2WC(ByRef strg)
{
in := strg, sz := 0
Loop, 2
	{
	VarSetCapacity(strg, sz*2)
	sz := DllCall("MultiByteToWideChar"
		, "UInt", 65001
		, "UInt", 0
		, "Ptr", &in
		, "Int", -1
		, "Ptr", &strg
		, "UInt", sz)
	}
}
;============ DUMMY LABELS ============<
BrowseAhk:
BrowseExe:
BrowseIco:
DefaultIco:
AddPicture:
SaveSettings:
return
Anybody a 'yay' or 'boo' or rotten tomatoes/eggs...? :)

P.S. The StdIn/StdOut issue seems to have been known for a while - say four years. I wonder if Wine developers are immortal aliens or something...
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
User avatar
joedf
Posts: 7245
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

27 Aug 2019, 22:34

@TAC109
You want me to take on this directive? :think: I just thought Eval is less confusing to me than Obey... Either way, I think it should be fine.

EDIT: Never mind, I see you've committed new changes :+1: https://github.com/TAC109/Ahk2Exe/commits/edge
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 3143 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

27 Aug 2019, 23:58

@Drugwash
Your new GUI looks good. Do you think that the 'codepage' line should be moved up to be the first line in the 'optional parameters' section? (As it applies to the 'source' line, above.)

I’m going to add a matching 'codepage' parameter to the 'bin' directive. (This directive will also have an optional 'ExeName' parameter, which I’m in the process of coding now.)

A random question for you: do UTF8-with-BOM files give you problems in your Linux/Wine/Windows environment?
(Some recent change I made to Ahk2Exe.ahk caused AutoHotkey to think that it was an ANSI file, which mucked up the copyright symbols! I had to convert it from UTF8 to UTF8-with-BOM.)


@joedf
I’m slowly getting there!
Cheers
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

28 Aug 2019, 02:43

Thank you for your appreciation, was afraid it was all too ugly for anyone to issue a decent opinion. :D
It's not all visuals though, under the hood there's a continuous check for compressors if selected, and a hint for where to place them if not present.
I'm not quite sure which codepages to enumerate: installed ones or supported ones. Didn't seem to make much difference under Wine but it may under different versions of Windows. Anyway, it's just a matter of changing a flag (0x1 or 0x2).
TAC109 wrote:
27 Aug 2019, 23:58
Do you think that the 'codepage' line should be moved up to be the first line in the 'optional parameters' section?
Not sure. My thoughts were to keep as close as possible to the original layout that people got accustomed to already. We may need other opinions on that. But personally I don't mind swapping field places if needed.
TAC109 wrote:
27 Aug 2019, 23:58
do UTF8-with-BOM files give you problems in your Linux/Wine/Windows environment?
Not at all; problems may arise for UTF-8 without BOM, depending on the file editor. I'm used to Metapad but that one has an unfinished UTF-8 implementation (still uses an ANSI RichEdit control) and displays UTF-8 characters decomposed. Could be a feature, hinting me to check if the file is indeed saved with BOM or not. I also noticed those © symbols but fixed the issue promptly.
TAC109 wrote:
27 Aug 2019, 23:58
I’m going to add a matching 'codepage' parameter to the 'bin' directive. (This directive will also have an optional 'ExeName' parameter [...]
Could be useful. Just please be careful not to confuse the user. Everything must be as intuitive as possible. ;)
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

30 Aug 2019, 21:49

New version available:-

Beta_5, 31 August 2019 -
  • Added optional 'Exe_path\Name', and 'Codepage' parameters to 'Bin' directive.
  • Added 'Cont' directive (for continuation lines to any directive).
  • Added optional 'Extra' parameter to the 'Obey' directive.
  • Changed 'UpdateManifest' directive to always require the first parameter.
  • Allow drag 'n drop of a non-standard *.bin file to the GUI.
  • Warn if UPX/MPRESS.exe are missing when cycling the 'Compress exe with' checkbox on the GUI.
See the updated documentation in the .zip for more information.
Last edited by TAC109 on 28 Sep 2019, 22:31, edited 1 time in total.
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
joedf
Posts: 7245
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

31 Aug 2019, 14:22

nice work :+1:
Im just wondering about the Cont directive... I dont see where it can be used other than with the Obey directive. Could you provide an example usage case?
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 3143 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
TAC109
Posts: 363
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

31 Aug 2019, 17:40

@joedf
The 'Cont' directive can simply be used to format a long-lined directive so that it looks nice when viewed in the source code. It can be used after any directive, including itself. This example that @Drugwash posted earlier shows how it can be used:-

Code: Select all

;@Ahk2Exe-Set Comments, These are comments for the current executable
;@Ahk2Exe-Cont  and they are too long for a single line
;@Ahk2Exe-Cont  so we break them into little parts easily readable.
Hope this clarifies the issue. :)
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
User avatar
joedf
Posts: 7245
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

31 Aug 2019, 20:34

Okay, I see. Thanks :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 3143 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
Drugwash
Posts: 725
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Upcoming Ahk2Exe Changes (2019)

11 Sep 2019, 03:28

So no codepage in GUI, no timer for immediate feedback on deploying packer exe? Incomplete job IMHO.
But I see nobody else is interested in this script apart from Joe so why bother.
Thanks for your work.
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
User avatar
joedf
Posts: 7245
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

11 Sep 2019, 08:31

TAC109 has committed his work here: https://github.com/TAC109/Ahk2Exe/commits/edge
Once he is confident enough about the changes I will merge it into the official repository.
The codepage gui element can be added later on. :+1:
I am not sure what you mean by a timer? a notification for mpress/upx?
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 3143 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Google [Bot] and 14 guests