Installer - Running script without #Requires

Discuss the future of the AutoHotkey language
User avatar
kczx3
Posts: 1648
Joined: 06 Oct 2015, 21:39

Installer - Running script without #Requires

03 Nov 2022, 07:44

This is the first that I've noticed this occur. I write pretty much any new scripts in v2, but have plenty of things running with my v1 installation still. My currently installed v1 version is 1.1.33.11. The only reason I haven't installed the latest is because, again, I don't write v1 stuff anymore so its just not a priority. Today though, after rebooting my machine last night, I was prompted by the below upon startup of one of my scripts. This script and its #Includes do not contain any #Requires directives that I can see. So I'm wondering why the launcher is prompting me to upgrade. I don't recall this happening with the 1.1.34.0 version but perhaps there's something different in the launcher/install code now. I just want to understand what's happening better. I wouldn't have thought that the launcher would recommend installing anything if there wasn't a #Requires directive to instruct the launcher that the currently available versions are insufficient to run the script I'm attempting to.
image.png
image.png (12.92 KiB) Viewed 1374 times
User avatar
kczx3
Posts: 1648
Joined: 06 Oct 2015, 21:39

Re: Installer - Running script without #Requires

03 Nov 2022, 07:55

From what I can tell, this occurred now because the UX\installed-files.csv does not contain any references to the v1 executables. I can't be certain if it used to but I feel like it must have...

Code: Select all

