GroggyOtter / ahkv2_definition_rewrite

Full update of the definition file for THQBY's AHKv2 support addon.
67 stars 7 forks source link

Updater overwrites main AHK script #7

Open griffithska opened 3 months ago

griffithska commented 3 months ago

I downloaded the latest definition_updater.v2.ahk script and added an #Include in my main.ahk script. When it ran to update itself it overwrote my main.ahk script with itself. I reverted the changes and ran it again and found that in the dialog box it was was asking to overwrite main.ahk again. image

It appears that if the script is run using an #Include from another script the A_ScriptFullPath is that parent script, not the actual updater script. I did some experimenting and found that replacing A_ScriptFullPath with A_LineFile seems to produce the correct file path regardless of if it is running independently or via an #Include.

At Line 114: file_path := A_LineFile ;A_ScriptFullPath

GroggyOtter commented 1 month ago

Thanks for reporting it.
I never thought about #Include scenarios.
I'm not in a place, physically or mentally, to write code or fix anything right now.
If I get better, I'll fix it.

griffithska commented 1 month ago

Thank you for the response. Sorry to hear and I hope things improve for you.