v2.0-beta updates

Community news and information about new or upcoming versions of AutoHotkey
Locked
lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta updates

Post by lexikos » 16 Oct 2021, 22:42

v2.0-beta updates will be posted in this topic.

See also: v2.0-beta.1

v2.0-beta.2

Improved OwnDialogs option to reduce the risk of a conflict if a HWND value is reused by the system.
Optimized A_AhkPath (minor).
Replaced "No valid COM object!" errors with TypeError.
Fixed thread erroneously continuing after displaying an error in some cases.
Fixed some other minor issues with error handling.
Fixed "astr*" parameters to not include the null terminator in the output string's length.
Fixed return %r% := "string" erasing the target variable if the string was allocated with malloc.
Fixed Pause() to pause immediately. This also fixes return Pause() suspending timers indefinitely due to the "paused" thread ending unexpectedly.
Fixed errors for invalid variable names to point at the correct line.
Fixed bugs with Loop-Until as the direct body of another statement.
Fixed exceptions omitting stack frames above anonymous functions.
Fixed DBGp stack_get showing incorrect line for auto-execute thread.
Fixed Format("{n... causing crashes when n > 2**31.
Fixed line continuation for fat-arrow getter/setter (get => line1 `n . line 2).
Fixed fat-arrow property with no space (prop=>expr).
Fixed references to static vars (and declared global vars) through more than one nesting level.
Fixed DeleteProp not freeing dynamic properties unless they are at index 0.
Added maxversiontested to application manifest (allows scripts to create XAML islands).

Merged v1.1.33.10 (+1).

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.3

Post by lexikos » 23 Oct 2021, 20:23

Fixed Loop {} Until [broken by beta 2].
Fixed Loop x Until where x consists of multiple statements without a block.
Optimized buffer growth when reading in very long script lines/continuation sections.

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.4

Post by lexikos » 05 Jun 2022, 02:39

This release includes an installer and additional scripts, which can also be found here: https://github.com/AutoHotkey/AutoHotkeyUX

(Download link removed)

Run Install.cmd to start the installer GUI.
  • If you use Windows' built-in support for zip files, running this from within the zip should automatically extract the files to a temporary directory.
  • If running the file from directly within the archive doesn't work, you may need to manually extract the files to a temporary directory first.
  • It may be necessary to "unblock" the zip file before installing; right-click the zip file, click Properties, tick Unblock and click OK.
    (Testing indicates this is unnecessary if you run Install.cmd from within the zip in Explorer, without extracting first.)
  • Manually running as admin is unnecessary, and currently causes installation for "all users" regardless of what is selected in the GUI.
For known issues and discussion, refer to UX - Installer and other scripts aimed at improving the user experience.

The installer is designed to be used with v1 already installed (preserving the ability to run v1 scripts) or without v1 (which can be installed afterward, but please read the documentation first).

New documentation: Changes:

Changed variadic calls to omit any parameter for which the enumerator does not set the output variable.
Changed COM method calls to treat any unset VarRef as VT_EMPTY.
Changed Gui GetPos/GetClientPos to be relative to parent, like Move/Show.
Changed Gui MarginX/Y to set the default if queried prior to adding a control, rather than returning 0.

Added "L" file attribute character for reparse points/symbolic links.

Fixed HotIfWin without parameters to be equivalent to HotIf().
Fixed debugger instability due to unsafe reentry by async commands.
Fixed DllCall silently exiting the thread when "astr*" output is empty.
Fixed expressions containing obj.%(expr)% with no space before (.
Fixed Gui().Name := "".
Improved error dialogs for unhandled thrown strings/numbers.
Fixed a reference-counting bug with custom Sort functions.
Fixed Gui Move/Show to correctly retain position if +Parent was used.
Fixed ContextMenu event dropping the Ctrl parameter in event sink mode.
Fixed crashes caused by callbacks while an error dialog is being shown.
Fixed Hotstring(":X:...", "string") crashing when the hotstring triggers.
Removed " (Unicode)" from debugger version feature string.

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.5

Post by lexikos » 19 Jun 2022, 05:08

Fixed several issues with the installer and UX scripts (see commit history up to commit 3b7d5f12).

Fixed some load-time bugs with closures.
  • Stack overflow at load time in certain cases where a closure is referenced by multiple levels of functions nested inside it.
  • Undefined behaviour in certain cases where a nested function becomes a closure due to referencing another nested function which is a closure.
Changed ComObjConnect to only resolve global functions (by name). The previous behaviour was to potentially resolve nested functions in whatever function happened to be running.

Merged pull requests:
  • #278 (jeeswg): Improved error message for IniRead.
  • #265 (Helgef): Hotstring(":X:...", "string") now throws.
  • #267 (Helgef): Code changes to Tooltip which include a new return value (the tooltip's HWND) and changes to error reporting.
  • #283 (Helgef): Fixed a reference counting issue with closures that could allow the closure to be deleted while it is executing.
Changed GuiCtrlFromHwnd to work for nested child windows, such as the second child window of an ActiveX (WebBrowser) control.

Changed the script's main window to be sized to 75% of the primary screen's work area, but with a maximum width equal to the height of the work area. This prevents the window from being excessively wide on ultra-wide screens, while otherwise matching the sizing of previous versions as observed on my system (it might have varied by OS).

Removed the obsolete restriction that labels cannot point to functions. This was in place because optimizations to gosub and similar would cause the body of the function to be executed. It was never an issue for goto, since jumping to (or executing) the function's open-brace will just cause it to transfer control to the close-brace.

Fixed #HotIf to permit interspersing with a series of hotkey labels.

Changed ComObjQuery to not set A_LastError (it wasn't documented, and none of the other COM functions do it).
Changed ComObjQuery to return a wrapper object of type VT_DISPATCH when IDispatch is requested, instead of VT_UNKNOWN.

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.6

Post by lexikos » 01 Jul 2022, 19:18

Minor breaking changes

Changed Array to throw when retrieving an element with no value, consistent with Map, properties and variables.
Added UnsetError and reclassified MemberError, KeyError and IndexError.
Renamed KeyError to UnsetItemError and changed its message.

Additions and improvements

Added .Get(Index [, Default]) and .Default to Array.
Added var? and unset for use with optional parameters.
Added var ?? value, mostly equivalent to IsSet(var) ? var : value.
Added the ability to specify arbitrary expressions for parameter defaults (not yet documented).
Added static fn() for preventing capture of outer non-static vars.
Optimized short-circuit in cases like a && b && c or a || b || c.
Changed MsgBox to use default Text as appropriate even with >0 params; e.g. MsgBox(, title) is no longer blank.
Changed ToolTip to set TOOLINFO::hwnd to A_ScriptHwnd. This allows the script to handle tooltip notifications, such as to customize its appearance or implement links.
Changed super.x := y to define a new value property if appropriate, instead of failing.

Bug fixes

Fixed built-in functions to treat a missing required parameter as an error, not as "". This applies only to dynamic calls where the parameter count is sufficient.
Fixed the debugger returning unset/"" in place of any uninitialized class.
Fixed parameter default strings ending with "``".
Fixed undefined behaviour when parameter default strings exceed 16384 chars.
Fixed Array.Prototype.Push.MinParams to be 1, not 2.
Fixed super.x := y indicating the property doesn't exist, when it exists but is read-only.

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.7

Post by lexikos » 13 Jul 2022, 03:42

Note: If you have trouble finding the tray icon, be aware that the icons have changed.

SHA256 hash



Program Changes

Added RegCreateKey(KeyName?).
Added ProcessGetName and ProcessGetPath, contributed by jeeswg.

Changed error-reporting for ProcessSet/Get functions.
Details
Changed DirDelete, IL_Create and IL_Add to use boolean coercion.
Changed icons.
Changed tray icon handling to improve visual quality after changing DPI.
Details

Fixed working directory reverting to A_InitialWorkingDir in some cases.
Details
Fixed Run to validate the WorkingDir parameter.
Fixed Buffer.Size to avoid reallocating if size is unchanged.
Fixed Buffer causing undefined behaviour if resized to 0.
Fixed Clone for case-insensitive Map [thanks aseiot].
Fixed load-time crashes due to specific invalid hotkeys/hotstrings.
Details
Improved parsing and error-reporting for invalid hotkeys.
Details
Changed load-time parsing to prioritize hotkeys over continuation (fixes +'::Send "'").



UX Script Changes

On Windows 11 (and probably 10), AutoHotkey can now be uninstalled by right-clicking the program shortcut in the Start menu and selecting "Uninstall". (Previously this just opened Programs and Features in Control Panel, which is what it does for the majority of desktop apps because the System.AppUserModel.UninstallCommand property is apparently only documented inside the Windows SDK header files.)

When installing v2 as admin, now two symbolic links are created (instead of just the first one):
  • In the root, v2 → v2.0-beta.7
  • In the v2.0-beta.7 subdirectory, AutoHotkey.exe → AutoHotkey64.exe or AutoHotkey32.exe
This is intended for tools which need an AutoHotkey interpreter. For instance, it is the default path used by vscode-autohotkey-debug for v2 scripts.

With a default configuration and only v2 installed, attempting to run a script which appears to require v1.x will now offer to automatically download and install v1.1. This also works for v2.x (such as if you install beta.6 with the beta.7 UX files and try to run a script that requires beta.7), but is currently not designed to update the UX scripts or symbolic links, or account for new installation logic.

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.8

Post by lexikos » 07 Sep 2022, 03:41

Known Issues

Omitting FileSelect's Filter parameter causes an access violation. An empty string can be passed instead. Please report any similar issues.

If the current installed version is v1.1, installing with the exe shows an UnsetError. This can be avoided by downloading the zip and running Install.cmd instead.


Changes

Changed ComValue(8, "...") to automatically free the BSTR on __delete.
Changed ComValue(8, ptr, 1) to automatically free the BSTR on __delete.
Changed ComObjArray assignment to copy the BSTR if assigned a wrapper such as ComValue(8, "...").

Fixed error messages for unhandled exceptions not being passed to the debugger client (via stderr redirection).
Fixed DriveGetStatus to return "Invalid" for "C:\not-extant" etc.
Implemented a trivial optimization to DriveGetList.
Fixed StrGet(Buffer(0)) to return "", not throw.
Fixed ListViewGetContent("Count Col",...).
Fixed File.Read(1) stopping at "`r`n" when newline translation is off.
Fixed Exit(exitCode) ignoring the exit code.
Fixed GuiCtrl.Focused for controls with child windows, such as ComboBox.
Fixed an issue preventing the definition of properties named "IsSet".
Fixed hotstrings with X option to allow whitespace before the action.
Fixed /include relative-path to be relative to initial working dir.
Fixed a spelling error in the #Warn Unreachable message.
Merged v1.1.34.04 (but some fixes were only applicable to v1).
Merged pull request #299 by Helgef.

Implemented a new error/warning dialog:
  • Shortcut buttons for Help, Reload, Edit and ExitApp.
  • Continue/Abort for continuable errors (instead of Yes/No).
  • For runtime errors, the call stack can be shown.
  • The dialog is wider (better for call stacks and long code lines) and supports text selection and scrolling.
Internal changes:
Split script2.cpp into several separate files to improve maintainability and allow more control over compiler optimizations.
Implemented a new method of binding the C++ implementation of each built-in function to the script. This is expected to facilitate future development. For now, parameter type validation and conversion is improved for the affected functions (consistent with other functions that already behaved this way):
  • Integer parameters throw TypeError if given a non-numeric value.
  • Numeric parameters that permitted "blank or omitted" no longer permit "blank".
  • String parameters automatically call .ToString() on any object value. This was not intended to be enabled in this release, and may be disabled in the next release, until it can be supported consistently throughout the library and language.

UX script changes:
Fix LauncherConfigGui not preselecting the configured versions
Fix .bin files not being installed for v1
Fix elevation in install-ahk2exe.ahk
Support running install-ahk2exe.ahk outside of the installation dir
Changes to support compiled setup
Fix AutoHotkey.exe symbolic link(s) not being deleted
Fix launcher falsely identifying some v1 code as v2-pct
Fix launcher handling of /include
Change standalone ui-newscript.ahk to show Explorer window
Add protection against race condition for pre-install checks
Change install-version.ahk to execute install.ahk if newer


SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.9

Post by lexikos » 10 Sep 2022, 00:47

Fixed access violation when FileSelect parameter #1 or #4 is omitted.
Fixed DirCreate, FileCopy and FileMove not reporting failures.
Fixed DirCreate handling of paths containing ".." or "/".
Fixed IniRead throwing MemoryError when return value should be "".
Fixed /validate (command-line switch) to output load-time warnings if applicable.
Fixed the error dialog's Edit button to be disabled if the script is embedded/stdin.
Other minor improvements to error reporting.

UX/installer:
Fixed the v1 upgrade routine to tolerate the absence of AutoHotkey.exe.
Fixed the launcher in a "current user" installation to scan its own directory even if an "all users" installation is present.
Added handling for failure of EnableUIAccess - this will hopefully mitigate failures caused by antivirus software having a lock on the new file.
Minor changes for debugging and error-reporting in the installer/UX.
Added a post-installation check for a common file-type-association issue and an automated fix.

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.10

Post by lexikos » 26 Sep 2022, 02:57

Changed RegEx StartingPos = 0 to start at the end of the string (one unit to the right of -1). This avoids PCRE error -24 (invalid starting offset) and permits zero-length matches such as with $ or (?<=abc).
Changed IniRead(File,, Key) to be considered invalid. Use "" if you actually want an empty section name.
Changed WinSetTransColor to interpret pure integers more intuitively. For instance, the literal integer (not string) 0xff was previously converted to the string "255" and misinterpreted as "0x000255".
Changed WinSetTransColor to allow color to be empty (e.g. " 200") without defaulting to a black color key.
Changed ControlSetEnabled to throw on failure (which is determined by checking the control's state afterward), like WinSetEnabled.

Optimized code size and improved parameter validation and error reporting for various functions.

When a function throws (even if the error is suppressed), output variables may be made unset rather than having a default value or their previous value. This behaviour is not yet guaranteed for all functions.

Fixed TrayTip() to hide the traytip [broken by v2.0-beta.8].
Fixed FileGetAttrib/Size/Time/Version to default to the full path (not just the filename) of the current file loop item.
Fixed DriveGetStatusCD causing an access violation if its parameter is omitted.
Fixed WinGetList/WinGetCount to support passing an Object/Integer to the WinTitle parameter.
Fixed ControlAddItem/ControlChooseIndex/String not performing a delay (A_ControlDelay).
Fixed WinSetAlwaysOnTop parameter #1 to actually be optional.
Fixed undefined behaviour when the length of FileSelect's RootDir\Filename parameter exceeds 259.
Fixed Array.InsertAt parameter #2 to actually be optional.
Fixed ListView.Modify parameter #2 to actually be optional.
Fixed StrPut(a, ,b,c) to throw, not crash.

SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.11

Post by lexikos » 02 Oct 2022, 02:30

Fixed bugs introduced by v2.0-beta.10:
  • WinRedraw not defined.
  • ToolTip requiring window number to be 0..19 instead of 1..20.
  • Win functions crashing if called without parameters (WinShow, WinHide, WinClose, WinKill, WinMinimize, WinMaximize, WinRestore).
UX changes:
  • Using "install additional version" to install v1 when an older version is present in the root directory (and does not also have its own subdirectory) will now cause the old version to be moved to a subdirectory so that the new version can be placed in the root.
  • The uninstall process now has a GUI for selecting which versions to uninstall.
  • Fixed an issue which prevented installation of older v2 betas via the exe-based installers.
  • When using the "new script" dialog to create a script on the Desktop, the file is now highlighted on the desktop instead of showing the Desktop in a new window.
  • Using the "Edit" button in the "new script" dialog no longer shows a new Explorer window (but still highlights the file if an Explorer window was already active).
SHA256 hash

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.12

Post by lexikos » 09 Oct 2022, 03:00

Fixed bugs with call stack display when no Error object is available.
  • Showing garbage when call stack has <= 1 item.
  • Showing "call stack" link when call stack is empty.
  • Erroneously omitting the top entry from the call stack.
  • Undefined behaviour if call stack grows before link is clicked.
Fixed bugs with optional 64-bit numeric parameters on 32-bit builds.
Fixed SendMessage/PostMessage to allow HWND_BROADCAST (0xFFFF).

Changed assignment operator to allow x := unset and x := (y?).


UX changes:

Optimized the launcher to locate interpreters via installed-files.csv (fixes potential delays caused by antivirus).
Added /silent switch to suppress warning and confirmation dialogs during installation/uninstallation.
Added /installto as an alias of /to.

Fixed install.ahk to not show a #SingleInstance prompt when self-elevating.
Fixed QuietUninstallString to be quiet.
Fixed the uninstall GUI to ignore files added by Ahk2Exe update function.
Fixed "Remove checked" in the uninstall GUI to perform a full uninstall if all versions are checked.
Fixed the launcher to ignore exe files without "(32|64)-bit" in the description, such as "AutoHotkey Script Compiler" (Ahk2Exe).


SHA256 hashes

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.13

Post by lexikos » 29 Oct 2022, 18:32

Fixed arrow keys not firing the Tab control's Change event.
Fixed a memory leak in Sort.
Fixed GetKeyVK/GetKeySC returning 0 for some keys.
Fixed IsOptional for some functions which have a mandatory parameter following optional parameters (e.g. ControlGetPos - Control).
Merged pull request #304 from Helgef.
Fixed issues when x.__Delete() accesses x during assignment/free.
  • During execution of __Delete, x now contains its new value, not "".
  • Any value assigned during __Delete is now retained rather than being overwritten (and possibly leaked) by the original assignment.
When a string assignment fails to allocate sufficient memory, the var now retains its previous value unless it was a dynamically allocated string, in which case it is freed and the var becomes unset, not merely empty.

Changed object-release-on-exit to make variables unset, not merely blank.
Changed object-release-on-exit to avoid releasing constants.
  • These cannot be safely released as load-time optimizations replace non-dynamic references with uncounted object pointers within the code.
  • Makes little sense for the value of a constant to change.
  • Fixes dynamic references to constants during exit.
  • Fixes potential double-deletion of objects during exit.
  • Fixes potential re-initialization of classes referenced during exit.
  • Improves the odds that __Delete will work as intended (if called).
  • Such objects could only ever be deleted during exit, so OnExit provides a (more) suitable alternative.
Changed error messages for &Ref params of methods to not count this.
Changed SetTimer to allow firing within the same tick if period is 1 or -1.
Added validation to InputHook's On property setters.

Changed the following functions to return the previous value of whichever setting was changed: CoordMode, Critical, DetectHiddenText, DetectHiddenWindows, FileEncoding, ListLines, SendLevel, SendMode, SetControlDelay, SetDefaultMouseDelay, SetMouseDelay, SetRegView, SetStoreCapsLockMode, SetTitleMatchMode, SetWinDelay. SetKeyDelay is excluded for now due to affecting multiple settings.

Further internal changes of a similar nature to v2.0-beta.8, this time affecting most Gui classes, ComObjArray, DateAdd, DateDiff and InputHook.

Changed LV.InsertCol() so that its first parameter can be omitted to append a column, instead of passing a large number.
Changed TV.Delete(0) to throw an error instead of deleting all items. To delete all items, omit the parameter as documented.
Moved the Choose method from Gui.Control.Prototype to Gui.List.Prototype.

SHA256 hashes

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.14

Post by lexikos » 08 Nov 2022, 23:29

Further internal changes of a similar nature to v2.0-beta.8, this time affecting Menu, StrSplit, MenuSelect, Hotkey, HotIf, File, Gui and GuiControl.

Reviewed parameter validation for all functions, methods and properties. In general, String parameters should throw rather than silently treating objects as empty (helpful when passing &var to the wrong parameter), and Number parameters should throw if given something non-numeric.

Improved a few error messages thrown by some functions given invalid parameters.

Disabled the implicit calling of obj.ToString() for String parameters of a selection of functions. This was unintentionally enabled in v2.0-beta.8 and will not be re-enabled until it can be supported consistently. String(obj) still calls obj.ToString(), as documented.

Functions and properties accepting or returning HWND values now truncate to 32-bit, to avoid issues due to unexpected sign-extension. (Some background info.)

Changed StrSplit to throw if Delimiters is an empty Array.

Changed GuiControl.Visible to be unaffected by parent window etc.

Fixed stack traces to include the topmost executing line of the auto-execute section.
Fixed crashes when showing stack trace for errors thrown by built-in functions.
Fixed ObjBindMethod(x,y)() to throw if method y doesn't exist, instead of doing nothing.
Fixed WinWait (et al.) not updating the Last Found Window when passed a HWND/object.
Fixed Chr(0) to evaluate to True for If/While/Until.

SHA256 hashes

lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

v2.0-beta.15

Post by lexikos » 09 Nov 2022, 20:44

Changed SendEvent to not disable BlockInput while sending Alt. This was done to work around a bug in certain Windows XP versions, and isn't necessary on other OSes.
Changed date functions and options to reject values containing non-digit characters (same as IsTime).
Improved validation of Gui "E" and "LV" options to reject any non-numeric suffix.
Made several optimizations to code size.
Adjusted some error messages.

Fixed undefined behaviour when parameter #3 of RegWrite is omitted and no registry loop is running.
Fixed debugger breakpoints on lines with fat arrow functions.
Fixed Gui showing off-screen by default if shown before controls are added.
Fixed some String parameters not accepting/converting pure Integers.
Fixed MultiLineEditCtrl.Value := SingleLineText throwing MemoryError. (This affected the editor settings GUI.)

SHA256 hashes

Locked

Return to “Announcements”