Hash,Version,Path,Description
4b11d6089c59b68bc4804fe9e46ed3e2,2.0-beta.13,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey.lnk",""
e3f2ad7733f3166fe770e4dc00af6c45,2.0-beta.13,"license.txt",""
615b534a39f33e2b27f36cbc06178ae9,2.0-beta.13,"UX\AutoHotkeyUX.exe","AutoHotkey 64-bit"
165b8fc572f943e3665994f87f1772b7,2.0-beta.13,"UX\inc\bounce-v1.ahk",""
e8d9a7e78d6a2a40bfb532b4812bde59,2.0-beta.13,"UX\inc\CommandLineToArgs.ahk",""
740b900755de1010e943308d050dfe85,2.0-beta.13,"UX\inc\common.ahk",""
248b58535f55eb55d9baec04a384b5e6,2.0-beta.13,"UX\inc\config.ahk",""
5ce5a62eddd9241472092b870abbfc81,2.0-beta.13,"UX\inc\CreateAppShortcut.ahk",""
a3e0ea84c0e5d1cc8681ddb3740ea3e5,2.0-beta.13,"UX\inc\EnableUIAccess.ahk",""
1a8ab9bb38fd0da51d03dc48e3a0b2ea,2.0-beta.13,"UX\inc\GetGitHubReleaseAssetURL.ahk",""
727ae6f2ec77a5b56774df9da14636d2,2.0-beta.13,"UX\inc\HashFile.ahk",""
c4f4b01aac51b0d52243a3c6b508273f,2.0-beta.13,"UX\inc\identify.ahk",""
438172d2588bcf7590b796c8d7cc4d4f,2.0-beta.13,"UX\inc\identify_regex.ahk",""
696750c1861231d07ff4548ad4360dc8,2.0-beta.13,"UX\inc\launcher-common.ahk",""
f4251e653dbbbdd8cf4640bd9855c207,2.0-beta.13,"UX\inc\ui-base.ahk",""
e07a8cb640419453dcc1d36700cd2d5c,2.0-beta.13,"UX\install-ahk2exe.ahk",""
98ef50c8c62d5d9bba8e7baa76e4b2a6,2.0-beta.13,"UX\install-version.ahk",""
797618c5904c22ff9d2b695929ec7d7a,2.0-beta.13,"UX\install.ahk",""
be92d010ef2b8ab65197d969aba74665,2.0-beta.13,"UX\launcher.ahk",""
35f4753a58432446b99bf89a9e930bf5,2.0-beta.13,"UX\reload-v1.ahk",""
9281f6fd974fdd58380ce0df2861edda,2.0-beta.13,"UX\reset-assoc.ahk",""
541cf06ba73c3330a64674cd9279173f,2.0-beta.13,"UX\Templates\Minimal for v2.ahk",""
9ba3fd73c6d9bb174f3bd9fd4a4a03ce,2.0-beta.13,"UX\ui-dash.ahk",""
57197130eee30d15be71fd17baef7279,2.0-beta.13,"UX\ui-editor.ahk",""
72689eb3ffd33878712faa56e095f146,2.0-beta.13,"UX\ui-launcherconfig.ahk",""
c094d7fff6b3d880754512dc469b7507,2.0-beta.13,"UX\ui-newscript.ahk",""
ef05766441045737486c04f8974783f8,2.0-beta.13,"UX\ui-setup.ahk",""
41b90f26d7d15857be816581301aa8ee,2.0-beta.13,"UX\ui-uninstall.ahk",""
f3a7c29bb581bed60377b08a48d9e3bf,2.0-beta.13,"UX\WindowSpy.ahk",""
4f8baaa8bb14c744b54e9b99736b616a,2.0-beta.10,"v2.0-beta.10\AutoHotkey.chm",""
d3d9d268ae61ef0fa633cc837f1c8ca7,2.0-beta.10,"v2.0-beta.10\AutoHotkey32.exe","AutoHotkey 32-bit"
5d184811414bf030eb40c5058cb28128,2.0-beta.10,"v2.0-beta.10\AutoHotkey32_UIA.exe","AutoHotkey 32-bit UIA"
22b157f4b33ebad51e35eb6bdfbe6bac,2.0-beta.10,"v2.0-beta.10\AutoHotkey64.exe","AutoHotkey 64-bit"
60dcc1c5e21b63beda529e3e7d7b0263,2.0-beta.10,"v2.0-beta.10\AutoHotkey64_UIA.exe","AutoHotkey 64-bit UIA"
9509bd16b27f367aa5a1c3c47c370b2b,2.0-beta.11,"v2.0-beta.11\AutoHotkey.chm",""
8419e55724bb40a6d2aa3792d770e6ef,2.0-beta.11,"v2.0-beta.11\AutoHotkey32.exe","AutoHotkey 32-bit"
7bfadb631e905fcc8c511ea39ebeba04,2.0-beta.11,"v2.0-beta.11\AutoHotkey32_UIA.exe","AutoHotkey 32-bit UIA"
7bf996ee6b4594df41b066a5ef89ebba,2.0-beta.11,"v2.0-beta.11\AutoHotkey64.exe","AutoHotkey 64-bit"
c3dc4f922bd29a3a7432b4c02f912390,2.0-beta.11,"v2.0-beta.11\AutoHotkey64_UIA.exe","AutoHotkey 64-bit UIA"
93eca5e6759fe0f576d85651ed41fecd,2.0-beta.13,"v2.0-beta.13\AutoHotkey.chm",""
42f8cb6720590a3384a8dbabba0099cd,2.0-beta.13,"v2.0-beta.13\AutoHotkey32.exe","AutoHotkey 32-bit"
75d6af3e7a8375c387975ad836634427,2.0-beta.13,"v2.0-beta.13\AutoHotkey32_UIA.exe","AutoHotkey 32-bit UIA"
615b534a39f33e2b27f36cbc06178ae9,2.0-beta.13,"v2.0-beta.13\AutoHotkey64.exe","AutoHotkey 64-bit"
ff27ab87e80815ba3216d8e30181eed1,2.0-beta.13,"v2.0-beta.13\AutoHotkey64_UIA.exe","AutoHotkey 64-bit UIA"
User avatar
kczx3
Posts: 1648
Joined: 06 Oct 2015, 21:39

Re: Installer - Running script without #Requires

03 Nov 2022, 09:40

Since I couldn't really wait, I went ahead and installed 1.1.35.0 via the dialog in my OP. This process updated my installed-files.csv to now contain references to both 1.1.33.11 and 1.1.35.0.

Code: Select all

