Script that works with Win x64 but not Win x86

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jose Hidalgo
Posts: 222
Joined: 07 Mar 2021, 07:44

Script that works with Win x64 but not Win x86

Post by Jose Hidalgo » 27 Jul 2021, 17:22

Hi all,

A user of my script has reported that it doesn't work with his Windows 32bit version.
I only have Windows 64bit so I can't test it myself.
However, I thought AHK scripts were automatically compatible with both Windows versions.
Mine was compiled with AutoHotkey_1.1.33.04.

Could somebody help me solve this ? What should I do ?

Thanks in advance.

gregster
Posts: 8918
Joined: 30 Sep 2013, 06:48

Re: Script that works with Win x64 but not Win x86

Post by gregster » 27 Jul 2021, 17:32

If it's compiled, you need to compile a version for 32 bit, if a Win32 user should be able to use it. They can't run 64-bit executables. Generally, not just AHK exes.
A Win64 user, on the other hand, can usually run 32-bit executables.

Even if you run Win64, you should be able to compile a 32-bit exe by choosing the appropriate base file in ahk2exe.

Jose Hidalgo
Posts: 222
Joined: 07 Mar 2021, 07:44

Re: Script that works with Win x64 but not Win x86

Post by Jose Hidalgo » 28 Jul 2021, 10:34

Thanks for the tip. I was using the default compiler option, I hadn't noticed that 64bit would be the default.
Choices seem to be ANSI 32bit, Unicode 32bit and Unicode 64bit.

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Script that works with Win x64 but not Win x86

Post by SOTE » 28 Jul 2021, 11:30

@Jose Hidalgo

You will see a lot of people pushing 64-bit programs really hard, but we are not truly in a 64-bit world yet. There are a lot of technophiles who want to be on the edge of everything, but that's not the case for the majority or common users. Even the new Windows 11 will support 32-bit applications. So if you have an application that you are sending out for others to use, you have to factor in there are people still running 32-bit OS versions of Windows 7, Windows 8, and even Windows 10.

Until Microsoft truly puts the hammer down and refuses to support 32-bit applications, it might be the better choice to go with 32-bit. It appears this will remain the case until 2025 or so. Maybe Windows 12 (or equivalent) is when Microsoft will only embrace 64-bit.

While Microsoft, for various reasons, is not putting the hammer down on 32-bit applications, other OSes/companies have. So Apple (macOS/iOS) and Google (Android) will only support 64-bit applications. But, even these OSes/companies are having some issues with complete switch over. People have a lot of 32-bit programs on those OSes that they want to run. Their issues, however, would not usually concern Windows users or Windows only applications, unless you were a cross-platform developer. And AutoHotkey is not such a programming language. If you were faced with the unusual problem of needing to run AutoHotkey programs on other 64-bit only OSes, you could try using WINE (Linux/Android) or Parallels (for macOS). Parallels (which is payware) for example, allows you to run 32-bit applications on the macOS, despite it now being officially "64-bit only".

Jose Hidalgo
Posts: 222
Joined: 07 Mar 2021, 07:44

Re: Script that works with Win x64 but not Win x86

Post by Jose Hidalgo » 28 Jul 2021, 17:20

Absolutely. Which is why I don't understand why 64bit would be AHK's default compiling option.
I was pretty sure that it would be 32bit, and a user of my script had to come and tell me that it didn't work on 32-bit systems for me to understand the cause. o_O

gregster
Posts: 8918
Joined: 30 Sep 2013, 06:48

Re: Script that works with Win x64 but not Win x86

Post by gregster » 28 Jul 2021, 18:34

I think the ahk2exe default depends on what AHK version you installed on your computer - if you installed 64-bit AHK, it makes generally sense to also compile in 64 bit, by default.
It makes no sense to default to a different, dying architecture. That would be unexpected behaviour, imho.

That 64 bit exes generally won't work on 32 bit systems should be general knowledge for every developer on Windows, like an awareness about the bitness of the applications you ship.

Jose Hidalgo
Posts: 222
Joined: 07 Mar 2021, 07:44

Re: Script that works with Win x64 but not Win x86

Post by Jose Hidalgo » 29 Jul 2021, 05:57

Thanks to all of you. That makes sense.

I assumed that AHK was geared towards the biggest possible compatibility, so I thought the compiled scripts would default to 32bit. To me that was just natural.
Now that I know that it's not the case, I'll be happy to set the right settings in the future.

Here's a comment though : nothing in the AHK compiler lets you know what "Default" means. That is very wrong IMHO. Instead of "Default", the "default" option should be clearly displayed (in this case, Unicode 64-bit).
Attachments
2021.07.29 - 12.55.35.png
2021.07.29 - 12.55.35.png (30.13 KiB) Viewed 548 times

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

Re: Script that works with Win x64 but not Win x86

Post by TAC109 » 29 Jul 2021, 16:09

nothing in the AHK compiler lets you know what "Default" means.
I’m currently adding enhancements to Ahk2Exe, including showing more details for the base file. There is a functional beta here which includes this enhancement.
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

Jose Hidalgo
Posts: 222
Joined: 07 Mar 2021, 07:44

Re: Script that works with Win x64 but not Win x86

Post by Jose Hidalgo » 30 Jul 2021, 02:46

Thank you very much for your efforts :)

Post Reply

Return to “Ask for Help (v1)”