Hash,Version,Path,Description
43fd1c9ac3ffcea0d4ee1c7691befb07,1.1.35.00,"AutoHotkey.chm",""
52655df7559965a3900278b30e89ec29,1.1.35.00,"AutoHotkey.exe","AutoHotkey Unicode 64-bit"
448cfff85fcc0d3cabf86fc5cb9162a6,1.1.35.00,"AutoHotkeyA32.exe","AutoHotkey ANSI 32-bit"
1a05d1c4f4d7f78dfa06daed80f11f3c,1.1.35.00,"AutoHotkeyA32_UIA.exe","AutoHotkey ANSI 32-bit UIA"
a5f4d9514351e6f1ae28acf093e17d24,1.1.35.00,"AutoHotkeyU32.exe","AutoHotkey Unicode 32-bit"
5e625868df9b6f133c85f780b64b4033,1.1.35.00,"AutoHotkeyU32_UIA.exe","AutoHotkey Unicode 32-bit UIA"
52655df7559965a3900278b30e89ec29,1.1.35.00,"AutoHotkeyU64.exe","AutoHotkey Unicode 64-bit"
4582a264e7d1f4676a8ec46a69c7d88d,1.1.35.00,"AutoHotkeyU64_UIA.exe","AutoHotkey Unicode 64-bit UIA"
4b11d6089c59b68bc4804fe9e46ed3e2,2.0-beta.13,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey.lnk",""
dea0cbc635fba2c78c2e12dcf8325cad,1.1.35.00,"Compiler\Ahk2Exe.exe","AutoHotkey Script Compiler"
489cd68d025c0b655447d8ee739e3004,1.1.35.00,"Compiler\ANSI 32-bit.bin",""
a33600cfa61861b9426512dc034526c3,1.1.35.00,"Compiler\Unicode 32-bit.bin",""
a586c8edfc069d43ca18a2674a85d648,1.1.35.00,"Compiler\Unicode 64-bit.bin",""
e3f2ad7733f3166fe770e4dc00af6c45,2.0-beta.13,"license.txt",""
615b534a39f33e2b27f36cbc06178ae9,2.0-beta.13,"UX\AutoHotkeyUX.exe","AutoHotkey 64-bit"
165b8fc572f943e3665994f87f1772b7,2.0-beta.13,"UX\inc\bounce-v1.ahk",""
e8d9a7e78d6a2a40bfb532b4812bde59,2.0-beta.13,"UX\inc\CommandLineToArgs.ahk",""
740b900755de1010e943308d050dfe85,2.0-beta.13,"UX\inc\common.ahk",""
248b58535f55eb55d9baec04a384b5e6,2.0-beta.13,"UX\inc\config.ahk",""
5ce5a62eddd9241472092b870abbfc81,2.0-beta.13,"UX\inc\CreateAppShortcut.ahk",""
a3e0ea84c0e5d1cc8681ddb3740ea3e5,2.0-beta.13,"UX\inc\EnableUIAccess.ahk",""
1a8ab9bb38fd0da51d03dc48e3a0b2ea,2.0-beta.13,"UX\inc\GetGitHubReleaseAssetURL.ahk",""
727ae6f2ec77a5b56774df9da14636d2,2.0-beta.13,"UX\inc\HashFile.ahk",""
c4f4b01aac51b0d52243a3c6b508273f,2.0-beta.13,"UX\inc\identify.ahk",""
438172d2588bcf7590b796c8d7cc4d4f,2.0-beta.13,"UX\inc\identify_regex.ahk",""
696750c1861231d07ff4548ad4360dc8,2.0-beta.13,"UX\inc\launcher-common.ahk",""
f4251e653dbbbdd8cf4640bd9855c207,2.0-beta.13,"UX\inc\ui-base.ahk",""
e07a8cb640419453dcc1d36700cd2d5c,2.0-beta.13,"UX\install-ahk2exe.ahk",""
98ef50c8c62d5d9bba8e7baa76e4b2a6,2.0-beta.13,"UX\install-version.ahk",""
797618c5904c22ff9d2b695929ec7d7a,2.0-beta.13,"UX\install.ahk",""
be92d010ef2b8ab65197d969aba74665,2.0-beta.13,"UX\launcher.ahk",""
35f4753a58432446b99bf89a9e930bf5,2.0-beta.13,"UX\reload-v1.ahk",""
9281f6fd974fdd58380ce0df2861edda,2.0-beta.13,"UX\reset-assoc.ahk",""
541cf06ba73c3330a64674cd9279173f,2.0-beta.13,"UX\Templates\Minimal for v2.ahk",""
9ba3fd73c6d9bb174f3bd9fd4a4a03ce,2.0-beta.13,"UX\ui-dash.ahk",""
57197130eee30d15be71fd17baef7279,2.0-beta.13,"UX\ui-editor.ahk",""
72689eb3ffd33878712faa56e095f146,2.0-beta.13,"UX\ui-launcherconfig.ahk",""
c094d7fff6b3d880754512dc469b7507,2.0-beta.13,"UX\ui-newscript.ahk",""
ef05766441045737486c04f8974783f8,2.0-beta.13,"UX\ui-setup.ahk",""
41b90f26d7d15857be816581301aa8ee,2.0-beta.13,"UX\ui-uninstall.ahk",""
f3a7c29bb581bed60377b08a48d9e3bf,2.0-beta.13,"UX\WindowSpy.ahk",""
bb18f1af744506d5ea6aaf63d0417d90,1.1.33.11,"v1.1.33.11\ANSI 32-bit.bin",""
80af31143b6aa5c537e331e7cc5c8763,1.1.33.11,"v1.1.33.11\AutoHotkey.chm",""
4d28e95f49ce994b344394eb40b3404b,1.1.33.11,"v1.1.33.11\AutoHotkeyA32.exe","AutoHotkey ANSI 32-bit"
ec8dea9ab3fba59bdd954dfc32c0daf7,1.1.33.11,"v1.1.33.11\AutoHotkeyU32.exe","AutoHotkey Unicode 32-bit"
3ef67a6b19ca53780fd3059351d16154,1.1.33.11,"v1.1.33.11\AutoHotkeyU64.exe","AutoHotkey Unicode 64-bit"
f4d90ce3072be598802fbb2377ef1afa,1.1.33.11,"v1.1.33.11\Unicode 32-bit.bin",""
8e2b8d17dd0bc8a7764b8042fc6ea9ca,1.1.33.11,"v1.1.33.11\Unicode 64-bit.bin",""
4f8baaa8bb14c744b54e9b99736b616a,2.0-beta.10,"v2.0-beta.10\AutoHotkey.chm",""
d3d9d268ae61ef0fa633cc837f1c8ca7,2.0-beta.10,"v2.0-beta.10\AutoHotkey32.exe","AutoHotkey 32-bit"
5d184811414bf030eb40c5058cb28128,2.0-beta.10,"v2.0-beta.10\AutoHotkey32_UIA.exe","AutoHotkey 32-bit UIA"
22b157f4b33ebad51e35eb6bdfbe6bac,2.0-beta.10,"v2.0-beta.10\AutoHotkey64.exe","AutoHotkey 64-bit"
60dcc1c5e21b63beda529e3e7d7b0263,2.0-beta.10,"v2.0-beta.10\AutoHotkey64_UIA.exe","AutoHotkey 64-bit UIA"
9509bd16b27f367aa5a1c3c47c370b2b,2.0-beta.11,"v2.0-beta.11\AutoHotkey.chm",""
8419e55724bb40a6d2aa3792d770e6ef,2.0-beta.11,"v2.0-beta.11\AutoHotkey32.exe","AutoHotkey 32-bit"
7bfadb631e905fcc8c511ea39ebeba04,2.0-beta.11,"v2.0-beta.11\AutoHotkey32_UIA.exe","AutoHotkey 32-bit UIA"
7bf996ee6b4594df41b066a5ef89ebba,2.0-beta.11,"v2.0-beta.11\AutoHotkey64.exe","AutoHotkey 64-bit"
c3dc4f922bd29a3a7432b4c02f912390,2.0-beta.11,"v2.0-beta.11\AutoHotkey64_UIA.exe","AutoHotkey 64-bit UIA"
93eca5e6759fe0f576d85651ed41fecd,2.0-beta.13,"v2.0-beta.13\AutoHotkey.chm",""
42f8cb6720590a3384a8dbabba0099cd,2.0-beta.13,"v2.0-beta.13\AutoHotkey32.exe","AutoHotkey 32-bit"
75d6af3e7a8375c387975ad836634427,2.0-beta.13,"v2.0-beta.13\AutoHotkey32_UIA.exe","AutoHotkey 32-bit UIA"
615b534a39f33e2b27f36cbc06178ae9,2.0-beta.13,"v2.0-beta.13\AutoHotkey64.exe","AutoHotkey 64-bit"
ff27ab87e80815ba3216d8e30181eed1,2.0-beta.13,"v2.0-beta.13\AutoHotkey64_UIA.exe","AutoHotkey 64-bit UIA"
lexikos
Posts: 9666
Joined: 30 Sep 2013, 04:07
Contact:

Re: Installer - Running script without #Requires

03 Nov 2022, 19:29

It relates to the following change:
lexikos wrote:
09 Oct 2022, 03:00
Optimized the launcher to locate interpreters via installed-files.csv (fixes potential delays caused by antivirus).
The interpreters must be installed for the launcher to find them. Normally v2 installation (even of a previous beta) would have registered the v1 files that were already present, if they were in the location normally used by the v1 installer and the registry says the current installed version is 1.x.

The previous method was to scan the file system every time, but Windows Defender had a tendency to cause delays (around 3 seconds for me) at startup or sporadically after that.

kczx3 wrote: I wouldn't have thought that the launcher would recommend installing anything if there wasn't a #Requires directive to instruct the launcher that the currently available versions are insufficient to run the script I'm attempting to.
The v1 versions weren't available. The launcher detected that v1 was required but couldn't detect any v1 interpreters.

The launcher could scan the file system as a fallback when no appropriate interpreter is found in the list, but I'm not sure that it would be worthwhile, or what conditions would lead to the interpreters not being registered in the first place.

I considered automatically maintaining a cache of interpreters per user (since the launcher usually doesn't run as admin), but it seemed unnecessarily complicated given that interpreters should only be added or removed by the installer.
... now contain references to both 1.1.33.11 and 1.1.35.0.
I do not see how installing via the dialog could have that effect. It should only add the files that it installs (1.1.35.00). Any previously existing files are added (via the UpgradeV1 method) only if the installed version indicated in the registry is 1.x when an installation is performed. The (recently added) part of the process that shifts the existing files into a subdirectory to keep the latest v1 in the root doesn't check whether the preexisting files were actually "installed", so it has the effect of integrating them.
User avatar
kczx3
Posts: 1648
Joined: 06 Oct 2015, 21:39

Re: Installer - Running script without #Requires

03 Nov 2022, 20:39

I would have thought that installation of beta.13 would have indexed the existing v1 version. Nonetheless, installing the latest worked just fine for me.
lexikos
Posts: 9666
Joined: 30 Sep 2013, 04:07
Contact:

Re: Installer - Running script without #Requires

03 Nov 2022, 20:56

Any previous v2 installation should have already indexed the existing v1 version unless you "installed" it manually, by copying files, or manually removed v1 from the registry prior to installing v2. Similar conditions might come about due to an error during a previous installation. There might be other cases I have not accounted for, but I have tested repeatedly with a range of v1 and v2 installations in various combinations.

The installer is selective about when it registers files that were already present because one of the purposes of having a list of installed files and hashes is to avoid (silently) overwriting or removing customizations that a user makes to the installation.

I chose not to use much time or code to account for previous beta installations because of what they are. My priority is getting the behaviour right for the stable release and beyond.
User avatar
kczx3
Posts: 1648
Joined: 06 Oct 2015, 21:39

Re: Installer - Running script without #Requires

03 Nov 2022, 21:00

No worries 😊 thanks for your time as always!

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: kczx3 and 4 guests